From patchwork Sun Jan 7 08:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 10148133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E6D9860247 for ; Sun, 7 Jan 2018 08:51:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D487C287F3 for ; Sun, 7 Jan 2018 08:51:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5EAB287FE; Sun, 7 Jan 2018 08:51:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C627287F3 for ; Sun, 7 Jan 2018 08:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752368AbeAGIvH (ORCPT ); Sun, 7 Jan 2018 03:51:07 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:29973 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbeAGIvG (ORCPT ); Sun, 7 Jan 2018 03:51:06 -0500 Received: from localhost.localdomain ([90.107.118.99]) by mwinf5d25 with ME id vLr31w00628lVBu03Lr3RL; Sun, 07 Jan 2018 09:51:05 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 07 Jan 2018 09:51:05 +0100 X-ME-IP: 90.107.118.99 From: Christophe JAILLET To: trond.myklebust@primarydata.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] NFSv4.1: Ensure 'nfs4_sp4_select_mode()' can report -EINVAL when needed Date: Sun, 7 Jan 2018 09:50:40 +0100 Message-Id: <20180107085040.6827-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 937e3133cd0b, 'nfs4_sp4_select_mode()' always return 0. Based on the way this commit is written (direct return replaced by some 'ret = -EXXX'), it is likely that returning this error code is expected. Fixes: 937e3133cd0b ("NFSv4.1: Ensure we clear the SP4_MACH_CRED flags in nfs4_sp4_select_mode()") Signed-off-by: Christophe JAILLET --- Untested and not sure at all if correct... --- fs/nfs/nfs4proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 17a03f2c4330..ae00ac59f59b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7584,7 +7584,7 @@ static int nfs4_sp4_select_mode(struct nfs_client *clp, } out: clp->cl_sp4_flags = flags; - return 0; + return ret; } struct nfs41_exchange_id_data {