Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50460 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932625AbdKFTqn (ORCPT ); Mon, 6 Nov 2017 14:46:43 -0500 Message-ID: <1509997588.2748.117.camel@decadent.org.uk> Subject: Re: [PATCH 3.16-stable 08/14] gfs2: remove IS_ERR_VALUE abuse From: Ben Hutchings To: Arnd Bergmann Cc: stable@vger.kernel.org Date: Mon, 06 Nov 2017 19:46:28 +0000 In-Reply-To: <20170509100502.1358298-9-arnd@arndb.de> References: <20170509100502.1358298-1-arnd@arndb.de> <20170509100502.1358298-9-arnd@arndb.de> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-sa5W3PWKZV8pMhHgMWFQ" Mime-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: --=-sa5W3PWKZV8pMhHgMWFQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2017-05-09 at 12:04 +0200, Arnd Bergmann wrote: > Picked from commit 287980e49ffc0f6d911601e7e352a812ed27768e ("remove lots > of IS_ERR_VALUE abuses") upstream. >=20 > The original fix that was backported to 3.18 already addressed the warnin= g > in some configurations, but not in others, leaving us with the same outpu= t: >=20 > ../fs/gfs2/dir.c: In function 'get_first_leaf': > ../fs/gfs2/dir.c:768:9: warning: 'leaf_no' may be used uninitialized in t= his function [-Wmaybe-uninitialized] > error =3D get_leaf(dip, leaf_no, bh_out); > ^ > ../fs/gfs2/dir.c: In function 'dir_split_leaf.isra.20': > ../fs/gfs2/dir.c:987:8: warning: 'leaf_no' may be used uninitialized in t= his function [-Wmaybe-uninitialized] >=20 > This takes the approach that we took in later versions in mainline, > but does not backport the entire patch, as that would be too large > for stable and IIRC caused regressions in other drivers. >=20 > Fixes: 9d46d31e9aea ("gfs2: avoid uninitialized variable warning") In fact, it reverts it completely. So I've dropped both of these. Ben. > Signed-off-by: Arnd Bergmann > --- > fs/gfs2/dir.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c > index 6810c8772eb1..f3508f4583d5 100644 > --- a/fs/gfs2/dir.c > +++ b/fs/gfs2/dir.c > @@ -767,7 +767,7 @@ static int get_first_leaf(struct gfs2_inode *dip, u32= index, > int error; > =20 > error =3D get_leaf_nr(dip, index, &leaf_no); > - if (!IS_ERR_VALUE(error)) > + if (!error) > error =3D get_leaf(dip, leaf_no, bh_out); > =20 > return error; > @@ -983,7 +983,7 @@ static int dir_split_leaf(struct inode *inode, const = struct qstr *name) > =20 > index =3D name->hash >> (32 - dip->i_depth); > error =3D get_leaf_nr(dip, index, &leaf_no); > - if (IS_ERR_VALUE(error)) > + if (error) > return error; > =20 > /* Get the old leaf block */ --=20 Ben Hutchings It is a miracle that curiosity survives formal education. - Albert Einstein --=-sa5W3PWKZV8pMhHgMWFQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAloAvBQACgkQ57/I7JWG EQn/8hAAq7cPjy+km9HhEcCR1y58hc4fTXDMCczCL4eDHNVuY2exWr8M6FbVqLPI AU7SU6N3jrvlIh53AA4wJLENe/46rcOY8lYGgtYhfSSQLFQt3ej3Q9+NXMqtf87d 2a0JgVKbkhFkluPZcMp6KkNivkaXTVeH/e179eij1IDZMScX9htte04FzgMnmPFb oWzwc68hTexhCfHyAoQNaoR5QEaGakZCXLs1wWQYEtPONwaKm/Xt8Q5DN4diRIgy Pf9XRznEf1gFporboTggeJ5dhE9VUtE6a8JvlvaDid1GmiAI3Xx1Ia6kh3ZNxGgR TTe5asYb2h84qenpzqyD/1iKIH+YY7DUo4x1iIpjVyeQNAfJZoBSyStamG/UuOP4 zfQqSSLuuhfLTGA9xdJ9FcWaKmEgomkbL+lJpxErZMvM8XHogMGqG9ElSWESHt8q fBZqnwrRoxn6F9KczRszA+ZWq8hox/87USMnJeFaLS6M+AsyAMeltdQHHVhDkMee 3q2Ps+r/u1BY/CKVPQ3duAVqO8Q7xf0fBMsRNHSTa7UiB6qLkIJsLtGlfVW1vcs/ /mATVnrjUEexSB02OpyRx+LO9G+LuB5qNHmDHdOzu7u/FUsT3fnyerBo5DQaWDCi aPXs8z+BcHHWC3z2CK/B2/aOK3QDYfx95Y5YsOOAInSD7mL6tw4= =fqVk -----END PGP SIGNATURE----- --=-sa5W3PWKZV8pMhHgMWFQ--