Btrfs: check inode allocaton earlier in btrfs_fill_super
PATCH 1/1 Btrfs: check inode allocaton earlier in btrfs_fill_super
Just after it's allocation.
Signed-off-by Shen Feng <[email protected]>
--- fs/btrfs/super.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
fs/btrfs/super.c +5 -4
@@ -322,6 +322,11 @@ static int btrfs_fill_super(struct super_block *sb, disk_super = &tree_root->fs_info->super_copy; inode =btrfs_iget_locked (sb,BTRFS_FIRST_FREE_OBJECTID , tree_root->fs_info->fs_root); +if (!inode) { + err = -ENOMEM ; + goto fail_close; + } + bi =BTRFS_I (inode); bi->location.objectid = inode->i_ino; bi->location.offset =0 ;
@@ -329,10 +334,6 @@ static int btrfs_fill_super(struct super_block *sb,btrfs_set_key_type (&bi->location,BTRFS_INODE_ITEM_KEY ); -if (!inode) { - err = -ENOMEM ; - goto fail_close; - }if (inode->i_state &I_NEW ) {btrfs_read_locked_inode (inode);unlock_new_inode (inode);
Signature · 1 line
1.6.0.6