Commit e1253be0 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: nfs4_stateid_is_current should return 'true' for an invalid stateid

When nfs4_set_rw_stateid() can fails by returning EIO to indicate that
the stateid is completely invalid, then it makes no sense to have it
trigger a retry of the READ or WRITE operation. Instead, we should just
have it fall through and attempt a recovery.

This fixes an infinite loop in which the client keeps replaying the same
bad stateid back to the server.
Reported-by: default avatarAndy Adamson <andros@netapp.com>
Link: http://lkml.kernel.org/r/1393954269-3974-1-git-send-email-andros@netapp.com
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 755a48a7
...@@ -4011,8 +4011,9 @@ static bool nfs4_stateid_is_current(nfs4_stateid *stateid, ...@@ -4011,8 +4011,9 @@ static bool nfs4_stateid_is_current(nfs4_stateid *stateid,
{ {
nfs4_stateid current_stateid; nfs4_stateid current_stateid;
if (nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode)) /* If the current stateid represents a lost lock, then exit */
return false; if (nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode) == -EIO)
return true;
return nfs4_stateid_match(stateid, &current_stateid); return nfs4_stateid_match(stateid, &current_stateid);
} }
......
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