From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753495AbcHQCC4 (ORCPT ); Tue, 16 Aug 2016 22:02:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54670 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbcHQCCy (ORCPT ); Tue, 16 Aug 2016 22:02:54 -0400 Date: Wed, 17 Aug 2016 12:02:48 +1000 From: Dave Chinner To: Ben Hutchings Cc: Dave Chinner , linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, Christoph Hellwig , Shyam Kaushik Subject: Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on error Message-ID: <20160817020248.GE2031@devil.localdomain> References: <20160813233652.GU19025@dastard> <1471376702.13300.51.camel@decadent.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1471376702.13300.51.camel@decadent.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Aug 2016 02:02:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2016 at 08:45:02PM +0100, Ben Hutchings wrote: > On Sun, 2016-08-14 at 09:36 +1000, Dave Chinner wrote: > > On Sat, Aug 13, 2016 at 06:42:51PM +0100, Ben Hutchings wrote: > > > > > > 3.16.37-rc1 review patch.  If anyone has any objections, please let me know. > > > > > > ------------------ > > > > > > > > From: Dave Chinner > > > > > > commit b1438f477934f5a4d5a44df26f3079a7575d5946 upstream. > > > > > > When a failure due to an inode buffer occurs, the error handling > > > fails to abort the inode writeback correctly. This can result in the > > > inode being reclaimed whilst still in the AIL, leading to > > > use-after-free situations as well as filesystems that cannot be > > > unmounted as the inode log items left in the AIL never get removed. > > > > > > Fix this by ensuring fatal errors from xfs_imap_to_bp() result in > > > the inode flush being aborted correctly. > > .... > > > > > >   > > > > >   /* > > > > > -  * Get the buffer containing the on-disk inode. > > > > > +  * Get the buffer containing the on-disk inode. We are doing a try-lock > > > > > +  * operation here, so we may get  an EAGAIN error. In that case, we > > > > > +  * simply want to return with the inode still dirty. > > > > > +  * > > > > > +  * If we get any other error, we effectively have a corruption situation > > > > > +  * and we cannot flush the inode, so we treat it the same as failing > > > > > +  * xfs_iflush_int(). > > > > >    */ > > > > >   error = xfs_imap_to_bp(mp, NULL, &ip->i_imap, &dip, &bp, XBF_TRYLOCK, > > > > >          0); > > > > > - if (error || !bp) { > > > > > + if (error == -EAGAIN) { > > > > Wrong. As was pointed out for other -stable trees after users > > reported regressions, the error signs in XFS changed from positive > > to negative in 3.17-rc1. > > OK, so do I just need to delete the minus sign there? Yes. -Dave. -- Dave Chinner dchinner@redhat.com