diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-18 17:44:21 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:11 -0400 |
commit | 7573041ab958a14407621ef9756be49548f937e6 (patch) | |
tree | e795b75460ee083d3dc06190ce1d9c1b640f68d1 /fs/bcachefs/fs.c | |
parent | adc0e9509184da7204397f4d0410b61f75bac706 (diff) | |
download | lwn-7573041ab958a14407621ef9756be49548f937e6.tar.gz lwn-7573041ab958a14407621ef9756be49548f937e6.zip |
bcachefs: Fix bch2_mount error path
In the bch2_mount() error path, we were calling
deactivate_locked_super(), which calls ->kill_sb(), which in our case
was calling bch2_fs_free() without __bch2_fs_stop().
This changes bch2_mount() to just call bch2_fs_stop() directly.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r-- | fs/bcachefs/fs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index d2f93a8af4ac..48431700b83e 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1906,7 +1906,10 @@ out: 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)); } @@ -1914,8 +1917,11 @@ 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); - bch2_fs_free(c); + if (c) + bch2_fs_free(c); } static struct file_system_type bcache_fs_type = { |