Merge tag 'usb-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[firefly-linux-kernel-4.4.55.git] / fs / ext4 / ialloc.c
index 3a100e7a62a8343d31912a423330e11ea40e2e2a..3f32c80124470e772c8f79dce042ccadde3bd66f 100644 (file)
@@ -762,7 +762,6 @@ got:
 
                BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
                err = ext4_handle_dirty_metadata(handle, NULL, block_bitmap_bh);
-               brelse(block_bitmap_bh);
 
                /* recheck and clear flag under lock if we still need to */
                ext4_lock_group(sb, group);
@@ -775,6 +774,7 @@ got:
                        ext4_group_desc_csum_set(sb, group, gdp);
                }
                ext4_unlock_group(sb, group);
+               brelse(block_bitmap_bh);
 
                if (err)
                        goto fail;
@@ -902,6 +902,10 @@ got:
 
        ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
 
+       ei->i_inline_off = 0;
+       if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_INLINE_DATA))
+               ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
+
        ret = inode;
        dquot_initialize(inode);
        err = dquot_alloc_inode(inode);