Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 -7
+1 -7
fs/bcachefs/fs.c
··· 1922 1922 return dget(sb->s_root); 1923 1923 1924 1924 err_put_super: 1925 - sb->s_fs_info = NULL; 1926 - c->vfs_sb = NULL; 1927 1925 deactivate_locked_super(sb); 1928 - bch2_fs_stop(c); 1929 1926 return ERR_PTR(bch2_err_class(ret)); 1930 1927 } 1931 1928 ··· 1930 1933 { 1931 1934 struct bch_fs *c = sb->s_fs_info; 1932 1935 1933 - if (c) 1934 - c->vfs_sb = NULL; 1935 1936 generic_shutdown_super(sb); 1936 - if (c) 1937 - bch2_fs_free(c); 1937 + bch2_fs_free(c); 1938 1938 } 1939 1939 1940 1940 static struct file_system_type bcache_fs_type = {