public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Why do very few filesystems have umount helpers
@ 2024-07-28 19:09 Steve French
  2024-07-29  0:01 ` Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Steve French @ 2024-07-28 19:09 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: LKML, CIFS

I noticed that nfs has a umount helper (/sbin/umount.nfs) as does hfs
(as does /sbin/umount.udisks2).  Any ideas why those are the only
three filesystems have them but other fs don't?

Since umount does not notify the filesystem on unmount until
references are closed (unless you do "umount --force") and therefore
the filesystem is only notified at kill_sb time, an easier approach to
fixing some of the problems where resources are kept around too long
(e.g. cached handles or directory entries etc. or references on the
mount are held) may be to add a mount helper which notifies the fs
(e.g. via fs specific ioctl) when umount has begun.   That may be an
easier solution that adding a VFS call to notify the fs when umount
begins.   As you can see from fs/namespace.c there is no mount
notification normally (only on "force" unmounts)

        /*
         * If we may have to abort operations to get out of this
         * mount, and they will themselves hold resources we must
         * allow the fs to do things. In the Unix tradition of
         * 'Gee thats tricky lets do it in userspace' the umount_begin
         * might fail to complete on the first run through as other tasks
         * must return, and the like. Thats for the mount program to worry
         * about for the moment.
         */

        if (flags & MNT_FORCE && sb->s_op->umount_begin) {
                sb->s_op->umount_begin(sb);
        }


Any thoughts on why those three fs are the only cases where there are
umount helpers? And why they added them?

I do notice umount failures (which can cause the subsequent mount to
fail) on some of our functional test runs e.g. generic/043 and
generic/044 often fail to Samba with

     QA output created by 043
    +umount: /mnt-local-xfstest/scratch: target is busy.
    +mount error(16): Device or resource busy

Ideas?


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-07-30  2:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-28 19:09 Why do very few filesystems have umount helpers Steve French
2024-07-29  0:01 ` Al Viro
2024-07-29  4:16   ` Steve French
2024-07-29  4:33     ` Steve French
2024-07-29  9:50 ` Christian Brauner
2024-07-29 17:33   ` Steve French
2024-07-29 21:50     ` Steve French
2024-07-30  2:54       ` Dave Chinner
2024-07-29 17:31 ` Andreas Dilger
2024-07-29 20:26   ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox