Skip to content

Commit 247861c

Browse files
Daniil LunevMiklos Szeredi
authored andcommitted
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>
1 parent 04b9407 commit 247861c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

fs/fuse/inode.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,14 @@ static void fuse_umount_begin(struct super_block *sb)
482482
{
483483
struct fuse_conn *fc = get_fuse_conn_super(sb);
484484

485-
if (!fc->no_force_umount)
486-
fuse_abort_conn(fc);
485+
if (fc->no_force_umount)
486+
return;
487+
488+
fuse_abort_conn(fc);
489+
490+
// Only retire block-device-based superblocks.
491+
if (sb->s_bdev != NULL)
492+
retire_super(sb);
487493
}
488494

489495
static void fuse_send_destroy(struct fuse_mount *fm)

0 commit comments

Comments
 (0)