From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [GIT PULL] Orangefs (text only resend) Date: Tue, 8 Sep 2015 12:49:28 +1000 Message-ID: <20150908024927.GQ26895@dastard> References: <20150906063552.GA7224@lst.de> <20150906090838.GI22011@ZenIV.linux.org.uk> <20150906202019.GJ22011@ZenIV.linux.org.uk> <20150907063704.GK22011@ZenIV.linux.org.uk> <20150907232206.GL22011@ZenIV.linux.org.uk> <20150908004754.GA690@thunk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , Mike Marshall , Christoph Hellwig , Linus Torvalds , linux-fsdevel , Andrew Morton , Stephen Rothwell , Boaz Harrosh , Greg Kroah-Hartman To: Theodore Ts'o Return-path: Received: from ipmail05.adl6.internode.on.net ([150.101.137.143]:5754 "EHLO ipmail05.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbbIHCtz (ORCPT ); Mon, 7 Sep 2015 22:49:55 -0400 Content-Disposition: inline In-Reply-To: <20150908004754.GA690@thunk.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Sep 07, 2015 at 08:47:54PM -0400, Theodore Ts'o wrote: > On Tue, Sep 08, 2015 at 12:22:06AM +0100, Al Viro wrote: > > You don't want e.g. to have allocation request triggering an attempt to write > > a dirty page on a shared mapping of a file from your fs while you are holding > > a mutex that would block that attempt *and* waiting for a allocation to > > succeed. > > Mike, > > To be more explicit --- any code in your writepage/writepages > function, or code called from your writepage/writepages function has > to do all of its allocations using GFP_NOFS. Otherwise, you can end > up in a recursion where an attempt to writeback a page can trigger the > VM system to try to writeback either the same page or another page, > and then Hilarity Ensues, with either the code self-deadlocking, or in > the best case, the kernel stack getting overrun. FWIW, lockdep will issue warnings on these potentially recursive allocations, which can help you find them without having to first deadlock the machine. Cheers, Dave. -- Dave Chinner david@fromorbit.com