Re: [PATCH 0/5] fuse: handle release synchronously (v4)

From: Linus Torvalds
Date: Tue Sep 30 2014 - 14:23:04 EST


On Mon, Sep 29, 2014 at 10:33 PM, Anand Avati <avati@xxxxxxxxxxx> wrote:
>
> In general that sounds reasonable. The problem (as described in the original
> thread, at http://sourceforge.net/p/fuse/mailman/message/29889055/) happens
> in the presence of dup(). Tools like dd (and others) call dup(), and a
> second file descriptor is created for the same filp. Every descriptor's
> close() results in a ->flush(). The final close() of course results in
> ->release() as well.

The thing is, that final close() does not AT ALL "of course result in
->release() as well".

There are any number of things that can delat that release. Not just
mmap(), but simply things like some other process looking at the file
descriptor in /proc.

So I agree that flush can - and will - be called multiple times. So
what? That's the only thing you have if you want something
*synchronous*. Really.

fput() is not synchronous, and never will be. End of discussion. If
you think it is, you are wrong. If you try to make it so, you're
making things worse. Really. Really really.

Real filesystems handle this flush vs release difference well. If
yours does not, yours is broken. Understand that.

Linus
--
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/