Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1943030ybv; Fri, 14 Feb 2020 08:37:24 -0800 (PST) X-Google-Smtp-Source: APXvYqziKZsS0ZvhWlejl4z5KSGPvjnL2/m1g+ph3hkS7mvKbeJOsCmZtQN+sLNmUGyyOAktm1OK X-Received: by 2002:aca:2315:: with SMTP id e21mr2424228oie.147.1581698244200; Fri, 14 Feb 2020 08:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581698244; cv=none; d=google.com; s=arc-20160816; b=C8z+fs3jms9x7Wn+dh8d6nc3jnXymujrbQ2IhZYxU4ghN5k1KD+ovCohXXHN7cCZ6R WzD69V+uMq+PtSzeyViyR2HFJIlV14uyqyxKbNnEQE6sJUFWrS70p5knQWXpiRIvQ0nW cvsH6XpQ6gaChqViXopGA9b8nIVS/V8lXFxCtWlWSysDJ36BeZkDLOBQ71lZMjvy8uWJ 2zpquJ3ocAaTsBFKmb/+LGXbe4foWK43ymdqbaenw5HrnNQTa6Mh7CpXxMs7YxBDIbBc IzJty5tQ0ipOwiDOw0A4P1fZCy4U2VKt1oO+KuN6aOD8ii2WAYDXEyC5zOFPFwXQdc/1 Wq3A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9xnx6Ctd9RCW33DfZwUeo9rOk39YX0ia1usNK0XKqBY=; b=qJXkws2yeSQ1EQTKVqvsdxDONrktGrYEM0e0/JdjSdhW5n4riH+uBl/xVWpVuGc2c0 LWRW8X9bgqZzUUEer9nJjwCP90dTDE+a2LzDVP3/Syputr5oWvKniqc8hpplsWUnivEs LKGN1KwNXAaAXTUnNSThSJ6l/qKoe03mmfLMYCtNrWOTYUUsCjUSYmt8bfjHxh1wwAnO l2waebBnZOzm9CDY0XA1/RnkMXewrZmd7095+C2Bt4URwbmPrRvkil8Md8m0lE6mRnr9 LQe245QGD7EWk2nyvi+KznVSVhYPN1UAq4Qj6fYfumdPL69PacCdVdxloabNeGzBhhdh F3gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="r/oEMpbu"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si3044930otr.207.2020.02.14.08.37.12; Fri, 14 Feb 2020 08:37:24 -0800 (PST) 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="r/oEMpbu"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393708AbgBNQgd (ORCPT + 99 others); Fri, 14 Feb 2020 11:36:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:32792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405849AbgBNQYS (ORCPT ); Fri, 14 Feb 2020 11:24:18 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 10FFB24791; Fri, 14 Feb 2020 16:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581697457; bh=Uuaz7NNJK5HWHiGG1+MzfBTJBpbO3wnZk8aB3khNziM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r/oEMpbu894vU9e1CrFOabepx85f0sA3UiBXft+RiOxZTis+ibT1kptwN/D9UsDHk t8MDKAqRNRhGkP1It2HzFnw4DZsDMEY5WSGQxkzYNJ8N1dy1o7QFNTeDpQJkiflVWk i/tbhmk9pw37lUrxsuH7JZ/NZENO5jpfqkkN1IsU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Robert Milkowski , Trond Myklebust , Anna Schumaker , Sasha Levin , linux-nfs@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 140/141] NFSv4: try lease recovery on NFS4ERR_EXPIRED Date: Fri, 14 Feb 2020 11:21:20 -0500 Message-Id: <20200214162122.19794-140-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214162122.19794-1-sashal@kernel.org> References: <20200214162122.19794-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 [ Upstream commit 924491f2e476f7234d722b24171a4daff61bbe13 ] 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: Sasha Levin --- fs/nfs/nfs4proc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ca4249ae644f2..632d3c3f8dfb3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2916,6 +2916,11 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir, 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; -- 2.20.1