mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, nfs@lists.sourceforge.net
Subject: [PATCH 3/5] NFSv4: Ensure nfs4_lock_expired() caches delegated locks
Date: Mon, 26 Jun 2006 19:30:08 -0400	[thread overview]
Message-ID: <20060626233008.6059.63173.stgit@lade.trondhjem.org> (raw)
In-Reply-To: <20060626232936.6059.50399.stgit@lade.trondhjem.org>

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/nfs/nfs4proc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b8c6375..8bdfe3f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3454,10 +3454,10 @@ static int nfs4_lock_reclaim(struct nfs4
 	struct nfs4_exception exception = { };
 	int err;
 
-	/* Cache the lock if possible... */
-	if (test_bit(NFS_DELEGATED_STATE, &state->flags))
-		return 0;
 	do {
+		/* Cache the lock if possible... */
+		if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
+			return 0;
 		err = _nfs4_do_setlk(state, F_SETLK, request, 1);
 		if (err != -NFS4ERR_DELAY)
 			break;
@@ -3476,6 +3476,8 @@ static int nfs4_lock_expired(struct nfs4
 	if (err != 0)
 		return err;
 	do {
+		if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
+			return 0;
 		err = _nfs4_do_setlk(state, F_SETLK, request, 0);
 		if (err != -NFS4ERR_DELAY)
 			break;

  parent reply	other threads:[~2006-06-26 23:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 23:29 [PATCH 0/5] Enable extra optimisations on fcntl(F_UNLCK) requests on NFS Trond Myklebust
2006-06-26 23:30 ` [PATCH 1/5] VFS: Allow caller to determine if BSD or posix locks were actually freed Trond Myklebust
2006-06-26 23:30 ` [PATCH 2/5] NLM,NFSv4: Don't put UNLOCK requests on the wire unless we hold a lock Trond Myklebust
2006-06-26 23:30 ` Trond Myklebust [this message]
2006-06-26 23:30 ` [PATCH 4/5] VFS: Add support for the FL_ACCESS flag to flock_lock_file() Trond Myklebust
2006-06-26 23:30 ` [PATCH 5/5] NLM,NFSv4: Wait on local locks before we put RPC calls on the wire Trond Myklebust

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=20060626233008.6059.63173.stgit@lade.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®