提交 87990b92 编写于 作者: D Darrick J. Wong 提交者: Xie XiuQi

xfs: unlock inode when xfs_ioctl_setattr_get_trans can't get transaction

mainline inclusion
from mainline-5.2-rc1
commit 3de5eab3
category: bugfix
bugzilla: 19045
CVE: NA

---------------------------

We passed an inode into xfs_ioctl_setattr_get_trans with join_flags
indicating which locks are held on that inode.  If we can't allocate a
transaction then we need to unlock the inode before we bail out, like
all the other error paths do.
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: Nzhengbin <zhengbin13@huawei.com>
Reviewed-by: Nyu kuai <yukuai3@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8e2042ca
......@@ -1150,7 +1150,7 @@ xfs_ioctl_setattr_get_trans(
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp);
if (error)
return ERR_PTR(error);
goto out_unlock;
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL | join_flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册