From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 965D57F98 for ; Thu, 31 Jul 2014 12:15:02 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2364AAC008 for ; Thu, 31 Jul 2014 10:15:02 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) by cuda.sgi.com with ESMTP id jaHV4SOGHHf2cK5l (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 31 Jul 2014 10:15:01 -0700 (PDT) Date: Thu, 31 Jul 2014 10:15:00 -0700 From: Christoph Hellwig Subject: Re: [PATCH 1/2] xfs: fix swapext ilock deadlock Message-ID: <20140731171500.GE22173@infradead.org> References: <1406787128-11897-1-git-send-email-david@fromorbit.com> <1406787128-11897-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1406787128-11897-2-git-send-email-david@fromorbit.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 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: xfs@oss.sgi.com On Thu, Jul 31, 2014 at 04:12:07PM +1000, Dave Chinner wrote: > From: Dave Chinner > > xfs_swap_extents() holds the ilock over a call to > filemap_write_and_wait(), which can then try to write data and take > the ilock. That causes a self-deadlock. > > Fix the deadlock and clean up the code by separating the locking > appropriately. Add a lockflags variable to track what locks we are > holding as we gain and drop them and cleanup the error handling to > always use "out_unlock" with the lockflags variable. > > Signed-off-by: Dave Chinner Looks good, Reviewed-by: Christoph Hellwig _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs