aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ae488aa1966a..a3f435e58987 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -151,6 +151,7 @@ static void btrfs_put_super(struct super_block *sb)
151 int ret; 151 int ret;
152 152
153 ret = close_ctree(root); 153 ret = close_ctree(root);
154 free_fs_info(root->fs_info);
154 sb->s_fs_info = NULL; 155 sb->s_fs_info = NULL;
155 156
156 (void)ret; /* FIXME: need to fix VFS to return error? */ 157 (void)ret; /* FIXME: need to fix VFS to return error? */
@@ -589,6 +590,7 @@ static int btrfs_fill_super(struct super_block *sb,
589 struct inode *inode; 590 struct inode *inode;
590 struct dentry *root_dentry; 591 struct dentry *root_dentry;
591 struct btrfs_root *tree_root; 592 struct btrfs_root *tree_root;
593 struct btrfs_fs_info *fs_info;
592 struct btrfs_key key; 594 struct btrfs_key key;
593 int err; 595 int err;
594 596
@@ -609,12 +611,13 @@ static int btrfs_fill_super(struct super_block *sb,
609 printk("btrfs: open_ctree failed\n"); 611 printk("btrfs: open_ctree failed\n");
610 return PTR_ERR(tree_root); 612 return PTR_ERR(tree_root);
611 } 613 }
614 fs_info = tree_root->fs_info;
612 sb->s_fs_info = tree_root; 615 sb->s_fs_info = tree_root;
613 616
614 key.objectid = BTRFS_FIRST_FREE_OBJECTID; 617 key.objectid = BTRFS_FIRST_FREE_OBJECTID;
615 key.type = BTRFS_INODE_ITEM_KEY; 618 key.type = BTRFS_INODE_ITEM_KEY;
616 key.offset = 0; 619 key.offset = 0;
617 inode = btrfs_iget(sb, &key, tree_root->fs_info->fs_root, NULL); 620 inode = btrfs_iget(sb, &key, fs_info->fs_root, NULL);
618 if (IS_ERR(inode)) { 621 if (IS_ERR(inode)) {
619 err = PTR_ERR(inode); 622 err = PTR_ERR(inode);
620 goto fail_close; 623 goto fail_close;
@@ -635,6 +638,7 @@ static int btrfs_fill_super(struct super_block *sb,
635 638
636fail_close: 639fail_close:
637 close_ctree(tree_root); 640 close_ctree(tree_root);
641 free_fs_info(fs_info);
638 return err; 642 return err;
639} 643}
640 644