Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933131AbcKVWAA (ORCPT ); Tue, 22 Nov 2016 17:00:00 -0500 Received: from mx141.netapp.com ([216.240.21.12]:13179 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755039AbcKVV76 (ORCPT ); Tue, 22 Nov 2016 16:59:58 -0500 X-IronPort-AV: E=Sophos;i="5.31,682,1473145200"; d="scan'208";a="164544663" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anna.Schumaker@netapp.com; Subject: Re: [PATCH] NFSv4.x: hide array-bounds warning To: Arnd Bergmann , Trond Myklebust References: <20161122205059.754211-1-arnd@arndb.de> CC: , From: Anna Schumaker Message-ID: <138e311e-4972-5726-53c2-b4fddf2576ef@Netapp.com> Date: Tue, 22 Nov 2016 16:53:33 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161122205059.754211-1-arnd@arndb.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [68.40.193.183] X-ClientProxiedBy: YTOPR01CA0052.CANPRD01.PROD.OUTLOOK.COM (10.166.146.148) To CY1PR0601MB1643.namprd06.prod.outlook.com (10.163.232.17) X-Microsoft-Exchange-Diagnostics: 1;CY1PR0601MB1643;2:CXHnfEQCoXYf7cns03Pv3iEYWRKnFaklIoPG4IeJI7zJ3itG6bXxaCstwFhxlCHPKn0e+VJ3ibEFOBjJhhhJxohBCP1GbvjsQUYJdtf6gwhKz1tbgnx9shsOOpTaH1rRMHOTwDSr+gTNde25yhb09BhvvRlOIJI8GKiQIWL4ITg=;3:8aHc5yfnJQlpQWuAu47Nxem1XvEz2ekdkrW4GOYg+UqcPcOJi4Ve+LJ2YqLsR7ZNDU5ePBe/KjaocpyROkbGyEdHz6GuOBZZoq6OjehiaA+SQ/h8tXKrPg/uf7nPmZnW/oiP+CXgLb6TT3pDCUHbB/3tQpytXu59IHVD7qexmIo=;25:yFUk560mpbYxqoKHWWR6xseVKgseP5U3aTaoFDAPgJYl8inNCcJp08dVhFeu+7EMLIMNACr7xoYDXnhBJUSa2spbfWhy5HLJuflHmoMCkwj1jS1qFfOXM4I5XvOmvmyzvk7t+QgUZRRqBgf4+sh94xbo/h3ekuUDZ495gr/nZGUGNJO9G/kOzjYkA5XWegg69j30KmV/yUYOwOmY/Fyl2JY3GIeDXaG1i3e1prGrJ7h0k9pUxTrK2w2VEIIwH+FhK5IeE0NewcuITAonfqAO0AZMq6Sd8V1KMS8XZtDMVPYTGxBUVLgT2hhZHA+UCJop9JhbolHwbBtUeQ/tf/YMB6v3XQ9ZgFknlx5gibd7uQpgDjHsa3zkv3r71ehG5UiDa7Avxf5Xy9hts/O0HAfXzfpm3PANZAEQ+1mzvlSCIVOzjd8Vr/twFX+xeiIaq1/WMBnSilX+FeHAPYT1Awh7/Q== X-MS-Office365-Filtering-Correlation-Id: 5d68c6ba-7701-43c5-7007-08d4132204b8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR0601MB1643; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0601MB1643;31:ONILPTJzG7hk7Wac1wwUwgM8d3A0Lna7wf7DY94yEjFRygpEKVFyGF6p1LbW+EDnVV59mJUYQHyUq5FvpO4Mm6bV67V54D44Gny70asND+A5N1q7mJ1bIV6NLjoauMpV4AzghEONMZK8BilPZ60bBQwXHX0AnzgWhx0Z50EWhSqvwon+eslQ1RWvCcD8s0MC3bhsdOux6eAOz5JNUeoyVZb/BwCRKsjSIZCEuWd92k6Xq+4lR1VX8BmRg0GyLRV67tsihPh16p8D/RLP2hFCfg==;20:g6mjB1t+SWY5rHIxFYHiBjgdnlwm5HnwQi88LxN3zdBn1XLH7PKD5oRNxslnGUGDY+Gos2tFGshBcwteTNJgay6m3Ozy6GCsaaESZ2LLk2fxzidjfYN3AU4kOWCh+qm0xKAuEV9fMObZmi60cP/tUkzlfj9sT35aHbKDuP+cSfIj+G+R747W3mmiLQ+FIBd/cHpeSZnezyOvbL5revut8w6IfKYlXcPp3KVHjbJBvX483tlhStLYL9pjLQ0MNiC88BM2hnAkyDLmIrg/sFSxGK2tunwQWNwqrhGMbYrGPzmFwdZ84jlN1k6a4ueiJug8bOq5LJVYIIi21DSGBTFx25LRPJv4jXFlEvLz84UNwopO8kP5yvMUZDf1tIdguLsFuR33viWMGFTXKABZw3i/XQLC+WGP/G09VXucCu4Amwq46tR5Rf/jaiwhh/l8jd4KnnWGcLlvw/SouHZClaU4cSBKav0QITnA50Ybp27BKscS7uWAGlzQSzR5c830AMaa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6045199)(6040307)(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6061324)(6041248)(2016111802025)(6043046)(6072148);SRVR:CY1PR0601MB1643;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0601MB1643; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0601MB1643;4:bQaAn442CDAx46nP1Je93r+EF7oIeF9YdKHCoh9bhA9lOSxUzKYHwbPmPUj768ndnzMi1TAndYgE0yrX6I+/ZGaJAVboBFhOvhuanSyVz9bm2mTQHwxFH1zz2fekpOXqkZd/4BjNFV2VEAVTCfQWHDjVJdyFvOvd4VtPbgiJfH69ZhyKmr004ZnBRC9Zr6TcBueAHfEBqMToLxiSkhCeL3QIx4b0vB9AoOkmQTPng0JC68ntyP080HS8f2/nW4to+EtyuuDaJGvdfsHC7IAeGk7DzL9kc5Seni+5k+TzDibxDdIaLloTUZcS7UGt74JA1L/Q3duWc8DjppPve2IJzN35xZvKx2Mx11bYG8UpqR51DelAya6y3/fnd0iINLRXnkJujCjYZ61dNyOopprNw+nAyJS5ZhFo5xa7HwDEnmAiAyMzFV0QKqSQCKrD4m+xjGElN7LmQA8wx9V4p7OB34Q5K40pxhLVrIxP8RWK/bxYIq7Wrbpctw4va1XI8YSy+Jav2nmbQ4vZ7A7mYbxlFE900ks0LUN9asNzViolcRrFaJmItmKFDE8mW8uyf1IemwBNUdIUGToucDntWfvenw== X-Forefront-PRVS: 0134AD334F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(24454002)(377454003)(229853002)(6666003)(86362001)(2950100002)(230700001)(33646002)(305945005)(81156014)(81166006)(7846002)(53416004)(31696002)(106356001)(7736002)(8676002)(105586002)(68736007)(575784001)(66066001)(31686004)(69596002)(38730400001)(65806001)(65956001)(47776003)(42186005)(36756003)(64126003)(6116002)(101416001)(23746002)(54356999)(3846002)(92566002)(77096005)(5660300001)(76176999)(4001350100001)(4326007)(50466002)(65826007)(50986999)(189998001)(2906002)(83506001)(97736004)(5001770100001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0601MB1643;H:gouda.nowheycreamery.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY1PR0601MB1643;23:LVf2zBQHt1EhyoH9LZOOC7Ix55V9Pz7VIq+?= =?Windows-1252?Q?lP6JR4lacz+PnCDNmSSH85knLciaaelL3tTggX7K3oey35uzCur4/EOE?= =?Windows-1252?Q?rPdHhOOehZaYNPpwqSkMk2GJ8oDu5aKJqWZcep7JgZQiHbg/KEgdSBe2?= =?Windows-1252?Q?wasyK9GCVXApIS+U6sZF8pEZYv/tU8E7DbhYmY4L1fLg4cBmekqnd69w?= =?Windows-1252?Q?fgaUReImh1BjvMuTCngcUoy+jnjf+8booNal5XMKUYHGiKFtIoeselV+?= =?Windows-1252?Q?UrWGTE2btL+0gjUrP1oGcBhhPFWua9vmZhMfuIxSXcdZE8Rd/DgE/kqT?= =?Windows-1252?Q?W+TPIxQN7M8MRGpOmbCLVRZOeFL+L4PmoeSE6fKDBfCRFoZe+tRlHb49?= =?Windows-1252?Q?57KXvGODE9r9DeIOUmjCNVz9VYkOwasSqnAnN9w7FRnpLs56Q0vHV8js?= =?Windows-1252?Q?UGPdSQLspLApSYGzlMHNagaO6kutYCwbxWpN+qKukXrGRFehJG79rlnC?= =?Windows-1252?Q?6UqYIm3e4WmVhJu2htAo4E5YvGz8N+xalHQRxgtjxtyErzF7BfL9l1kQ?= =?Windows-1252?Q?848jW3vzRGaI11DM4Wfo84ziFAkf5HqNxrcJ0gx7UIOC1gF5sB4uibJh?= =?Windows-1252?Q?8cBUb0CB84oY4Uu6H+aocSKj4mA/xNdc0tEefGKv2zJiJ7bU8/jACRAM?= =?Windows-1252?Q?ESzr4tuahmrccZD65S6qcWQ+nHAvZiO1/a3zP9ITuHrBDSuXhQL2DkMj?= =?Windows-1252?Q?KAPr3XnIJY7M85KnOc3q09EZTjNcZzDowMCm0D1ywsIeCE4iyze2G06y?= =?Windows-1252?Q?y2alN0xIyAVG6rLxnxSjtq8l7M73DtDqUMJiCuEZ65zHNyCveNi3NqSm?= =?Windows-1252?Q?aO3MXgHnqxrv74m32DwZ0W5GUUXcTAuuBhNg0n381+oWY0Rh3UeBEVCc?= =?Windows-1252?Q?Oq1+Ne4trNHmp2uy1dKuGNH2ZR9VLr6V7c8rESF81303hS4ZQRODZLKH?= =?Windows-1252?Q?nu4/P+ibozs2bsr+FxTqngz5dlUTjn2o6oqOETCvkE3cG5V6BwXBnZKu?= =?Windows-1252?Q?SveaFYJZvj+33ke66FEicNAqUeJ8ZNzdZHsWAAfc3lU+YlmFTmyl0YtJ?= =?Windows-1252?Q?DA/izTXrw8ElBiwtrlIJDp13AoTM4ZNO9nfsgiHig84DY+isEA5QR1vn?= =?Windows-1252?Q?Vt9haSRtQe85C564ts+z1V/jK9AechfyYDA6FzFWoHrUdW1q/sE30EV0?= =?Windows-1252?Q?JN5orNCsI21TNVoR2nmNO998Z0w0uRVvAzILqDfPjvCM7NyWHXXw+mVg?= =?Windows-1252?Q?sp8TnIGqK3MRUFutLqjICPI6BqL8MGPJvzQ6r5y6kBZSrknOoUDA5SjI?= =?Windows-1252?Q?gYzmXdPU+DbGW6pZDy60Th1jb/xOdJ+4urM2vcpRzuQ2XSISw9i9XZqg?= =?Windows-1252?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0601MB1643;6:yCx6lq/e7y2ChJufcgij/Gimw/UlxnfSG9y2HaUzKnWlhK1rh/r9f1MjdChgQsbisgjmwHg79O0wO3AxxLGA/8YFU0XT6UxGhbOtZW8v695SXqwa2KTBjZrGpSc4+rtPCnfEymIerU0TW9Fs0ZbPPABK5K0KpPVqpE6Bp7UpzY9CJwGYuSatAuFo5oYFlj1j1R6FiGuVU+/J2x49z1r2NLDFQaoROiUDjfqNGvuRhVb7tH3yDMOKcuqupMajqThxs1XXcsAzJ32PzpPKmm4lLHIXYJ1WYe84JKiUkk44JQ4usXdB7gI6/4DDctWogI2ekaRAw3eThsfIpiF/xNSat1I0LbjgfvH8jnku/FxVsSBR9FJUCdeYUxZA4dptAdz+;5:bw+dXfuXDcdcvff6JCQAmiTHWV3eOrlU07640moRwUcMHGuEV3KBkQsHaw3HBxU7uGDsnm7GgqFKi0ojnz7/LHpyplANF51d7lH9jOI7zm1LTllKWL66KO+gBBfqi9e/XWZVtl7780bUrBIgktiQCA==;24:DuvSRQqmIcXFhGQX1VSRfpelCm1u6COpKRcD3X4f85Ts5iBqZ4UlDp+DNmJ88jei9it9k1h5I1EC1XGaeaTYmDlNLGmzndEBbqLr/OxId+I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0601MB1643;7:/PwX9U2BC/BJuo/g9PufKQ7CUj3O8prTOAtLkDVaQ1ygpjFyBGRXYuzMss5vinqAYoAG2xZly/KDb+Gq/Ok7tBZMeqABbOHiNwDjo7BzzqXnhBkqE7ri14SX+ESfrVnr2Wkw5QgQzgWLfmrQ6Tj0a4gOpO7lFVc9aEMpakyJS9PZUtYTZvSVVJWIRDuXaiV/xz/su5aIubp91erxK0itOkOmjpDjnjX3efxp5KLnsyMrqc7vA0bqE2T2x5DZxoRi0fOF3pUoqqUBJ8bpqU9dcGASB8i54XwlYsNgRDfvXMiH1m/TgT+mIpYYPOyl6mKmko4iJJhQ9QsP/HHjT8gbDeAOl3gZcVgJ02p+ERwqv20= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2016 21:53:38.8889 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0601MB1643 X-OriginatorOrg: netapp.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1586 Lines: 43 Thanks, Arnd! I'll send it for 4.9 Anna On 11/22/2016 03:50 PM, Arnd Bergmann wrote: > A correct bugfix introduced a harmless warning that shows up with gcc-7: > > fs/nfs/callback.c: In function 'nfs_callback_up': > fs/nfs/callback.c:214:14: error: array subscript is outside array bounds [-Werror=array-bounds] > > What happens here is that the 'minorversion == 0' check tells the > compiler that we assume minorversion can be something other than 0, > but when CONFIG_NFS_V4_1 is disabled that would be invalid and > result in an out-of-bounds access. > > The added check for IS_ENABLED(CONFIG_NFS_V4_1) tells gcc that this > really can't happen, which makes the code slightly smaller and also > avoids the warning. > > The bugfix that introduced the warning is marked for stable backports, > we want this one backported to the same releases. > > Fixes: 98b0f80c2396 ("NFSv4.x: Fix a refcount leak in nfs_callback_up_net") > Cc: stable@vger.kernel.org # v3.7+ > Signed-off-by: Arnd Bergmann > --- > fs/nfs/callback.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c > index 532d8e242d4d..484bebc20bca 100644 > --- a/fs/nfs/callback.c > +++ b/fs/nfs/callback.c > @@ -197,7 +197,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv, > } > > ret = -EPROTONOSUPPORT; > - if (minorversion == 0) > + if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0) > ret = nfs4_callback_up_net(serv, net); > else if (xprt->ops->bc_up) > ret = xprt->ops->bc_up(serv, net); >