diff options
author | Joseph Qi <[email protected]> | 2020-11-03 10:29:02 +0800 |
---|---|---|
committer | Theodore Ts'o <[email protected]> | 2020-11-06 22:52:36 -0500 |
commit | 7067b2619017d51e71686ca9756b454de0e5826a (patch) | |
tree | ba8c392b3aa53be864c35aa9934699aafe6e0b44 | |
parent | e121bd48b9eb8e3b9104d3d5d08fdf88e9ca0f97 (diff) |
ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
It takes xattr_sem to check inline data again but without unlock it
in case not have. So unlock it before return.
Fixes: aef1c8513c1f ("ext4: let ext4_truncate handle inline data correctly")
Reported-by: Dan Carpenter <[email protected]>
Cc: Tao Ma <[email protected]>
Signed-off-by: Joseph Qi <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected]
-rw-r--r-- | fs/ext4/inline.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index caa51473207d..b41512d1badc 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1880,6 +1880,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) ext4_write_lock_xattr(inode, &no_expand); if (!ext4_has_inline_data(inode)) { + ext4_write_unlock_xattr(inode, &no_expand); *has_inline = 0; ext4_journal_stop(handle); return 0; |