Commit 178c4873 authored by Kent Overstreet's avatar Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent b783fc4d
......@@ -1922,10 +1922,7 @@ static struct dentry *bch2_mount(struct file_system_type *fs_type,
return dget(sb->s_root);
err_put_super:
sb->s_fs_info = NULL;
c->vfs_sb = NULL;
deactivate_locked_super(sb);
bch2_fs_stop(c);
return ERR_PTR(bch2_err_class(ret));
}
......@@ -1933,10 +1930,7 @@ static void bch2_kill_sb(struct super_block *sb)
{
struct bch_fs *c = sb->s_fs_info;
if (c)
c->vfs_sb = NULL;
generic_shutdown_super(sb);
if (c)
bch2_fs_free(c);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment