nfsd: fix net-namespace logic in __nfsd_file_cache_purge
Subsystems (3)
Jeff Layton
maintainerPATCH v2 1/1 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.
--- fs/nfsd/filecache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2 -3
@@ -890,9 +890,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); }
Signature · 1 line
2.38.1
Chuck Lever III
AppliedQuoted 8 lines · Jeff Layton
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.
Quoted 6 lines
Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")Reported-by Petr Vorel <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/filecache.c| 5 ++---1 file changed, 2 insertions(+), 3 deletions(-)
Thank you! Applied and pushed to for-rc. I'll send a PR in a few days.
Quoted 21 lines
The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2
-3@@ -890,9 +890,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); }Signature · 1 line
2.38.1
--
Chuck Lever
Quoted 8 lines
Quoted 7 lines · Jeff Layton
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.
Quoted 8 lines
Quoted 6 lines
Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")Reported-by Petr Vorel <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/filecache.c| 5 ++---1 file changed, 2 insertions(+), 3 deletions(-)Thank you! Applied and pushed to for-rc. I'll send a PR in a few days.
Thanks for a quick action!
What a shame you didn't put link to the report, which contains reproducer.
https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/
Kind regards,
Petr
Quoted 20 lines
Quoted 20 lines
The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2
-3@@ -890,9 +890,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); }Signature · 1 line
2.38.1
Jeff Layton
maintainerQuoted 14 lines · Petr Vorel
Quoted 13 lines
Quoted 13 lines · Jeff Layton
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")Reported-by Petr Vorel <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/filecache.c| 5 ++---1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 4 lines
Quoted 1 line
Thank you! Applied and pushed to for-rc. I'll send a PR in a few days.
Thanks for a quick action!
No problem.
Quoted 6 lines
What a shame you didn't put link to the report, which contains reproducer.
https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/Kind regards,
Petr
Chuck, could you add that link to the changelog when you merge it?
Thanks,
Jeff
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2
-3@@ -890,9 +890,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); }Signature · 1 line
2.38.1
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 26 lines · Jeff Layton
Quoted 14 lines · Petr Vorel
Quoted 13 lines
Quoted 13 lines · Jeff Layton
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")Reported-by Petr Vorel <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/filecache.c| 5 ++---1 file changed, 2 insertions(+), 3 deletions(-)Quoted 4 lines
Quoted 1 line
Thank you! Applied and pushed to for-rc. I'll send a PR in a few days.
Thanks for a quick action!
No problem.
Quoted 8 lines
Quoted 6 lines
What a shame you didn't put link to the report, which contains reproducer.
https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/Kind regards,
PetrChuck, could you add that link to the changelog when you merge it?
In progress, I'll push the update in a moment.
Quoted 22 lines
Thanks,
JeffQuoted 18 lines
Quoted 17 lines
Quoted 17 lines
The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2
-3@@ -890,9 +890,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); }
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Signature · 1 line
2.38.1Signature · 1 line
Jeff Layton <[email protected]>
--
Chuck Lever
Quoted 29 lines
Quoted 28 lines · Jeff Layton
Quoted 13 lines · Petr Vorel
Quoted 12 lines
Quoted 12 lines · Jeff Layton
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")Reported-by Petr Vorel <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/filecache.c| 5 ++---1 file changed, 2 insertions(+), 3 deletions(-)Quoted 3 lines
Quoted 1 line
Thank you! Applied and pushed to for-rc. I'll send a PR in a few days.
Thanks for a quick action!
No problem.
Quoted 2 lines
What a shame you didn't put link to the report, which contains reproducer.
https://lore.kernel.org/ltp/Y1%2FP8gDAcWC%2F+VR3@pevik/
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Kind regards,
PetrChuck, could you add that link to the changelog when you merge it?
In progress, I'll push the update in a moment.
Thanks a lot!
Kind regards,
Petr
Quoted 26 lines
Quoted 26 lines
Thanks,
JeffQuoted 20 lines
Quoted 20 lines
Quoted 20 lines
The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2
-3@@ -890,9 +890,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); }Signature · 1 line
2.38.1Signature · 1 line
Jeff Layton <[email protected]>
Hi all,
Quoted 5 lines
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")
Adding this to regression tracker.
https://linux-regtracking.leemhuis.info/tracked-regression/
#regzbot ^introduced ce502f81ba88
#regzbot ignore-activity
Kind regards,
Petr
Quoted 23 lines
Reported-by Petr Vorel <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/nfsd/filecache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)The v1 patch applies cleanly to v6.0, but not to Chuck's for-next branch. This one should be suitable there.
fs/nfsd/filecache.c +2
-3@@ -890,9 +890,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); }
Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge #forregzbot
[Note: this mail is primarily send for documentation purposes and/or for regzbot, my Linux kernel regression tracking bot. That's why I removed most or all folks from the list of recipients, but left any that looked like a mailing lists. These mails usually contain '#forregzbot' in the subject, to make them easy to spot and filter out.]
Quoted 6 lines · Petr Vorel
Hi all,
Quoted 3 lines
If the namespace doesn't match the one in "net", then we'll continue, but that doesn't cause another
rhashtable_walk_nextcall, so it will loop infinitely.
Quoted 7 lines
Quoted 1 line
Fixes ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")Adding this to regression tracker.
https://linux-regtracking.leemhuis.info/tracked-regression/#regzbot ^introduced
ce502f81ba88
#regzbot ignore-activity
#regzbot fixed-by: d3aefd2b29ff5