Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp79420ybx; Thu, 31 Oct 2019 16:16:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7J57PRNZ0Je7HMPJ3vC0rmD+6O9EEwZZndL7YHkQk4384o1DoFzcD3nXoLJoquTUXHeWv X-Received: by 2002:a05:6402:2042:: with SMTP id bc2mr6190052edb.167.1572563774700; Thu, 31 Oct 2019 16:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572563774; cv=none; d=google.com; s=arc-20160816; b=eyYiDjK+k8TZv57rYMPsSDOGS/6oAWCI+duL7PikkM/IIaT2mjATjU3RMzB9walKiE ZE3HbO3+OF6FF7CaTtNt8IoFIGXemIdRYss8dQdPedqn9888IK3ufn7MEnnRydGqe1He FDQFfktNL3NPp5PGd0voe+weduPZsvqMoMolBWJZEYeFj0AV+WXSA3GuNICswD9WbffH BJmGuqN051BOr9zOEsnz+mPcbbu1yY4ItujwPU4Z4WaNTdxXuWHdzU0FtvxmZBlsvYwa X0zUwa7nzHwRIdJO5bklnWVgNm/DS5kFbdbq2aEGq5P98F0NXhb2SMiuP9Hdy8oP0gvZ whvQ== 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:to:from :dkim-signature; bh=qYeYsKsnEQ5L5JWo5ALncCCNlaTcoUQISGF0Hj9ravQ=; b=YDDuJ76qCFrTgh4c5JAP5AefBF3kz/h81lCDDDi3eQtrT5aejXv4XmAaSChUUocPL1 q9URHn+XXnehc64MamVRC4SlB7eOfWLrBzRv+5uAWSWbI7l3QthzxHelPUIL0HGZqZ2p Hp+jAufiPOvviJQfczcKZ9ypNkZhkssqbfmobpgoUVVGg1+9Klbf9sn8ZECaHNpGg2W4 OHZiV/xH8KiVygs3l7+l5RyYoA8GRLunNUam0QmN0DUrArWtzFbUZzZPT987ep9A2zgV c3JPbQIyx3jYv1lNh2Rf+QLJpehIJAAkxgxjJqUOjgstHpFi4fkOrrc9C1aFIJQ7/upq Hq4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aKyv7pmF; 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 g31si4850640eda.325.2019.10.31.16.15.50; Thu, 31 Oct 2019 16:16:14 -0700 (PDT) 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=aKyv7pmF; 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 S1727874AbfJaWnW (ORCPT + 99 others); Thu, 31 Oct 2019 18:43:22 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:34741 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbfJaWnW (ORCPT ); Thu, 31 Oct 2019 18:43:22 -0400 Received: by mail-yw1-f67.google.com with SMTP id z144so1171053ywd.1 for ; Thu, 31 Oct 2019 15:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=qYeYsKsnEQ5L5JWo5ALncCCNlaTcoUQISGF0Hj9ravQ=; b=aKyv7pmFC9cflyqMwx2k/RjI3vKB+mVV0qgpPltswl0Zd4Wf5sjO8O5m+aU4Ng7E7C F3gQQLt1hguzS32Pdm61/kGHCFXqboTwavNRyFCaKgH+tynAUvowq1N4+nEcjssAVkZJ 1QVQF6GMGX02l+QnpcN5ThRUO8zbAXpS25vAuhQQOYAaxpkhFpxKVZEgH6HYGPpEtibn 61O+pkgkjRn7fYyBHLmfLBR9upJ5+eUIjlPfpEhLr3SYZ5/Po03pJb54h+o5Iy7/vqZ+ 0onIEijGRXN2+u/FbYf+CuhA5BpnEzlTVImNNWstDgHZmQ6GJiRCL/+gRxIM4KmqV6q7 abDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qYeYsKsnEQ5L5JWo5ALncCCNlaTcoUQISGF0Hj9ravQ=; b=kq2nYjnEV9d77qYjoFLBL9E99NLhs8rhe/QxVeW9pmY/iJXUGSO05s07mtSWiOma5E FeiECurZ+9CCJyFFgPSeS5g2HLWpHzIvHMoDM+Xwt4EKfFFMoElYIIvQ6SL3Dfl/Pzxh R2H6XiDZiKP8x5y0LTdCziS5NowdKEuw2a8vbS1rVQVCJaip7sHJNvUWxTK0/13xzp6M 8ABhZlBGq9xLfZXsL+ZKjEucLIeSuZNUoxk3uCu0DuzOqf+PPViHlulYeeVEZnmhhsL+ u9ddisI50Us1I32XZDbOAA8TRhE2eIA7fAYBZeqouxGffdt9ViiABuBjD4VQXEWcCRC3 3idQ== X-Gm-Message-State: APjAAAUXwOUeEzS5w8S8TBwuVkgYLcXdwU11bxdgqLWO1P4n/c43au06 V0K0O+EqcqhDzQQq8fsBzX058Ew= X-Received: by 2002:a81:6305:: with SMTP id x5mr6390327ywb.312.1572561801290; Thu, 31 Oct 2019 15:43:21 -0700 (PDT) Received: from localhost.localdomain ([50.105.87.1]) by smtp.gmail.com with ESMTPSA id d192sm1720287ywb.3.2019.10.31.15.43.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 15:43:20 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH v2 13/20] NFSv4: Ignore requests to return the delegation if it was revoked Date: Thu, 31 Oct 2019 18:40:44 -0400 Message-Id: <20191031224051.8923-14-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031224051.8923-13-trond.myklebust@hammerspace.com> References: <20191031224051.8923-1-trond.myklebust@hammerspace.com> <20191031224051.8923-2-trond.myklebust@hammerspace.com> <20191031224051.8923-3-trond.myklebust@hammerspace.com> <20191031224051.8923-4-trond.myklebust@hammerspace.com> <20191031224051.8923-5-trond.myklebust@hammerspace.com> <20191031224051.8923-6-trond.myklebust@hammerspace.com> <20191031224051.8923-7-trond.myklebust@hammerspace.com> <20191031224051.8923-8-trond.myklebust@hammerspace.com> <20191031224051.8923-9-trond.myklebust@hammerspace.com> <20191031224051.8923-10-trond.myklebust@hammerspace.com> <20191031224051.8923-11-trond.myklebust@hammerspace.com> <20191031224051.8923-12-trond.myklebust@hammerspace.com> <20191031224051.8923-13-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If the delegation was revoked, or is already being returned, just clear the NFS_DELEGATION_RETURN and NFS_DELEGATION_RETURN_IF_CLOSED flags and keep going. Signed-off-by: Trond Myklebust --- fs/nfs/delegation.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 8c176c921554..ebd83e4db300 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -476,8 +476,6 @@ static bool nfs_delegation_need_return(struct nfs_delegation *delegation) { bool ret = false; - if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) - goto out; if (test_and_clear_bit(NFS_DELEGATION_RETURN, &delegation->flags)) ret = true; if (test_and_clear_bit(NFS_DELEGATION_RETURN_IF_CLOSED, &delegation->flags) && !ret) { @@ -489,7 +487,10 @@ static bool nfs_delegation_need_return(struct nfs_delegation *delegation) ret = true; spin_unlock(&delegation->lock); } -out: + if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags) || + test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) + ret = false; + return ret; } -- 2.23.0