Skip to content

Commit d3aefd2

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: fix net-namespace logic in __nfsd_file_cache_purge
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another rhashtable_walk_next call, so it will loop infinitely. Fixes: ce502f8 ("NFSD: Convert the filecache to use rhashtable") Reported-by: Petr Vorel <pvorel@suse.cz> Link: https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/ Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 93c128e commit d3aefd2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/nfsd/filecache.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,8 @@ __nfsd_file_cache_purge(struct net *net)
893893

894894
nf = rhashtable_walk_next(&iter);
895895
while (!IS_ERR_OR_NULL(nf)) {
896-
if (net && nf->nf_net != net)
897-
continue;
898-
nfsd_file_unhash_and_dispose(nf, &dispose);
896+
if (!net || nf->nf_net == net)
897+
nfsd_file_unhash_and_dispose(nf, &dispose);
899898
nf = rhashtable_walk_next(&iter);
900899
}
901900

0 commit comments

Comments
 (0)