All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 7/7] NFSv4.1: Don't recheck delegations that have already been checked
Date: Tue, 30 Aug 2016 22:11:44 -0400	[thread overview]
Message-ID: <1472609504-69094-8-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1472609504-69094-7-git-send-email-trond.myklebust@primarydata.com>

Ensure we don't spam the server with test_stateid() calls for
delegations that have already been checked.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/nfs4proc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 412f1daf1515..9c8c7400b048 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2456,6 +2456,11 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state)
 		return;
 	}
 
+	if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) {
+		rcu_read_unlock();
+		return;
+	}
+
 	cred = get_rpccred(delegation->cred);
 	rcu_read_unlock();
 	status = nfs41_test_and_free_expired_stateid(server, &stateid, cred);
-- 
2.7.4


      reply	other threads:[~2016-08-31  2:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31  2:11 [PATCH 0/7] Fix delegation behaviour when server revokes some state Trond Myklebust
2016-08-31  2:11 ` [PATCH 1/7] NFSv4.1: Don't check delegations that are already marked as revoked Trond Myklebust
2016-08-31  2:11   ` [PATCH 2/7] NFSv4.1: Allow test_stateid to handle session errors without waiting Trond Myklebust
2016-08-31  2:11     ` [PATCH 3/7] NFSv4.1: Add a helper function to deal with expired stateids Trond Myklebust
2016-08-31  2:11       ` [PATCH 4/7] NFSv4.x: Allow callers of nfs_remove_bad_delegation() to specify a stateid Trond Myklebust
2016-08-31  2:11         ` [PATCH 5/7] NFSv4.1: Test delegation stateids when server declares "some state revoked" Trond Myklebust
2016-08-31  2:11           ` [PATCH 6/7] NFSv4.1: Deal with server reboots during delegation expiration recovery Trond Myklebust
2016-08-31  2:11             ` Trond Myklebust [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472609504-69094-8-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.