From 87990b92bbf7447ea8becd79f853348d021768c6 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 19 Aug 2019 15:08:25 +0800 Subject: [PATCH] xfs: unlock inode when xfs_ioctl_setattr_get_trans can't get transaction mainline inclusion from mainline-5.2-rc1 commit 3de5eab3fde1e379be65973a69ded29da3802133 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: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster Signed-off-by: zhengbin Reviewed-by: yu kuai Signed-off-by: Yang Yingliang --- fs/xfs/xfs_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index bad90479ade2..62b12c11a229 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -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); -- GitLab