From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbcHPTpR (ORCPT ); Tue, 16 Aug 2016 15:45:17 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41196 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbcHPTpQ (ORCPT ); Tue, 16 Aug 2016 15:45:16 -0400 Message-ID: <1471376702.13300.51.camel@decadent.org.uk> Subject: Re: [PATCH 3.16 102/305] xfs: xfs_iflush_cluster fails to abort on error From: Ben Hutchings To: Dave Chinner Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, Christoph Hellwig , Shyam Kaushik , Dave Chinner Date: Tue, 16 Aug 2016 20:45:02 +0100 In-Reply-To: <20160813233652.GU19025@dastard> References: <20160813233652.GU19025@dastard> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-+BZ5ycQLIR+DKk7su0YJ" X-Mailer: Evolution 3.20.4-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 109.148.166.21 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-+BZ5ycQLIR+DKk7su0YJ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: > >=20 > > 3.16.37-rc1 review patch.=C2=A0=C2=A0If anyone has any objections, plea= se let me know. > >=20 > > ------------------ > >=20 > > > > From: Dave Chinner > >=20 > > commit b1438f477934f5a4d5a44df26f3079a7575d5946 upstream. > >=20 > > 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. > >=20 > > Fix this by ensuring fatal errors from xfs_imap_to_bp() result in > > the inode flush being aborted correctly. > .... > >=20 > > =C2=A0 > > > > =C2=A0 /* > > > > - =C2=A0* Get the buffer containing the on-disk inode. > > > > + =C2=A0* Get the buffer containing the on-disk inode. We are doing= a try-lock > > > > + =C2=A0* operation here, so we may get=C2=A0=C2=A0an EAGAIN error.= In that case, we > > > > + =C2=A0* simply want to return with the inode still dirty. > > > > + =C2=A0* > > > > + =C2=A0* If we get any other error, we effectively have a corrupti= on situation > > > > + =C2=A0* and we cannot flush the inode, so we treat it the same as= failing > > > > + =C2=A0* xfs_iflush_int(). > > > > =C2=A0 =C2=A0*/ > > > > =C2=A0 error =3D xfs_imap_to_bp(mp, NULL, &ip->i_imap, &dip, &bp, X= BF_TRYLOCK, > > > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A00); > > > > - if (error || !bp) { > > > > + if (error =3D=3D -EAGAIN) { >=20 > 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? Ben. --=20 Ben Hutchings If at first you don't succeed, you're doing about average. --=-+BZ5ycQLIR+DKk7su0YJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJXs20+AAoJEOe/yOyVhhEJAaYP/3zckEDR3PBrDRaPS5ecv3qw j9jyN2gcryX+uFysUda7/El1KPBBbWGcvvIaKw6xbEwpwm3llC1aymlCCKeOxjSI fTnFBd9LMk5egUJmcb744BWhcDmZmTrHSC2pNkF45ZC+SZUIut/SABruj/AKezA+ zb41ZYudJh2BhCI9Rx53DhATgZWmKhrnlb+uv4LAvSo45nrFk9j9ewQT/2IzITR8 hSG0ijmgMO5yclMFYn+7jaPByAp0Y/QHNMRXCOh3IePCE7yJrDPhR6yUJt/oWhfj Ruan5+jE1ijQWuGJOV1bJcpjTdiDJfiaRgI3YarHcT6SGexWNP75CdFK8AGkTW5h ykpCJRyyS0XmPoDMnPcyfrbRngTj/b4MbYMrrkqtSwaVLnAxIl84tq8MerpRgwd7 M5x2dpYzEkjU6FLQWF7eYb3rr4ljnUAjcUinisO3yh1/Fy/49eyz8ej+U1jeVAaO yRzhCBfMXf9NhzuensKZS5EG3wWw4Oz3yrYtAOQHg02q19PpdcwfSNSExTCyEEw4 EEtkJxGD/zxiRFB3TVDskB6HDrPmZ6/V/jvkxZv/kr6aBLjOJN0K5OV8eMt9n6dk fhhyqRAWwjn6/kYU89boi6tvpETuxQ4VYwK0bM7V2GYFFnWwI1wCsNrjiw2SgK5y M5GcBPVdVYsEf9MSHLzS =5Mjb -----END PGP SIGNATURE----- --=-+BZ5ycQLIR+DKk7su0YJ--