Skip to content

Commit fb32199

Browse files
neilbrownchucklever
authored andcommitted
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: 1ac3629 ("nfsd: prepare for supporting admin-revocation of state") Cc: [email protected] Signed-off-by: NeilBrown <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 2857bd5 commit fb32199

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ void nfsd4_revoke_states(struct net *net, struct super_block *sb)
17801780
sc_types = SC_TYPE_OPEN | SC_TYPE_LOCK | SC_TYPE_DELEG | SC_TYPE_LAYOUT;
17811781

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

0 commit comments

Comments
 (0)