Skip to content

Commit d534d31

Browse files
author
Miklos Szeredi
committed
fuse: check s_root when destroying sb
Checking "fm" works because currently sb->s_fs_info is cleared on error paths; however, sb->s_root is what generic_shutdown_super() checks to determine whether the sb was fully initialized or not. This change will allow cleanup of sb setup error paths. Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 519d819 commit d534d31

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/fuse/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ static void fuse_sb_destroy(struct super_block *sb)
17471747
struct fuse_mount *fm = get_fuse_mount_super(sb);
17481748
bool last;
17491749

1750-
if (fm) {
1750+
if (sb->s_root) {
17511751
last = fuse_mount_remove(fm);
17521752
if (last)
17531753
fuse_conn_destroy(fm);

fs/fuse/virtio_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ static void virtio_kill_sb(struct super_block *sb)
13941394
bool last;
13951395

13961396
/* If mount failed, we can still be called without any fc */
1397-
if (fm) {
1397+
if (sb->s_root) {
13981398
last = fuse_mount_remove(fm);
13991399
if (last)
14001400
virtio_fs_conn_destroy(fm);

0 commit comments

Comments
 (0)