Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1350943ybj; Fri, 20 Sep 2019 09:05:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJg6F2JpQV8v5ZBzmmL8BOreNS0Ftqt+7FnJRdzrxj8qWH+pbna3pIUEmIOUxk9ItPGv5f X-Received: by 2002:a50:ef02:: with SMTP id m2mr13777925eds.157.1568995531901; Fri, 20 Sep 2019 09:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568995531; cv=none; d=google.com; s=arc-20160816; b=u6GzcNMSTJsw0ZFIBlTyxJgCKTSknpkRZoGo50znsx4/AhHeIaTYeiLEGuzFXP2cdk +z/iEeSAedQ+oqgp3Q56OxilTtPke+cJ47LweRIm4Wxh5+YbloAjJtn308ypLoU0UEux 6/VQAMI0chNV97ksmJvvetw7IwjOQbkglkKqIPRGdgqfFM7tanvD/aInQ+S0ra7P5f6T Vc2pZeiI5uCDSdFlnyTCskY2FhRhi4UGqi36rT6g4Jr8oYuEjHaMygpf0vIGcrB2qFNq KuuHHkhnXil1oK5W3czaGyREbZ9yKHdP2TRGGxF8YhvQ9heoXZZ9bMqIX+evflyf+dvC ivjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EtBs56E8PlEUF79NrUhpc3K+MXytV5931VEn7bnpgUM=; b=p8cf18kTsQprpE59ALCQCM3iXCKYz43V8PmtB+g3YtTfTIGOeYJUsy7Mmq2AJjnKKZ 9IlbOBWOsrwbKoT/OqxyBtzC29n/kJFTJvOA6PjiIemSihYEcQi4GrUU0iv4rHGNjaXt +dFdBVBkC5qpi/JOJ9szq4UkYnmFdk6CwfNuAN4N5Szd9R7LSOcFysGZgLMNeLB72p6D Wx+FmCsOdbvvgRPqHif24E9I64mLTQ5bw7BUGPY+vTBut8Z5GHOAvvBtA/yhJzivkeqz R5gNu1FovJtirri1fo06yFxW8hNODKrOgokDbHariMrlp/cuSYRkieRrMtctlT+3TEA6 KBRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2hrZfcpy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g38si1664402edg.127.2019.09.20.09.05.07; Fri, 20 Sep 2019 09:05:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=2hrZfcpy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407339AbfISWa3 (ORCPT + 99 others); Thu, 19 Sep 2019 18:30:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:56506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406287AbfISWQN (ORCPT ); Thu, 19 Sep 2019 18:16:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E6C720678; Thu, 19 Sep 2019 22:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931372; bh=gJ+j8xvF3QHkqRQXLGe2LZiL1kQ2dtxg0eY4AnzEdXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2hrZfcpysb3fs014OoERLJ94gP1SiscdfX9rf4ZTxuofHZzQJ9Jq00wmZmYiY7vA7 YBj6R4k3XFUdigiXCjD5WvAtXV7GkZtMJ7KlPyf7xtSo1exbBoVlu5gAtyU/EiDtnQ yjMl5FkGZN2j7K7vyINy2IiURfoGnilW285eh33c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Sasha Levin Subject: [PATCH 4.14 22/59] NFSv4: Fix return values for nfs4_file_open() Date: Fri, 20 Sep 2019 00:03:37 +0200 Message-Id: <20190919214803.778716576@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214755.852282682@linuxfoundation.org> References: <20190919214755.852282682@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust [ Upstream commit 90cf500e338ab3f3c0f126ba37e36fb6a9058441 ] Currently, we are translating RPC level errors such as timeouts, as well as interrupts etc into EOPENSTALE, which forces a single replay of the open attempt. What we actually want to do is force the replay only in the cases where the returned error indicates that the file may have changed on the server. So the fix is to spell out the exact set of errors where we want to return EOPENSTALE. Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/nfs4file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 2b3e0f1ca572f..b8d316a338bc9 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -74,13 +74,13 @@ nfs4_file_open(struct inode *inode, struct file *filp) if (IS_ERR(inode)) { err = PTR_ERR(inode); switch (err) { - case -EPERM: - case -EACCES: - case -EDQUOT: - case -ENOSPC: - case -EROFS: - goto out_put_ctx; default: + goto out_put_ctx; + case -ENOENT: + case -ESTALE: + case -EISDIR: + case -ENOTDIR: + case -ELOOP: goto out_drop; } } -- 2.20.1