Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3300228pxk; Mon, 21 Sep 2020 10:03:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1k0j9eM1Db2RE6iWIOyHYcq7o2J6+/TCh/9ZgJ2//bSnumCCF8VOmLFzn9M4EJHVcxhps X-Received: by 2002:a17:906:250a:: with SMTP id i10mr430059ejb.202.1600707794087; Mon, 21 Sep 2020 10:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707794; cv=none; d=google.com; s=arc-20160816; b=oC0gUHnc9IwuIhJ1I0b4jRCCXZ1hwKTjziDOVxmPDtLO2pbW9JOJ10YzrEHp4iXeAf 5gUrFHQwKD+9fc0VohQybEQFPxG1a75N8nX/VFAcDCq9A5SxrAtVNhrXb36R5GNLGWUi I7If0FX4Anibs/c8n6zY0s8o5R5N1GOgGuTPm33P3Jr2whcNETvsz0CsEd/5lOnqLuVg 1m8bxmUpo+10xxuiDyqFtEq51ce6rVJXepYAP1JZeL1gCLdUmIE/1jrALOdl6lMCsE8o ccWwJjKezeG96du1LTLuxAP0V8pYGIbuXlFOTCD4ajZh8H0AN4++bMOvfxzHgAxtGh8y Cblw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7wbTdAWhqYZiW8oTWDYksSPYErBs1lJ2DGZiNX1s/vQ=; b=Fjbf99OHnSBk1T4OLrVP4QeB+zNuLEW7UMgslSW512dctfsZnBPE565c+yqt0ibrKS ZfRD7hFOciuYnHPnqOZdkPbvoAzJKNwpnCZEweKDioKWFnTnuDx99ZoZXfGpxipPBpvL OzgMFu35W6Y0544X6+tKVYRgcEFv70dTf3i4/GuIZSHzpSmk6dWX8n7p12V3DgznGZp1 drprLZt2wnXpHkzK5H53qVLY3qAOTp/FrklIvIxAP4z/Cc4Hf2OEZStHf1SeuW4RhuJe 9d6q9plzBvKJdzj33FTCAH/hGSCGZuPsppWFgTbQb6fIzdofS1JCGGW2kJiQGPNjXHln 8Y+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vISPgFIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si8772951ejj.443.2020.09.21.10.02.49; Mon, 21 Sep 2020 10:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vISPgFIn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730399AbgIURBs (ORCPT + 99 others); Mon, 21 Sep 2020 13:01:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:40734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728554AbgIUQjJ (ORCPT ); Mon, 21 Sep 2020 12:39:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 66BD4238E6; Mon, 21 Sep 2020 16:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706346; bh=f9uTyh33a2+faJ5onVvqk+6/QKRk0vmHVpNOFvAqT+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vISPgFInbdxwDGRr9kPkpJRx+feDmjPeuZ2qoSOT3DT533pE1AgPke6B7EgRJoUo8 e689JDUWj81m9xT3pDrvohRAI+8+rEDtVybjAnVZPHSKMvcQrQBrCmcdB9vcwOuD1z 4nQtO1dYOrbgsP/AJPYTMLnXKPLF4NUtkPhB2PaE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Trond Myklebust , Sasha Levin Subject: [PATCH 4.14 64/94] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall Date: Mon, 21 Sep 2020 18:27:51 +0200 Message-Id: <20200921162038.470964337@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Olga Kornievskaia [ Upstream commit 3d7a9520f0c3e6a68b6de8c5812fc8b6d7a52626 ] A client should be able to handle getting an ERR_DELAY error while doing a LOCK call to reclaim state due to delegation being recalled. This is a transient error that can happen due to server moving its volumes and invalidating its file location cache and upon reference to it during the LOCK call needing to do an expensive lookup (leading to an ERR_DELAY error on a PUTFH). Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/nfs4proc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4cfb84119e017..997b731ee19ab 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6687,7 +6687,12 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, err = nfs4_set_lock_state(state, fl); if (err != 0) return err; - err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); + do { + err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); + if (err != -NFS4ERR_DELAY) + break; + ssleep(1); + } while (err == -NFS4ERR_DELAY); return nfs4_handle_delegation_recall_error(server, state, stateid, fl, err); } -- 2.25.1