[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fuse-devel
Subject:    Re: [fuse-devel] "blocking" cleanup code executed at umount
From:       Miklos Szeredi <miklos () szeredi ! hu>
Date:       2012-01-09 13:51:49
Message-ID: 87boqd7zm2.fsf () tucsk ! pomaz ! szeredi ! hu
[Download RAW message or body]

Goswin von Brederlow <goswin-v-b@web.de> writes:

> Miklos Szeredi <miklos@szeredi.hu> writes:
>
>> But you can use a lock file (e.g. lockf(3)) to prevent two instances of
>> the filesystem running at the same time.
>
> What about filesystems of type fuseblk, where you have a real device and
> tell fuse about it? Does fuse or the kernel do adequate locking on the
> device for you?

Yes, the kernel will open the block device in exclusive mode, which
means there can't be two separate filesystem instances connected to the
same device.

Also with fuseblk the cleanup code in ->destroy() will be executed
synchronously at umount time (or more precisely when the last instance
of the filesystem is destroyed).

> What about umount? destroy() has no reply so the umount can't wait on
> that? What does it wait on?

Normally umount cannot wait for the filesystem cleanup, because that way
an unprivileged filesystem may delay (accidentally or deliberately) the
unmounter.

For fuseblk we assume that the filesystem daemon is privileged, so it is
allowed to block umount.

The unprivileged case could be improved so that if the unmounter is also
unprivileged then it can actually wait for the cleanup.  Not sure if
that is worth it, though.

Thanks,
Miklos

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic