diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-17 01:46:50 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-08 19:34:41 -0500 |
commit | d22ca7de770e2a683eac000ba4db5a95e2f4c969 (patch) | |
tree | d84fb7d68173d3ea759e8a4f8bf1cd41fd0ad10f /fs | |
parent | be7e0950def403e90b5295ff2192c39967bf2aec (diff) |
btrfs: make free_fs_info() call ->kill_sb() unconditional
... and don't bother with it after btrfs_fill_super() failure -
->kill_sb() (unlike ->put_super()) will be called even if we
have not got non-NULL ->s_root.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/super.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8901b6c85260..f628a6a79ca6 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -946,7 +946,6 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, | |||
946 | error = btrfs_fill_super(s, fs_devices, data, | 946 | error = btrfs_fill_super(s, fs_devices, data, |
947 | flags & MS_SILENT ? 1 : 0); | 947 | flags & MS_SILENT ? 1 : 0); |
948 | if (error) { | 948 | if (error) { |
949 | free_fs_info(fs_info); | ||
950 | deactivate_locked_super(s); | 949 | deactivate_locked_super(s); |
951 | return ERR_PTR(error); | 950 | return ERR_PTR(error); |
952 | } | 951 | } |
@@ -1215,12 +1214,9 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
1215 | 1214 | ||
1216 | static void btrfs_kill_super(struct super_block *sb) | 1215 | static void btrfs_kill_super(struct super_block *sb) |
1217 | { | 1216 | { |
1218 | struct btrfs_fs_info *fs_info = NULL; | 1217 | struct btrfs_fs_info *fs_info = btrfs_sb(sb)->fs_info; |
1219 | if (sb->s_root) | ||
1220 | fs_info = btrfs_sb(sb)->fs_info; | ||
1221 | kill_anon_super(sb); | 1218 | kill_anon_super(sb); |
1222 | if (fs_info) | 1219 | free_fs_info(fs_info); |
1223 | free_fs_info(fs_info); | ||
1224 | } | 1220 | } |
1225 | 1221 | ||
1226 | static struct file_system_type btrfs_fs_type = { | 1222 | static struct file_system_type btrfs_fs_type = { |