[LTP] [PATCH v2 1/1] nfsstat01: Update client RPC calls for kernel 6.9

NeilBrown neilb@suse.de
Fri Aug 23 23:59:44 CEST 2024


On Fri, 23 Aug 2024, Petr Vorel wrote:
> Hi Chuck, Neil, all,
> 
> > On Wed, Aug 14, 2024 at 10:57:21AM +0200, Petr Vorel wrote:
> > > 6.9 moved client RPC calls to namespace in "Make nfs stats visible in
> > > network NS" patchet.
> 
> > > https://lore.kernel.org/linux-nfs/cover.1708026931.git.josef@toxicpanda.com/
> 
> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> > > Changes v1->v2:
> > > * Point out whole patchset, not just single commit
> > > * Add a comment about the patchset
> 
> > > Hi all,
> 
> > > could you please ack this so that we have fixed mainline?
> 
> > > FYI Some parts has been backported, e.g.:
> > > d47151b79e322 ("nfs: expose /proc/net/sunrpc/nfs in net namespaces")
> > > to all stable/LTS: 5.4.276, 5.10.217, 5.15.159, 6.1.91, 6.6.31.
> 
> > > But most of that is not yet (but planned to be backported), e.g.
> > > 93483ac5fec62 ("nfsd: expose /proc/net/sunrpc/nfsd in net namespaces")
> > > see Chuck's patchset for 6.6
> > > https://lore.kernel.org/linux-nfs/20240812223604.32592-1-cel@kernel.org/
> 
> > > Once all kernels up to 5.4 fixed we should update the version.
> 
> > > Kind regards,
> > > Petr
> 
> > >  testcases/network/nfs/nfsstat01/nfsstat01.sh | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> > > diff --git a/testcases/network/nfs/nfsstat01/nfsstat01.sh b/testcases/network/nfs/nfsstat01/nfsstat01.sh
> > > index c2856eff1f..1beecbec43 100755
> > > --- a/testcases/network/nfs/nfsstat01/nfsstat01.sh
> > > +++ b/testcases/network/nfs/nfsstat01/nfsstat01.sh
> > > @@ -15,7 +15,14 @@ get_calls()
> > >  	local calls opt
> 
> > >  	[ "$name" = "rpc" ] && opt="r" || opt="n"
> > > -	! tst_net_use_netns && [ "$nfs_f" != "nfs" ] && type="rhost"
> > > +
> > > +	if tst_net_use_netns; then
> > > +		# "Make nfs stats visible in network NS" patchet
> > > +		# https://lore.kernel.org/linux-nfs/cover.1708026931.git.josef@toxicpanda.com/
> > > +		tst_kvcmp -ge "6.9" && [ "$nfs_f" = "nfs" ] && type="rhost"
> 
> > Hello Petr-
> 
> > My concern with this fix is it targets v6.9 specifically, yet we
> > know these fixes will appear in LTS/stable kernels as well.
> 
> Great! I see you already fixed up to 5.15. I suppose the code is really
> backportable to the other still active branches (5.10, 5.4, 4.19).
> 
> We discussed in v1 how to fix tests.  Neil suggested to fix the test the way so
> that it works on all kernels. As I note [1]
> 
> 1) either we give up on checking the new functionality still works (if we
> fallback to old behavior)

I don't understand.  What exactly do you mean by "the new
functionality".
As I understand it there is no new functionality.  All there was was and
information leak between network namespaces, and we stopped the leak.
Do you consider that to be new functionality?

> 2) or we need to specify from which kernel we expect new functionality
> (so far it's 5.15, I suppose it will be older).
> 
> I would prefer 2) to have new functionality always tested.
> Or am I missing something obvious?

As I understand it the primary purpose of the test is to confirm that
when an NFS request is made, the client sees an increase the the count
of RPC requests in the client statistics.  and the server sees an
increase in the count of RPC requests in the server statistics.
That test, if performed correctly, should always work.

Is there something else you want to test?
If you want to test that the server DOESN'T see and increase in the
CLIENT statistics, then that is a valid thing to test and it won't work
on early kernels.  I think we only need to test that for kernels since
the fix landed in mainline.

I'm sure one of us is missing something obvious because I am CONFIDENT
that a test for correct functionality can be written to work on all
kernels.  We didn't add any new functionality and didn't break any old
functionality.  We just fixed a bug.

NeilBrown


> 
> Kind regards,
> Petr
> 
> [1] https://lore.kernel.org/linux-nfs/172367387549.6062.7078032983644586462@noble.neil.brown.name/
> 
> > Neil Brown suggested an alternative approach that might not depend
> > on knowing the specific kernel version:
> 
> > https://lore.kernel.org/linux-nfs/172078283934.15471.13377048166707693692@noble.neil.brown.name/
> 
> > HTH
> 
> 
> > > +	else
> > > +		[ "$nfs_f" != "nfs" ] && type="rhost"
> > > +	fi
> 
> > >  	if [ "$type" = "lhost" ]; then
> > >  		calls="$(grep $name /proc/net/rpc/$nfs_f | cut -d' ' -f$field)"
> > > -- 
> > > 2.45.2
> 



More information about the ltp mailing list