Commit 42a2d13e authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Ensure nfs4_lock_expired() caches delegated locks

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9b073574
...@@ -3454,10 +3454,10 @@ static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request ...@@ -3454,10 +3454,10 @@ static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
int err; int err;
do {
/* Cache the lock if possible... */ /* Cache the lock if possible... */
if (test_bit(NFS_DELEGATED_STATE, &state->flags)) if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
return 0; return 0;
do {
err = _nfs4_do_setlk(state, F_SETLK, request, 1); err = _nfs4_do_setlk(state, F_SETLK, request, 1);
if (err != -NFS4ERR_DELAY) if (err != -NFS4ERR_DELAY)
break; break;
...@@ -3476,6 +3476,8 @@ static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request ...@@ -3476,6 +3476,8 @@ static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request
if (err != 0) if (err != 0)
return err; return err;
do { do {
if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
return 0;
err = _nfs4_do_setlk(state, F_SETLK, request, 0); err = _nfs4_do_setlk(state, F_SETLK, request, 0);
if (err != -NFS4ERR_DELAY) if (err != -NFS4ERR_DELAY)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment