Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758384AbYLLF0J (ORCPT ); Fri, 12 Dec 2008 00:26:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758081AbYLLFZK (ORCPT ); Fri, 12 Dec 2008 00:25:10 -0500 Received: from kroah.org ([198.145.64.141]:37012 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752235AbYLLFZH (ORCPT ); Fri, 12 Dec 2008 00:25:07 -0500 Date: Thu, 11 Dec 2008 21:24:01 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org, "Theodore Ts'o" , Zwane Mwaikambo , Eugene Teo , Justin Forbes , Domenico Andreoli , Chris Wedgwood , Jake Edge , Randy Dunlap , Michael Krufky , alan@lxorguk.ukuu.org.uk, Chuck Ebbert , Dave Jones , Chuck Wolber , akpm@linux-foundation.org, torvalds@linux-foundation.org, Willy Tarreau , Rodrigo Rubira Branco , Dave Chinner , Arkadiusz Miskiewicz , Lachlan McIlroy Subject: [patch 85/83] XFS: Fix hang after disallowed rename across directory quota domains Message-ID: <20081212052401.GC9024@kroah.com> References: <20081211191014.GA5759@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081211191014.GA5759@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1514 Lines: 38 From: Dave Chinner commit 576a488a27f267af203f3ea69c700a1612335e9f upstream. When project quota is active and is being used for directory tree quota control, we disallow rename outside the current directory tree. This requires a check to be made after all the inodes involved in the rename are locked. We fail to unlock the inodes correctly if we disallow the rename when the target is outside the current directory tree. This results in a hang on the next access to the inodes involved in failed rename. Reported-by: Arkadiusz Miskiewicz Signed-off-by: Dave Chinner Tested-by: Arkadiusz Miskiewicz Signed-off-by: Lachlan McIlroy Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_rename.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c @@ -212,7 +212,7 @@ xfs_rename( if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) { error = XFS_ERROR(EXDEV); - xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED); + xfs_rename_unlock4(inodes, XFS_ILOCK_EXCL); xfs_trans_cancel(tp, cancel_flags); goto std_return; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/