Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp1207205pjo; Wed, 8 Jan 2020 13:49:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyYONLMayOS2OXEuRIY2JrNjwn7h6GD5wHHE+TXV4r/snFGeMVuymCzPj1/WEgy/Gukgvjo X-Received: by 2002:a9d:3676:: with SMTP id w109mr6149207otb.35.1578520176948; Wed, 08 Jan 2020 13:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578520176; cv=none; d=google.com; s=arc-20160816; b=mqh7gTqbZuKGZzSd35n1+PlBiw5PXdbCgA2LraNFfw3LW45wTXN4gpta9z+hmZnOWs gK7ONZDSyiIp1W1T949WZIiZPVw7iYkw7nUfhYnp2SkyaDIvb+TrFwRhXmAOzFZ1YCYm 6CldMPKr7IujCfTDlfWJRHwm3r3gT29RCHS4IBDJQL12/VfwSAguE/zDrC1fcpZ+H0w1 GA6XEvHmAGVoP4di3TeEdbONcoRKjMIb1/pR9qfr/DdDnLv4r6oDdgjj6hC5UKgy0Sph hKy/tY4AmtN4k2plpsbF7EHhzvYKOIEOqW3Faj2+wRJd3CcXmMs/3Rr6KabuPeX10bnU dD5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=IFg/S/cLX8hJr8mgKoLrR3Rfke0W5bVXk1Q6TVYd+AE=; b=js/jlUAQv/lOiKBKz/YvJdJK7XjlUfTnHxBCFocYeKPXq8AM2CztX5tx3/gy8+PSgT /2E7N/1e3Vl+CFX62lyxJbPHkkNeRvXRCoSE5jJSWeFFuT3XH2jUurVXc/FR+EOLX6yD rjh8d30HFGjR4k+KDz9GSBEO97V5kqDLEY7J5gyUsmfKBRqLC+o6/fDcO0BONoqFmLTL XW1qsn6/jJ1yUMU18mdYHCJ9CNlPU+iLhzIaLlks9mzbiWGSBOIzKUfcEDqim8MRi4s5 Hb4PaOFY9f4sBU31f2nK0nhRmRngld2LvLGnFCUhKmlt4Z3Q23cmtHPo2smoqFI4sZFT gNlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="n3v/AC3w"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n137si2442422oig.127.2020.01.08.13.49.15; Wed, 08 Jan 2020 13:49:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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=@gmail.com header.s=20161025 header.b="n3v/AC3w"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbgAHVse (ORCPT + 99 others); Wed, 8 Jan 2020 16:48:34 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35824 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbgAHVsd (ORCPT ); Wed, 8 Jan 2020 16:48:33 -0500 Received: by mail-wr1-f68.google.com with SMTP id g17so5101167wro.2; Wed, 08 Jan 2020 13:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=IFg/S/cLX8hJr8mgKoLrR3Rfke0W5bVXk1Q6TVYd+AE=; b=n3v/AC3wT4iwuAPq2YsQ5z/WgSTJWZ+d9O4D+ncqJC4Hp5eYDDK1L1FX8E3fzzuLXE 1diFXiR38tJZ+SdvBHGrQ8WHDgMMNrv6seNgLy+cRqmRyicgcq6n0h3Zflu6UBFbblSP +9a3IEnBO/MDsPLMs02f4wpHcf8SFnrqoJ7kcm+LqsHDMq+txs8yMejzQcmTSaDHs8PS /gM9vEQz7F3KzAL6+XQ724lQ6K4WDSt9pgj5ojKKdI89iXbpoCfmW814ZE51auucU3su d1u9/9iCYt1sz3CWZt4sdTAFLyNSqU+oz08JyY3lU9CuMDAfmk6js5f8rkzj/K/gbl8l impQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=IFg/S/cLX8hJr8mgKoLrR3Rfke0W5bVXk1Q6TVYd+AE=; b=WAoSQuzNE6QMitFFre7A6ECApxSkmSTO6GknfFPj4OxW6XWh949cBIIDKYHQ+mJBo6 7Mi++U/NJ/e38G66lG5bYxzypESc5H0ASRQHSFGGIvpTQvTAlbjU1UwbuF4vdbZyDoQ8 kf+MNgH2BCvK8S14fiW6kATZLHrH6QzlwqJXMsunoQry0PjHc60/uIGwQFDoqgJ8myAs aYoplBVzCE1/FgUSUDqUS1WkABAUfFuMOm4P5f8t53mkrd9VWwGh7gHRwj4J8vN6ICkK ux7/tIAig4A2NvnD59aFKTEDpX9lQS9BWMMpFJYwH562n24/2jR+xL/y8Ud+oPRXWDxY W2Og== X-Gm-Message-State: APjAAAUHVOhwp4TdWGRR61CXoDPNipuFP9d40KPOXmJ61ygr16xXhNwk vLJKzCoA8QqE1xXSkLnz0Sw= X-Received: by 2002:a05:6000:50:: with SMTP id k16mr6886782wrx.145.1578520111735; Wed, 08 Jan 2020 13:48:31 -0800 (PST) Received: from WINDOWSSS5SP16 ([82.31.89.128]) by smtp.gmail.com with ESMTPSA id f1sm504895wmc.45.2020.01.08.13.48.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2020 13:48:31 -0800 (PST) From: "Robert Milkowski" To: Cc: "'Trond Myklebust'" , "'Chuck Lever'" , "'Anna Schumaker'" , Subject: [PATCH v2] NFSv4: try lease recovery on NFS4ERR_EXPIRED Date: Wed, 8 Jan 2020 21:48:29 -0000 Message-ID: <115c01d5c66d$5dcd7ae0$196870a0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdXGbKgtqm1QJU8yQtKfQBn7K7s7ZQ== Content-Language: en-gb Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Robert Milkowski Currently, if an nfs server returns NFS4ERR_EXPIRED to open(), etc. we return EIO to applications without even trying to recover. Fixes: 272289a3df72 ("NFSv4: nfs4_do_handle_exception() handle revoke/expiry of a single stateid") Signed-off-by: Robert Milkowski --- fs/nfs/nfs4proc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 76d3716..2478405 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -481,6 +481,10 @@ static int nfs4_do_handle_exception(struct nfs_server *server, stateid); goto wait_on_recovery; } + if (state == NULL) { + nfs4_schedule_lease_recovery(clp); + goto wait_on_recovery; + } /* Fall through */ case -NFS4ERR_OPENMODE: if (inode) { -- 1.8.3.1