Commit 7f420d64 authored by Dan Carpenter's avatar Dan Carpenter Committed by Theodore Ts'o

ext4: unlock on error in ext4_expand_extra_isize()

We need to unlock the xattr before returning on this error path.

Cc: stable@kernel.org # 4.13
Fixes: c03b45b8 ("ext4, project: expand inode extra size if possible")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20191213185010.6k7yl2tck3wlsdkt@kili.mountainSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 707d1a2f
...@@ -5689,7 +5689,7 @@ int ext4_expand_extra_isize(struct inode *inode, ...@@ -5689,7 +5689,7 @@ int ext4_expand_extra_isize(struct inode *inode,
error = ext4_journal_get_write_access(handle, iloc->bh); error = ext4_journal_get_write_access(handle, iloc->bh);
if (error) { if (error) {
brelse(iloc->bh); brelse(iloc->bh);
goto out_stop; goto out_unlock;
} }
error = __ext4_expand_extra_isize(inode, new_extra_isize, iloc, error = __ext4_expand_extra_isize(inode, new_extra_isize, iloc,
...@@ -5699,8 +5699,8 @@ int ext4_expand_extra_isize(struct inode *inode, ...@@ -5699,8 +5699,8 @@ int ext4_expand_extra_isize(struct inode *inode,
if (!error) if (!error)
error = rc; error = rc;
out_unlock:
ext4_write_unlock_xattr(inode, &no_expand); ext4_write_unlock_xattr(inode, &no_expand);
out_stop:
ext4_journal_stop(handle); ext4_journal_stop(handle);
return error; return error;
} }
......
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