Skip to content

Commit

Permalink
ext4: stop inode update before return
Browse files Browse the repository at this point in the history
The inode update should be stopped before returing the error code.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210117085732.93788-1-bianpan2016@163.com
Fixes: 8016e29 ("ext4: fast commit recovery path")
Cc: stable@kernel.org
Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
SinkFinder authored and tytso committed Mar 21, 2021
1 parent 8210bb2 commit 512c15e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5387,8 +5387,10 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
inode->i_gid = attr->ia_gid;
error = ext4_mark_inode_dirty(handle, inode);
ext4_journal_stop(handle);
if (unlikely(error))
if (unlikely(error)) {
ext4_fc_stop_update(inode);
return error;
}
}

if (attr->ia_valid & ATTR_SIZE) {
Expand Down

0 comments on commit 512c15e

Please sign in to comment.