From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:44248 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfDZSRz (ORCPT ); Fri, 26 Apr 2019 14:17:55 -0400 Date: Fri, 26 Apr 2019 14:17:52 -0400 From: Brian Foster Subject: Re: [PATCH 2/8] xfs: unlock inode when xfs_ioctl_setattr_get_trans can't get transaction Message-ID: <20190426181749.GC34536@bfoster> References: <155552786671.20411.6442426840435740050.stgit@magnolia> <155552787973.20411.3438010430489882890.stgit@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155552787973.20411.3438010430489882890.stgit@magnolia> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org On Wed, Apr 17, 2019 at 12:04:39PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > 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. > > Signed-off-by: Darrick J. Wong > --- Reviewed-by: Brian Foster > 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 ae615a79b266..21d6f433c375 100644 > --- a/fs/xfs/xfs_ioctl.c > +++ b/fs/xfs/xfs_ioctl.c > @@ -1153,7 +1153,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); >