ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
authorJoseph Qi <joseph.qi@linux.alibaba.com>
Tue, 3 Nov 2020 02:29:02 +0000 (10:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 17:25:00 +0000 (18:25 +0100)
commit9fbacd44844c614784d8a96e2aed1c197202ceba
tree6dc1dbd51b47d8d36b56fe82ee5f3b2ba4a0f890
parent28f2350893a068fbde10e6e3621672b5a0e70058
ext4: unlock xattr_sem properly in ext4_inline_data_truncate()

commit 7067b2619017d51e71686ca9756b454de0e5826a upstream.

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 <dan.carpenter@oracle.com>
Cc: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/1604370542-124630-1-git-send-email-joseph.qi@linux.alibaba.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inline.c