Commit 6686390b authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

NFS: remove incorrect "Lock reclaim failed!" warning.

After reclaiming state that was lost, the NFS client tries to reclaim
any locks, and then checks that each one has NFS_LOCK_INITIALIZED set
(which means that the server has confirmed the lock).
However if the client holds a delegation, nfs_reclaim_locks() simply aborts
(or more accurately it called nfs_lock_reclaim() and that returns without
doing anything).

This is because when a delegation is held, the server doesn't need to
know about locks.

So if a delegation is held, NFS_LOCK_INITIALIZED is not expected, and
its absence is certainly not an error.

So don't print the warnings if NFS_DELGATED_STATE is set.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 08cb47fa
...@@ -1415,14 +1415,16 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs ...@@ -1415,14 +1415,16 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
if (status >= 0) { if (status >= 0) {
status = nfs4_reclaim_locks(state, ops); status = nfs4_reclaim_locks(state, ops);
if (status >= 0) { if (status >= 0) {
spin_lock(&state->state_lock); if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0) {
list_for_each_entry(lock, &state->lock_states, ls_locks) { spin_lock(&state->state_lock);
if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) list_for_each_entry(lock, &state->lock_states, ls_locks) {
pr_warn_ratelimited("NFS: " if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags))
"%s: Lock reclaim " pr_warn_ratelimited("NFS: "
"failed!\n", __func__); "%s: Lock reclaim "
"failed!\n", __func__);
}
spin_unlock(&state->state_lock);
} }
spin_unlock(&state->state_lock);
nfs4_put_open_state(state); nfs4_put_open_state(state);
spin_lock(&sp->so_lock); spin_lock(&sp->so_lock);
goto restart; goto restart;
......
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