Blob Blame History Raw
From: NeilBrown <neilb@suse.de>
Subject: [PATCH] nfsd: don't admin-revoke NSv4.0 state ids
Patch-mainline: Never, hackish simplification
References: bsc#1192483

NFSv4.0 state id management is not as clean as NFSv4.1 and later.
There is no generic way to say "discard this state", so the server needs to drop
things at least one lease-time after they should no longer be interesting.

When a state is admin-revoked, it cannot be closed or unlocked etc, so
there is no way for the client to revoke interest.  Possibly we could
wait until the client has noticed that the state is revoked, then wait
one lease-time.

As this is a bit messy, and as we don't have a customer *need* for
NFSv4.0 support of state revocation, just ignore NFSv4.0 states when
revoking.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: NeilBrown <neilb@suse.com>
---
 fs/nfsd/nfs4state.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1578,6 +1578,7 @@ static struct nfs4_stid *find_sb_stid(st
 		stid = idr_get_next_ul(&clp->cl_stateids, &id);
 	} while (stid &&
 		 !((stid->sc_type & sc_types) &&
+		   stid->sc_client->cl_minorversion > 0 &&
 		   stid->sc_file->fi_sb == sb));
 	if (stid)
 		refcount_inc(&stid->sc_count);