Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1528853 > unrolled thread

fuse: feasible to distinguish between umount and abort?

Started byNikolaus Rath <Nikolaus@rath.org>
First post2016-11-24 00:20 +0100
Last post2016-11-25 01:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  fuse: feasible to distinguish between umount and abort? Nikolaus Rath <Nikolaus@rath.org> - 2016-11-24 00:20 +0100
    Re: [fuse-devel] fuse: feasible to distinguish between umount and abort? Miklos Szeredi <miklos@szeredi.hu> - 2016-11-24 10:20 +0100
      Re: [fuse-devel] fuse: feasible to distinguish between umount and abort? Nikolaus Rath <Nikolaus@rath.org> - 2016-11-25 01:40 +0100

#1528853 — fuse: feasible to distinguish between umount and abort?

FromNikolaus Rath <Nikolaus@rath.org>
Date2016-11-24 00:20 +0100
Subjectfuse: feasible to distinguish between umount and abort?
Message-ID<sGOZz-2Sk-17@gated-at.bofh.it>
Hello,

Currently, both a call to umount(2) and writing "1" to
/sys/fs/fuse/connections/NNN/abort will put the /dev/fuse fd into the
same state: reading from it returns ENODEV, and polling on it returns
POLLERR.

This causes problems for filesystems that want to ensure that the
mountpoint is free when they exit. If accessing the device fd gives the
above errors, they have to do an additional check to determine if they
still need to unmount the mountpoint. This is difficult to do without
race conditions (think of someone unmounting and immediately re-starting
a new filesystem instance).

Would it be possible to change the behavior of the /dev/fuse fd so that
userspace can distinguish between a regular umount and use of the
/sys/fs/fuse abort)?


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

[toc] | [next] | [standalone]


#1529087 — Re: [fuse-devel] fuse: feasible to distinguish between umount and abort?

FromMiklos Szeredi <miklos@szeredi.hu>
Date2016-11-24 10:20 +0100
SubjectRe: [fuse-devel] fuse: feasible to distinguish between umount and abort?
Message-ID<sGYmd-HF-5@gated-at.bofh.it>
In reply to#1528853
On Thu, Nov 24, 2016 at 12:11 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
> Hello,
>
> Currently, both a call to umount(2) and writing "1" to
> /sys/fs/fuse/connections/NNN/abort will put the /dev/fuse fd into the
> same state: reading from it returns ENODEV, and polling on it returns
> POLLERR.
>
> This causes problems for filesystems that want to ensure that the
> mountpoint is free when they exit. If accessing the device fd gives the
> above errors, they have to do an additional check to determine if they
> still need to unmount the mountpoint. This is difficult to do without
> race conditions (think of someone unmounting and immediately re-starting
> a new filesystem instance).
>
> Would it be possible to change the behavior of the /dev/fuse fd so that
> userspace can distinguish between a regular umount and use of the
> /sys/fs/fuse abort)?

Yes.  My proposal would be for the kernel to send FUSE_DESTROY
asynchronously and only return ENODEV once that request was read by
userspace.  Currently FUSE_DESTROY is sent synchronously for fuseblk
mounts, but not for plain fuse mounts.

Please file a bug somewhere.  I don't mind if kernel bugs are also
kept at the github project as long as they can easily be found.

Thanks,
Miklos

[toc] | [prev] | [next] | [standalone]


#1529757 — Re: [fuse-devel] fuse: feasible to distinguish between umount and abort?

FromNikolaus Rath <Nikolaus@rath.org>
Date2016-11-25 01:40 +0100
SubjectRe: [fuse-devel] fuse: feasible to distinguish between umount and abort?
Message-ID<sHcIx-1PA-1@gated-at.bofh.it>
In reply to#1529087
On Nov 24 2016, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Thu, Nov 24, 2016 at 12:11 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>> Hello,
>>
>> Currently, both a call to umount(2) and writing "1" to
>> /sys/fs/fuse/connections/NNN/abort will put the /dev/fuse fd into the
>> same state: reading from it returns ENODEV, and polling on it returns
>> POLLERR.
>>
>> This causes problems for filesystems that want to ensure that the
>> mountpoint is free when they exit. If accessing the device fd gives the
>> above errors, they have to do an additional check to determine if they
>> still need to unmount the mountpoint. This is difficult to do without
>> race conditions (think of someone unmounting and immediately re-starting
>> a new filesystem instance).
>>
>> Would it be possible to change the behavior of the /dev/fuse fd so that
>> userspace can distinguish between a regular umount and use of the
>> /sys/fs/fuse abort)?
>
> Yes.  My proposal would be for the kernel to send FUSE_DESTROY
> asynchronously and only return ENODEV once that request was read by
> userspace.  Currently FUSE_DESTROY is sent synchronously for fuseblk
> mounts, but not for plain fuse mounts.

I trust that this is a good plan, but from the description I can't quite
tell how the filesystem would make the distinction between umount/abort
based on this. Would FUSE_DESTROY be send only for unmount, but not for
abort?


> Please file a bug somewhere.  I don't mind if kernel bugs are also
> kept at the github project as long as they can easily be found.

Already done at https://github.com/libfuse/libfuse/issues/122.


Thanks!
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web