From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932985AbdLGP5E (ORCPT ); Thu, 7 Dec 2017 10:57:04 -0500 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:60730 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932940AbdLGP45 (ORCPT ); Thu, 7 Dec 2017 10:56:57 -0500 From: alexander.levin@verizon.com Cc: NeilBrown , "J . Bruce Fields" , alexander.levin@verizon.com X-Host: pioneer.tdc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 3.18 05/59] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL) Thread-Topic: [PATCH AUTOSEL for 3.18 05/59] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL) Thread-Index: AQHTb3M72qTqKRUXsEWNQoGp931VyQ== Date: Thu, 7 Dec 2017 15:51:23 +0000 Message-ID: <20171207155116.6013-5-alexander.levin@verizon.com> References: <20171207155116.6013-1-alexander.levin@verizon.com> In-Reply-To: <20171207155116.6013-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vB7Fv7PN029543 From: NeilBrown [ Upstream commit 928c6fb3a9bfd6c5b287aa3465226add551c13c0 ] Current code will return 1 if the version is supported, and -1 if it isn't. This is confusing and inconsistent with the one place where this is used. So change to return 1 if it is supported, and zero if not. i.e. an error is never returned. Signed-off-by: NeilBrown Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- fs/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index a89654bd08c5..4dbd42384655 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -150,7 +150,8 @@ int nfsd_vers(int vers, enum vers_op change) int nfsd_minorversion(u32 minorversion, enum vers_op change) { - if (minorversion > NFSD_SUPPORTED_MINOR_VERSION) + if (minorversion > NFSD_SUPPORTED_MINOR_VERSION && + change != NFSD_AVAIL) return -1; switch(change) { case NFSD_SET: -- 2.11.0