Re: [PATCH] fs: fput() can be called from interrupt context

From: Andrew Morton
Date: Thu Mar 12 2009 - 16:25:14 EST


On Thu, 12 Mar 2009 20:22:06 +0100
Eric Dumazet <dada1@xxxxxxxxxxxxx> wrote:

> > It's somewhat encouraging that we're apparently already doing fput()
> > from within keventd (although how frequently?). There might be
> > problems with file locking, security code, etc from doing fput() from
> > an unexpected thread. And then there are all the usual weird problem
> > with using the keventd queues which take a long time to get discovered.
> >
>
> Hum... Do you mean "if (in_interrupt())" is not the right test to
> perform ?

No, in_interrupt() seems appropriate.

It's a bit weak, because it means that the proposed code can't be used
for calling fput() inside spinlock. A better interface would be to
add a new fput_atomic() and let the caller decide which functions
should be called, depending upon what context the caller is running in.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/