Skip to content

Commit

Permalink
ext4: unlock on error in ext4_expand_extra_isize()
Browse files Browse the repository at this point in the history
We need to unlock the xattr before returning on this error path.

Cc: stable@kernel.org # 4.13
Fixes: c03b45b ("ext4, project: expand inode extra size if possible")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20191213185010.6k7yl2tck3wlsdkt@kili.mountain
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Dan Carpenter authored and Theodore Ts'o committed Dec 14, 2019
1 parent 707d1a2 commit 7f420d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5689,7 +5689,7 @@ int ext4_expand_extra_isize(struct inode *inode,
error = ext4_journal_get_write_access(handle, iloc->bh);
if (error) {
brelse(iloc->bh);
goto out_stop;
goto out_unlock;
}

error = __ext4_expand_extra_isize(inode, new_extra_isize, iloc,
Expand All @@ -5699,8 +5699,8 @@ int ext4_expand_extra_isize(struct inode *inode,
if (!error)
error = rc;

out_unlock:
ext4_write_unlock_xattr(inode, &no_expand);
out_stop:
ext4_journal_stop(handle);
return error;
}
Expand Down

0 comments on commit 7f420d6

Please sign in to comment.