From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH 2/2] xfs: fix splice/direct-IO deadlock Date: Thu, 29 Nov 2012 08:33:14 +1100 Message-ID: <20121128213314.GW6434@dastard> References: <1354068768-4316-1-git-send-email-david@fromorbit.com> <1354068768-4316-3-git-send-email-david@fromorbit.com> <20121128160736.GA14888@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com To: Christoph Hellwig Return-path: Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:45903 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932319Ab2K1VdR (ORCPT ); Wed, 28 Nov 2012 16:33:17 -0500 Content-Disposition: inline In-Reply-To: <20121128160736.GA14888@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Nov 28, 2012 at 11:07:36AM -0500, Christoph Hellwig wrote: > On Wed, Nov 28, 2012 at 01:12:48PM +1100, Dave Chinner wrote: > > From: Dave Chinner > > > > lockdep reports splice vs direct-io write lock inversions due to > > generic_file_splice_write() taking the inode->i_mutex inside > > XFS_IOLOCK_EXCL context. These lock contexts are inverted, hence can > > deadlock. Remove the XFS_IOLOCK_EXCL locking context from the outer > > function and drive it inwards to the actor function that only locks > > the inode when the lock is really needed, > > punctuation? > > Otherwise the patch looks fine, but I'd love to understand why the > generic code thes te I_MUTEX_CHILD annotation and we can get away > without it. > > Also can you add a testcase for this to xfstests? I've had trouble reproducing it reliably. The only cases I've seen it occur are some custom FIO workloads. I'll try again to see if I can come up with something that reliably hits it... Cheers, Dave. -- Dave Chinner david@fromorbit.com