Skip to content

Commit 178c487

Browse files
author
Kent Overstreet
committed
bcachefs: Fix error path in bch2_mount()
This fixes a bug discovered by generic/388 where sb->s_fs_info was NULL while the superblock was still active - the error path was entirely fubar, and was trying to do something unclear and unecessary. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent b783fc4 commit 178c487

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

fs/bcachefs/fs.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,22 +1922,16 @@ static struct dentry *bch2_mount(struct file_system_type *fs_type,
19221922
return dget(sb->s_root);
19231923

19241924
err_put_super:
1925-
sb->s_fs_info = NULL;
1926-
c->vfs_sb = NULL;
19271925
deactivate_locked_super(sb);
1928-
bch2_fs_stop(c);
19291926
return ERR_PTR(bch2_err_class(ret));
19301927
}
19311928

19321929
static void bch2_kill_sb(struct super_block *sb)
19331930
{
19341931
struct bch_fs *c = sb->s_fs_info;
19351932

1936-
if (c)
1937-
c->vfs_sb = NULL;
19381933
generic_shutdown_super(sb);
1939-
if (c)
1940-
bch2_fs_free(c);
1934+
bch2_fs_free(c);
19411935
}
19421936

19431937
static struct file_system_type bcache_fs_type = {

0 commit comments

Comments
 (0)