From patchwork Thu Mar 1 15:27:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130271 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2951733edc; Thu, 1 Mar 2018 07:37:58 -0800 (PST) X-Google-Smtp-Source: AG47ELv2WWMQ0NRLNLE6KHYvwnJgRYGDP8nhypIj+RUZaoTczPpKBEd76beaUWzQoJuoA/Vegqx5 X-Received: by 10.98.56.131 with SMTP id f125mr2367894pfa.190.1519918677905; Thu, 01 Mar 2018 07:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918677; cv=none; d=google.com; s=arc-20160816; b=jHGoTkBjjy/LpcfWtNqQxkvCSSJ/RFx9TZgYfO7dvZXbYHaptidcmOW39dEIRgpia8 3NvwXsVJ3tx1NyBd1N1QuuMph/uunA5i9FsCUabv/xkMpNXD2lJDO/7jy0tFywZMAa7x Kq0NdmZexlJvgSnJCplNsJWyR8SO5IXdCO3Vn3C8egh9jA6pyQYDqh5HaP+mTAZyCDNJ D7/RxdIRINebLdaAY71RReIkTeUTfNGpcURsToT+k7DlTC6YvQdbmJMCFdfG84H511LG GDbt2ed6R35MF1MbNAsgO+iszszoOftHAURPEARo6EKO1a04Q9+DgLF0+KskNa183i8y t9lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=/m/H5M0xVPkpnu2JO1FrWfR6g6Xj6IJVZVI6BD9zaEY=; b=Qic0qInErr45etzSsHulvDZParmWoCq7vHbyq7j3Ofojy/MjHi1OCsB/Kz9Lz5NtB2 6zdxcyW91g8eazGBeJcYal1j+v68gKYQ+7TEK+8qi7xyxk48hvhBB/ga4yKoqE2uHyUX wu4jOELlJ19sJspsO4NcIc+E3jRtOm4q9Eh7CzI7EjLy6kus2sapyr50OkcgxkQBwo8d xuxHIwrVKtnF2dXnAq4OpDyIiXRj2Iie9qqcoOMERyUhAaOLDjcC94s3IV9YSy9Js8+K H/kF7XRiDAlTeIJyi1Iooj0y1g+jZByEyUFsitud5LR0JGo13iPvnGPTe96HM2f9bVo0 3kqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=KFD3K77x; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si2863008plk.730.2018.03.01.07.37.57; Thu, 01 Mar 2018 07:37:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=KFD3K77x; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032516AbeCAPhz (ORCPT + 10 others); Thu, 1 Mar 2018 10:37:55 -0500 Received: from mail-by2nam03on0132.outbound.protection.outlook.com ([104.47.42.132]:24496 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032530AbeCAPht (ORCPT ); Thu, 1 Mar 2018 10:37:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/m/H5M0xVPkpnu2JO1FrWfR6g6Xj6IJVZVI6BD9zaEY=; b=KFD3K77x8pjM1nXoLKtgPvmFUEZb/5Nov/St7ZrxYWDHl5bSB4lPBkTkRMymF9JcaSS/8didtKjb6nvFGfHqArgOaGjZtuVDB9ONeW0XHDibFVJEJV9tUd5Bicch+4QdiH7np2jfHqmtv2fvU7EzuhxPO2NQbRP8Fa+3q5Of6rg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1014.namprd21.prod.outlook.com (52.132.133.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.3; Thu, 1 Mar 2018 15:37:43 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:37:43 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Jan Kara , Sasha Levin Subject: [added to the 4.1 stable tree] reiserfs: avoid a -Wmaybe-uninitialized warning Thread-Topic: [added to the 4.1 stable tree] reiserfs: avoid a -Wmaybe-uninitialized warning Thread-Index: AQHTsXHEJ6QQ19gWo0iHNblJcKvpZw== Date: Thu, 1 Mar 2018 15:27:11 +0000 Message-ID: <20180301152116.1486-439-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1014; 7:FNiyZ4kyXZbf7Y2Y5K5D4cDKW4Qmn42EnTQRDbGJ2LynhvJP7clM2L7iRuCB2n9R5ohrH05CraochcDkg8tUp4JdgHUZ9ZxVApNwNI+tFJznyRR0wWRftiC2TsscpzhwKeGdMUoDekPVnhCr84S83l2YVrPq3JI5MRaNh8lkmpiA4BPgI/feZZXfPD112/761vuyw002peKkLndl7Iw2JLqeJAxmcDtiRDVEGEQv6JocwY8qABMFyzXnRA4B96Vc x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a2c397ad-cc64-4b61-d198-08d57f8a6021 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB1014; x-ms-traffictypediagnostic: DM5PR2101MB1014: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501228)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB1014; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1014; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39380400002)(346002)(39860400002)(376002)(396003)(199004)(189003)(53936002)(2906002)(3280700002)(6436002)(6486002)(3846002)(6512007)(2900100001)(6116002)(2950100002)(107886003)(6666003)(72206003)(5660300001)(36756003)(10090500001)(3660700001)(14454004)(7736002)(305945005)(97736004)(1076002)(22452003)(26005)(6506007)(105586002)(86362001)(59450400001)(478600001)(68736007)(102836004)(4326008)(6346003)(54906003)(110136005)(81156014)(81166006)(86612001)(8936002)(186003)(10290500003)(8676002)(76176011)(316002)(2501003)(66066001)(25786009)(5250100002)(106356001)(99286004)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1014; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: LtdghMA1IJW6GJySP0JlcXdE1tMkfI4afqkLHFnAHbamyrpqFJTmTUGR7NH+6PMfyJpXFNQo9f+SUZQIOxJbzhnZG7MihlsVPtk195JrJSWncyJecXUtGfMjMb7z4WnRnxw35JZaesHf8iy/xT+T+2qjg52KWzohCFxT29+Me1w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2c397ad-cc64-4b61-d198-08d57f8a6021 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:11.2168 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1014 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit ab4949640d6674b617b314ad3c2c00353304bab9 ] The latest gcc-7.0.1 snapshot warns about an unintialized variable use: In file included from fs/reiserfs/lbalance.c:8:0: fs/reiserfs/lbalance.c: In function 'leaf_item_bottle.isra.3': fs/reiserfs/reiserfs.h:1279:13: error: '*((void *)&n_ih+8).v' may be used uninitialized in this function [-Werror=maybe-uninitialized] v2->v = (v2->v & cpu_to_le64(15ULL << 60)) | cpu_to_le64(offset); ~~^~~ fs/reiserfs/reiserfs.h:1279:13: error: '*((void *)&n_ih+8).v' may be used uninitialized in this function [-Werror=maybe-uninitialized] v2->v = (v2->v & cpu_to_le64(15ULL << 60)) | cpu_to_le64(offset); This happens because the offset/type pair that is stored in ih.key.u.k_offset_v2 is actually uninitialized when we call set_le_ih_k_offset() and set_le_ih_k_type(). After we have called both, all data is correct, but the first of the two reads uninitialized data for the type field and writes it back before it gets overwritten. This works around the warning by initializing the k_offset_v2 through the slightly larger memcpy(). [JK: Remove now unused define and make it obvious we initialize the key] Signed-off-by: Arnd Bergmann Signed-off-by: Jan Kara Signed-off-by: Sasha Levin --- fs/reiserfs/lbalance.c | 2 +- fs/reiserfs/reiserfs.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 249594a821e0..f5cebd70d903 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -475,7 +475,7 @@ static void leaf_item_bottle(struct buffer_info *dest_bi, * 'cpy_bytes'; create new item header; * n_ih = new item_header; */ - memcpy(&n_ih, ih, SHORT_KEY_SIZE); + memcpy(&n_ih.ih_key, &ih->ih_key, KEY_SIZE); /* Endian safe, both le */ n_ih.ih_version = ih->ih_version; diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h index 2adcde137c3f..5dcf3ab83886 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h @@ -1326,7 +1326,6 @@ struct cpu_key { #define KEY_NOT_FOUND 0 #define KEY_SIZE (sizeof(struct reiserfs_key)) -#define SHORT_KEY_SIZE (sizeof (__u32) + sizeof (__u32)) /* return values for search_by_key and clones */ #define ITEM_FOUND 1