Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp165102ybl; Tue, 28 Jan 2020 00:38:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyB8Qlwf+bzj0KnoW9L+XirtUALiXrmJxa5r+A37neryar15DMx5joflkNdpongsO20LCsf X-Received: by 2002:a9d:4c14:: with SMTP id l20mr12649257otf.125.1580200686038; Tue, 28 Jan 2020 00:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580200686; cv=none; d=google.com; s=arc-20160816; b=znaxEhKP4gkmsUZReCEgQP4iN8S1aovK95sKmx4u0gcJUjBP3G5bSEG0AxCmJVY/wk PpRrVqb5DnYoAHUtuiVPJsG7h7FVVQI0inTOAE1vJ0HrJahrN5pQ9JBs+3ZyW5dNuVyh VaMTpUY7/KolWLKCKaTIBsiNksd2o2M2V07bCOEIkmFqOVDRzZqKVFKW7eNoTS0snFav 2lYXsDUw4DueRtkBJSM/GsRYQamwXSWVyypHbitUAxLXqozqlhCP1qjLSxIjR2q6ms5x Vv3jcpt+QjpArqS5VG2/3J3J6q4UmRuu7DwWNuRRgq/EYU6ZFX1hM2IS1igJe5rMEljh Vk3A== 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=/vUdKDhZSRY/UX+VRyOW826eNHk7nxM2Wg/skywcxoM=; b=f8EZvSbaRcdP6vJHcHxB8WIxXhYIOkA9IFGzXWexnhahn3e6kbNN3WKOXNk2xxp5j7 Dd8QCBqcuKOyh31hDjyQkshw+CG6yn0OYI2IxkmnJABb2DD1bhJdxo0fnyg8zdlaFOiT aT3NyXyB/x8thjr6gX6FAJYOc8yc5bIXUUclszpjPmFqRe2US94WI3rgHjhFtwVupFEA DEkpWs6neIMPA0f5X3+VS7Az64B2Lk4ZhIOcO3TrVMk8+QAfsXlbkgSCgB8NtY5QecXJ UcO+KszktL53ZoPkRaK4YU6OIhA61WBqA7ISyM6hapABJ1yFNhCoWIztVLIyFRQIi7Bj Pl2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lEC55NoZ; 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 u188si4867355oia.80.2020.01.28.00.37.40; Tue, 28 Jan 2020 00:38:06 -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=lEC55NoZ; 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 S1725905AbgA1Ihi (ORCPT + 99 others); Tue, 28 Jan 2020 03:37:38 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37343 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgA1Ihi (ORCPT ); Tue, 28 Jan 2020 03:37:38 -0500 Received: by mail-wm1-f65.google.com with SMTP id f129so1529094wmf.2; Tue, 28 Jan 2020 00:37:36 -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=/vUdKDhZSRY/UX+VRyOW826eNHk7nxM2Wg/skywcxoM=; b=lEC55NoZfcBco9gkCKx9wq6xyDjud7Fv5F+wTOH/qxIvC3/nWVYq6qluFTaZx3Aydg htnOIuXNCqPksfDPijgue8RzGkn6AwD1xSnZCwpzMBFJDEmdKi4htAFmsbMDOaS8huDP GBmv1UXVRganOrijeu0oOw61JSP9+JV8F12zamQy3z7XvRZfIIdZ5LijihcZwe5FaHvF hidAbBblBul/CpWHUCM6ZDUBT8LMV0NOJZ5o4Rw55f8LdB77VwaEK+qL4aP/QKnTlCPJ Cusyt4wvmvPNQ1hriHLZWoOFrIn0UjK1fJqxcxtdFehJfXjLJ7SiO/AvgU24M6U5qEl/ 8DjA== 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=/vUdKDhZSRY/UX+VRyOW826eNHk7nxM2Wg/skywcxoM=; b=H4c/ThXcfeuq4sNoaTxl33ldssvlJAhv85KKeHddkTavHMMbToXZlDPWJYxMNZG1v7 Q9dHsoUvEh65jWbt2BXIsskCF/J2YSt//J4lbyjvLinb+b2fzMcqj6z69VNnBKpELgMW EGS0G8OzKIcgMb6DS8/zeFyKT4dCzpLvB2uWHg6CQzj8Uq0DyeI6nafaX3u2VK/2tlud drlSMSqIduzkg8mGRsNx8zZjuh60LlK1llXwC0y3wLKze2PXQKRABdJBhJjJ3xVkN1og VG6xEW4BGSAdkoVOoa8A+2AnrlwlkRVEq2Qto3RSy174dGAvlJltrxile4SvTlr1OO+n 5DWA== X-Gm-Message-State: APjAAAVGUP3z9LMfrAYTyVevgzGm5iPFHmjZobJgFxHm28rAmWTArZ9x UH0N893cT3q15fTW4rOXsbaLmJThfKY= X-Received: by 2002:a1c:6408:: with SMTP id y8mr3560022wmb.130.1580200656136; Tue, 28 Jan 2020 00:37:36 -0800 (PST) Received: from loulrmilkow1 ([213.52.196.70]) by smtp.gmail.com with ESMTPSA id z11sm24999782wrt.82.2020.01.28.00.37.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jan 2020 00:37:35 -0800 (PST) From: "Robert Milkowski" To: , "'Trond Myklebust'" Cc: "'Anna Schumaker'" , "'Chuck Lever'" , Subject: [PATCH v3] NFSv4: try lease recovery on NFS4ERR_EXPIRED Date: Tue, 28 Jan 2020 08:37:47 -0000 Message-ID: <000601d5d5b6$39065c60$ab131520$@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: AdXVs9KkXsilGD6+RnONAb8nbCW6uA== 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(), 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 76d3716..b7c4044 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3187,6 +3187,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; -- 1.8.3.1