Commit 8753e88f authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Theodore Ts'o

ext4: mark inode dirty after initializing the extent tree

We should mark the inode dirty only after initializing the extent
tree.  Also if we fail during extent initialization we need
to call DQUOT_FREE_INODE.
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent ef737728
...@@ -739,11 +739,6 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -739,11 +739,6 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
if (err) if (err)
goto fail_free_drop; goto fail_free_drop;
err = ext4_mark_inode_dirty(handle, inode);
if (err) {
ext4_std_error(sb, err);
goto fail_free_drop;
}
if (test_opt(sb, EXTENTS)) { if (test_opt(sb, EXTENTS)) {
/* set extent flag only for diretory, file and normal symlink*/ /* set extent flag only for diretory, file and normal symlink*/
if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) { if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
...@@ -752,10 +747,16 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -752,10 +747,16 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
err = ext4_update_incompat_feature(handle, sb, err = ext4_update_incompat_feature(handle, sb,
EXT4_FEATURE_INCOMPAT_EXTENTS); EXT4_FEATURE_INCOMPAT_EXTENTS);
if (err) if (err)
goto fail; goto fail_free_drop;
} }
} }
err = ext4_mark_inode_dirty(handle, inode);
if (err) {
ext4_std_error(sb, err);
goto fail_free_drop;
}
ext4_debug("allocating inode %lu\n", inode->i_ino); ext4_debug("allocating inode %lu\n", inode->i_ino);
goto really_out; goto really_out;
fail: fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment