Merge tag 'nfsd-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Nov 2022 22:05:03 +0000 (15:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Nov 2022 22:05:03 +0000 (15:05 -0700)
Pull nfsd fix from Chuck Lever:

 - Fix a loop that occurs when using multiple net namespaces

* tag 'nfsd-6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  nfsd: fix net-namespace logic in __nfsd_file_cache_purge

fs/nfsd/filecache.c

index 29a62db..adc4e87 100644 (file)
@@ -893,9 +893,8 @@ __nfsd_file_cache_purge(struct net *net)
 
                nf = rhashtable_walk_next(&iter);
                while (!IS_ERR_OR_NULL(nf)) {
-                       if (net && nf->nf_net != net)
-                               continue;
-                       nfsd_file_unhash_and_dispose(nf, &dispose);
+                       if (!net || nf->nf_net == net)
+                               nfsd_file_unhash_and_dispose(nf, &dispose);
                        nf = rhashtable_walk_next(&iter);
                }