From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n482v6Yj247632 for ; Thu, 7 May 2009 21:57:07 -0500 Received: from mail.sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0D70914810AD for ; Thu, 7 May 2009 20:01:20 -0700 (PDT) Received: from mail.sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id WBgedN47IjEhnCJE for ; Thu, 07 May 2009 20:01:20 -0700 (PDT) Message-ID: <4A039F85.8010506@sandeen.net> Date: Thu, 07 May 2009 21:57:09 -0500 From: Eric Sandeen MIME-Version: 1.0 Subject: Re: [PATCH] xfs: fix double unlock in xfs_swap_extents() References: <1241745202-7452-1-git-send-email-felixb@sgi.com> In-Reply-To: <1241745202-7452-1-git-send-email-felixb@sgi.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Felix Blyakher Cc: kernel-testers@vger.kernel.org, linux-kernel@vger.kernel.org, a.beregalov@gmail.com, xfs@oss.sgi.com Felix Blyakher wrote: > Regreesion from commit ef8f7fc, which rearranged the code in > xfs_swap_extents() leading to double unlock of xfs inode iolock. > That resulted in xfs_fsr deadlocking itself on platforms, which > don't handle double unlock of rw_semaphore nicely. It caused the > count go negative, which represents the write holder, without > really having one. ia64 is one of the platforms where deadlock > was easily reproduced and the fix was tested. > > Signed-off-by: Felix Blyakher Also-written-by: Eric Sandeen Independently-arrived-at-by: Eric Sandeen ;) But seriously ... Reviewed-by: Eric Sandeen > --- > fs/xfs/xfs_dfrag.c | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c > index e6d839b..7465f9e 100644 > --- a/fs/xfs/xfs_dfrag.c > +++ b/fs/xfs/xfs_dfrag.c > @@ -347,13 +347,15 @@ xfs_swap_extents( > > error = xfs_trans_commit(tp, XFS_TRANS_SWAPEXT); > > -out_unlock: > - xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); > - xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); > out: > kmem_free(tempifp); > return error; > > +out_unlock: > + xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); > + xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); > + goto out; > + > out_trans_cancel: > xfs_trans_cancel(tp, 0); > goto out_unlock; _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs