From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E00EBC2BA83 for ; Thu, 13 Feb 2020 15:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA1A420661 for ; Thu, 13 Feb 2020 15:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607767; bh=FmEnygodiDT/cOjpfwNRp3RTu4B00Q6jdwa2zKa5C4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Iw41oAqg/aOLibGNv0ntPCQPj7XdcrT3mCgjL9y7pBWJxqllUuvKRwXGaCbXWkvIb Y3ej7cxNFKzKqF2baXeDTDkXuIMighvU48O97UEB8zsAeH++OyU6vj9tWFNHOtlOfs g+65uO4ukyEUf/9eMZxk2UkM9dtsIAmwDiDVgr0M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387860AbgBMP31 (ORCPT ); Thu, 13 Feb 2020 10:29:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:46382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728406AbgBMP0i (ORCPT ); Thu, 13 Feb 2020 10:26:38 -0500 Received: from localhost (unknown [104.132.1.104]) (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 AE0FB2467D; Thu, 13 Feb 2020 15:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607597; bh=FmEnygodiDT/cOjpfwNRp3RTu4B00Q6jdwa2zKa5C4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JABsgaKncGRcPo2H4A3mtAJkll4HulWk33hiuDz/lxUiQhxzEc7n6DdT8+/st3iPx vC7IIWCObpZsOLDUKExsFfdnqSOu2rYQicQpSQ90ujcwtazCtOE/AukIklLliYvGhu EFxeuZrNel+GyXWD1JYZlvzAsA1vkBXcHcs8IdMo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Milkowski , Trond Myklebust , Anna Schumaker Subject: [PATCH 4.19 15/52] NFSv4: try lease recovery on NFS4ERR_EXPIRED Date: Thu, 13 Feb 2020 07:20:56 -0800 Message-Id: <20200213151817.196344386@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151810.331796857@linuxfoundation.org> References: <20200213151810.331796857@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: Robert Milkowski commit 924491f2e476f7234d722b24171a4daff61bbe13 upstream. Currently, if an nfs server returns NFS4ERR_EXPIRED to open(), 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 Reviewed-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3089,6 +3089,11 @@ static struct nfs4_state *nfs4_do_open(s exception.retry = 1; continue; } + if (status == -NFS4ERR_EXPIRED) { + nfs4_schedule_lease_recovery(server->nfs_client); + exception.retry = 1; + continue; + } if (status == -EAGAIN) { /* We must have found a delegation */ exception.retry = 1;