diff options
author | NeilBrown <neilb@suse.de> | 2013-08-12 02:52:47 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-22 14:34:14 -0400 |
commit | 6686390bab6a0e049fa7040631aee08b35a55293 (patch) | |
tree | de508f578f473a612a2360fa84c98ccd8613364e | |
parent | 08cb47faa4687342e9cbde54ff0f15a768eb5632 (diff) |
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: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4state.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 6818964bb7c0..25b7cf6a91d9 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1415,14 +1415,16 @@ restart: | |||
1415 | if (status >= 0) { | 1415 | if (status >= 0) { |
1416 | status = nfs4_reclaim_locks(state, ops); | 1416 | status = nfs4_reclaim_locks(state, ops); |
1417 | if (status >= 0) { | 1417 | if (status >= 0) { |
1418 | spin_lock(&state->state_lock); | 1418 | if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0) { |
1419 | list_for_each_entry(lock, &state->lock_states, ls_locks) { | 1419 | spin_lock(&state->state_lock); |
1420 | if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) | 1420 | list_for_each_entry(lock, &state->lock_states, ls_locks) { |
1421 | pr_warn_ratelimited("NFS: " | 1421 | if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) |
1422 | "%s: Lock reclaim " | 1422 | pr_warn_ratelimited("NFS: " |
1423 | "failed!\n", __func__); | 1423 | "%s: Lock reclaim " |
1424 | "failed!\n", __func__); | ||
1425 | } | ||
1426 | spin_unlock(&state->state_lock); | ||
1424 | } | 1427 | } |
1425 | spin_unlock(&state->state_lock); | ||
1426 | nfs4_put_open_state(state); | 1428 | nfs4_put_open_state(state); |
1427 | spin_lock(&sp->so_lock); | 1429 | spin_lock(&sp->so_lock); |
1428 | goto restart; | 1430 | goto restart; |