lkml.org 
[lkml]   [2014]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 0/5] fuse: handle release synchronously (v4)
From
On Thu, Oct 16, 2014 at 12:31 PM, Maxim Patlasov
<mpatlasov@parallels.com> wrote:

> Something as simple as:
>
> int main(int argc, char *argv[])
> {
> int fd = open(argv[1], O_RDWR);
> fork();
> }
>
> may easily dive into fuse_try_sync_release() concurrently and both observe
> file->f_count == 2. Then both return falling back to sending the release
> asynchronously. This makes sync/async behaviour unpredictable even for
> well-behaved applications which don't do any esoteric things like racing i/o
> with close or exiting while a descriptor is in-flight in a unix domain
> socket.
>
> I cannot see any way to recognise last flush without help of VFS layer, can
> you?

No.

One idea is to change ->flush() so it's responsible for fput()-ing the
file. That way we could take control of the actual refcount
decrement. There are only 20 flush instances in the tree, so it
wouldn't be a huge change.

Thanks,
Miklos


\
 
 \ /
  Last update: 2014-10-16 16:22    [W:0.082 / U:2.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site