Commit fb321998 authored by NeilBrown's avatar NeilBrown Committed by Chuck Lever
Browse files

nfsd: use correct loop termination in nfsd4_revoke_states()



The loop in nfsd4_revoke_states() stops one too early because
the end value given is CLIENT_HASH_MASK where it should be
CLIENT_HASH_SIZE.

This means that an admin request to drop all locks for a filesystem will
miss locks held by clients which hash to the maximum possible hash value.

Fixes: 1ac3629b ("nfsd: prepare for supporting admin-revocation of state")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarNeilBrown <neil@brown.name>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 2857bd59
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1780,7 +1780,7 @@ void nfsd4_revoke_states(struct net *net, struct super_block *sb)
	sc_types = SC_TYPE_OPEN | SC_TYPE_LOCK | SC_TYPE_DELEG | SC_TYPE_LAYOUT;

	spin_lock(&nn->client_lock);
	for (idhashval = 0; idhashval < CLIENT_HASH_MASK; idhashval++) {
	for (idhashval = 0; idhashval < CLIENT_HASH_SIZE; idhashval++) {
		struct list_head *head = &nn->conf_id_hashtbl[idhashval];
		struct nfs4_client *clp;
	retry: