diff options
author | Daniil Lunev <dlunev@chromium.org> | 2022-07-27 16:44:25 +1000 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2022-07-27 11:30:31 +0200 |
commit | 247861c325c2e4f5ad3c2f9a77ab9d85d15cbcfc (patch) | |
tree | 174d7bdf5415a614f5b60d4b051f894c5d405ef2 /fs | |
parent | 04b9407197789c81fffac52921e703cb47967d6a (diff) | |
download | linux-247861c325c2e4f5ad3c2f9a77ab9d85d15cbcfc.tar.bz2 |
fuse: retire block-device-based superblock on force unmount
Force unmount of FUSE severes the connection with the user space, even if
there are still open files. Subsequent remount tries to re-use the
superblock held by the open files, which is meaningless in the FUSE case
after disconnect - reused super block doesn't have userspace counterpart
attached to it and is incapable of doing any IO.
This patch adds the functionality only for the block-device-based supers,
since the primary use case of the feature is to gracefully handle force
unmount of external devices, mounted with FUSE. This can be further
extended to cover all superblocks, if the need arises.
Signed-off-by: Daniil Lunev <dlunev@chromium.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/inode.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 7c290089e693..6b3beda16c1b 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -482,8 +482,14 @@ static void fuse_umount_begin(struct super_block *sb) { struct fuse_conn *fc = get_fuse_conn_super(sb); - if (!fc->no_force_umount) - fuse_abort_conn(fc); + if (fc->no_force_umount) + return; + + fuse_abort_conn(fc); + + // Only retire block-device-based superblocks. + if (sb->s_bdev != NULL) + retire_super(sb); } static void fuse_send_destroy(struct fuse_mount *fm) |