* [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge
@ 2022-10-31 15:49 Jeff Layton
2022-10-31 17:10 ` Chuck Lever III
2022-11-04 21:21 ` Petr Vorel
0 siblings, 2 replies; 8+ messages in thread
From: Jeff Layton @ 2022-10-31 15:49 UTC (permalink / raw)
To: chuck.lever; +Cc: linux-nfs, Petr Vorel
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: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable")
Reported-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
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.
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index 98c6b5f51bc8..4a8aa7cd8354 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -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);
}
--
2.38.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge 2022-10-31 15:49 [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge Jeff Layton @ 2022-10-31 17:10 ` Chuck Lever III 2022-10-31 18:45 ` Petr Vorel 2022-11-04 21:21 ` Petr Vorel 1 sibling, 1 reply; 8+ messages in thread From: Chuck Lever III @ 2022-10-31 17:10 UTC (permalink / raw) To: Jeff Layton; +Cc: Linux NFS Mailing List, Petr Vorel > On Oct 31, 2022, at 11:49 AM, Jeff Layton <jlayton@kernel.org> wrote: > > 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: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") > Reported-by: Petr Vorel <pvorel@suse.cz> > Signed-off-by: Jeff Layton <jlayton@kernel.org> > --- > 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. > The v1 patch applies cleanly to v6.0, but not to Chuck's for-next > branch. This one should be suitable there. > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > index 98c6b5f51bc8..4a8aa7cd8354 100644 > --- a/fs/nfsd/filecache.c > +++ b/fs/nfsd/filecache.c > @@ -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); > } > > -- > 2.38.1 > -- Chuck Lever ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge 2022-10-31 17:10 ` Chuck Lever III @ 2022-10-31 18:45 ` Petr Vorel 2022-10-31 18:46 ` Jeff Layton 0 siblings, 1 reply; 8+ messages in thread From: Petr Vorel @ 2022-10-31 18:45 UTC (permalink / raw) To: Chuck Lever III; +Cc: Jeff Layton, Linux NFS Mailing List > > On Oct 31, 2022, at 11:49 AM, Jeff Layton <jlayton@kernel.org> wrote: > > 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: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") > > Reported-by: Petr Vorel <pvorel@suse.cz> > > Signed-off-by: Jeff Layton <jlayton@kernel.org> > > --- > > 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 > > The v1 patch applies cleanly to v6.0, but not to Chuck's for-next > > branch. This one should be suitable there. > > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > > index 98c6b5f51bc8..4a8aa7cd8354 100644 > > --- a/fs/nfsd/filecache.c > > +++ b/fs/nfsd/filecache.c > > @@ -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); > > } > > -- > > 2.38.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge 2022-10-31 18:45 ` Petr Vorel @ 2022-10-31 18:46 ` Jeff Layton 2022-10-31 18:47 ` Chuck Lever III 0 siblings, 1 reply; 8+ messages in thread From: Jeff Layton @ 2022-10-31 18:46 UTC (permalink / raw) To: Petr Vorel, Chuck Lever III; +Cc: Linux NFS Mailing List On Mon, 2022-10-31 at 19:45 +0100, Petr Vorel wrote: > > > > On Oct 31, 2022, at 11:49 AM, Jeff Layton <jlayton@kernel.org> wrote: > > > > 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: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") > > > Reported-by: Petr Vorel <pvorel@suse.cz> > > > Signed-off-by: Jeff Layton <jlayton@kernel.org> > > > --- > > > 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! > No problem. > 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 > > > The v1 patch applies cleanly to v6.0, but not to Chuck's for-next > > > branch. This one should be suitable there. > > > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > > > index 98c6b5f51bc8..4a8aa7cd8354 100644 > > > --- a/fs/nfsd/filecache.c > > > +++ b/fs/nfsd/filecache.c > > > @@ -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); > > > } > > > > -- > > > 2.38.1 -- Jeff Layton <jlayton@kernel.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge 2022-10-31 18:46 ` Jeff Layton @ 2022-10-31 18:47 ` Chuck Lever III 2022-10-31 19:05 ` Petr Vorel 0 siblings, 1 reply; 8+ messages in thread From: Chuck Lever III @ 2022-10-31 18:47 UTC (permalink / raw) To: Jeff Layton; +Cc: Petr Vorel, Linux NFS Mailing List > On Oct 31, 2022, at 2:46 PM, Jeff Layton <jlayton@kernel.org> wrote: > > On Mon, 2022-10-31 at 19:45 +0100, Petr Vorel wrote: >> >>>> On Oct 31, 2022, at 11:49 AM, Jeff Layton <jlayton@kernel.org> wrote: >> >>>> 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: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") >>>> Reported-by: Petr Vorel <pvorel@suse.cz> >>>> Signed-off-by: Jeff Layton <jlayton@kernel.org> >>>> --- >>>> 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! >> > > No problem. > >> 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? In progress, I'll push the update in a moment. > > Thanks, > Jeff > >>>> The v1 patch applies cleanly to v6.0, but not to Chuck's for-next >>>> branch. This one should be suitable there. >>>> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c >>>> index 98c6b5f51bc8..4a8aa7cd8354 100644 >>>> --- a/fs/nfsd/filecache.c >>>> +++ b/fs/nfsd/filecache.c >>>> @@ -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); >>>> } >> >>>> -- >>>> 2.38.1 > > -- > Jeff Layton <jlayton@kernel.org> -- Chuck Lever ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge 2022-10-31 18:47 ` Chuck Lever III @ 2022-10-31 19:05 ` Petr Vorel 0 siblings, 0 replies; 8+ messages in thread From: Petr Vorel @ 2022-10-31 19:05 UTC (permalink / raw) To: Chuck Lever III; +Cc: Jeff Layton, Linux NFS Mailing List > > On Oct 31, 2022, at 2:46 PM, Jeff Layton <jlayton@kernel.org> wrote: > > On Mon, 2022-10-31 at 19:45 +0100, Petr Vorel wrote: > >>>> On Oct 31, 2022, at 11:49 AM, Jeff Layton <jlayton@kernel.org> wrote: > >>>> 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: ce502f81ba88 ("NFSD: Convert the filecache to use rhashtable") > >>>> Reported-by: Petr Vorel <pvorel@suse.cz> > >>>> Signed-off-by: Jeff Layton <jlayton@kernel.org> > >>>> --- > >>>> 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! > > No problem. > >> 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? > In progress, I'll push the update in a moment. Thanks a lot! Kind regards, Petr > > Thanks, > > Jeff > >>>> The v1 patch applies cleanly to v6.0, but not to Chuck's for-next > >>>> branch. This one should be suitable there. > >>>> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > >>>> index 98c6b5f51bc8..4a8aa7cd8354 100644 > >>>> --- a/fs/nfsd/filecache.c > >>>> +++ b/fs/nfsd/filecache.c > >>>> @@ -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); > >>>> } > >>>> -- > >>>> 2.38.1 > > -- > > Jeff Layton <jlayton@kernel.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge 2022-10-31 15:49 [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge Jeff Layton 2022-10-31 17:10 ` Chuck Lever III @ 2022-11-04 21:21 ` Petr Vorel 2022-11-09 15:53 ` [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge #forregzbot Thorsten Leemhuis 1 sibling, 1 reply; 8+ messages in thread From: Petr Vorel @ 2022-11-04 21:21 UTC (permalink / raw) To: Jeff Layton; +Cc: chuck.lever, linux-nfs, regressions, Torsten Hilbrich Hi all, > 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: 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 > Reported-by: Petr Vorel <pvorel@suse.cz> > Signed-off-by: Jeff Layton <jlayton@kernel.org> > --- > 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. > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > index 98c6b5f51bc8..4a8aa7cd8354 100644 > --- a/fs/nfsd/filecache.c > +++ b/fs/nfsd/filecache.c > @@ -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); > } ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge #forregzbot 2022-11-04 21:21 ` Petr Vorel @ 2022-11-09 15:53 ` Thorsten Leemhuis 0 siblings, 0 replies; 8+ messages in thread From: Thorsten Leemhuis @ 2022-11-09 15:53 UTC (permalink / raw) To: regressions; +Cc: linux-nfs [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.] On 04.11.22 22:21, Petr Vorel wrote: > Hi all, > >> 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: 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-11-09 15:54 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-10-31 15:49 [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge Jeff Layton 2022-10-31 17:10 ` Chuck Lever III 2022-10-31 18:45 ` Petr Vorel 2022-10-31 18:46 ` Jeff Layton 2022-10-31 18:47 ` Chuck Lever III 2022-10-31 19:05 ` Petr Vorel 2022-11-04 21:21 ` Petr Vorel 2022-11-09 15:53 ` [PATCH v2] nfsd: fix net-namespace logic in __nfsd_file_cache_purge #forregzbot Thorsten Leemhuis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox