Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3309133pxk; Mon, 21 Sep 2020 10:14:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+PAWFirU1fQQojc4dNkyBNwOgr4AMJGND6HF/Y+Z9Durvklji7TtpwvE0AVJbk1QUyCfv X-Received: by 2002:aa7:cd85:: with SMTP id x5mr754494edv.0.1600708497412; Mon, 21 Sep 2020 10:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600708497; cv=none; d=google.com; s=arc-20160816; b=mr/qNbNhAG8GDqoEXMmDJDiFk26t0t9ZjvbVUtfeiuHEJTpUs6GjOnsuaRiIAR5048 2bZicxYSS8C/+OSKbvrwSWi3YnC3qaa8PUtnmWlRQSS207ujK4t+NdH3dsxT762fgPDG biF7jcmmkyAX7UM1viclzR2DrDAoatMhOv3oBHKBNw9HFUruq0+FMxfqzyihG0717Jsx TXrvUW8AfZq3jDTeK1s3IrjfSM+kczt6EtxzvwH85USPBplkbqLgVed7Ewjsag5/dyS4 LMPPu+A6Ac6yE9PDFlzrlZMMJO80WaI2J2JSh6u3ybbnEhOEyhY46bq8+thXTECF9U+8 xzKQ== 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=vUNxLNssOw/waJaEYnwCXoh6zdkeziCveY+WiLb0xDA=; b=P8bNqppgIHY7+l8ONnUpE3RDlvepMmJNwVeg8BEyTdZsuN3NK49VQ9uBYWxSzWJlDC vmfJRJ7BhoAsuA24v8tUd0QxoSysGxxXI9VST+OHbB4kJ8bUwLwAmdyrzBDjOtAtyqsB xq175hAiS2SuIrE9ZkCRbTmjz1vb0HkPgNMnSD/CcxGMFzZUvckFlAQeGm3CXe0b4gkr bEzavEotBdt5lrLw3CcgTC61CLC6gUP7zqEWiBCy7OqEnvupMIoZxXT5iTnIk0BeiDjK yZPRAQn/6Mir56CIQ6lPvaDvfGQTN3sd2bmYaKhN6yKEoCzcBFx0eltmCEddYoDnEQMt uX4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KH2rg/Cm"; 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 b6si9155914eja.565.2020.09.21.10.14.33; Mon, 21 Sep 2020 10:14:57 -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="KH2rg/Cm"; 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 S1728411AbgIUQ5s (ORCPT + 99 others); Mon, 21 Sep 2020 12:57:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:47346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728881AbgIUQnA (ORCPT ); Mon, 21 Sep 2020 12:43:00 -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 E24312076B; Mon, 21 Sep 2020 16:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706579; bh=lej9QhMUZOEJoSIhmR5Ga6B7vctYMZVw0Fpwlb1LJ90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KH2rg/Cmiw+w/kbQcozXOuFn5f45C0bnnucurJNfKrWkGBKwvnQxZZyAYDThy+/ta S5bsPryxcAKCCOcF/Vl61LoPNM2rw3UM9a4xt3F58X2qA8/GgVKp6HTvsDoLDG8dW+ pn0Y3hLXmiBkUWT2FZwRTZIkQlFASCR6+hivmtUY= 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 5.8 010/118] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall Date: Mon, 21 Sep 2020 18:27:02 +0200 Message-Id: <20200921162036.810585110@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@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 45e0585e0667c..7f337188a2829 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7271,7 +7271,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