All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] nfs_lib: Fix fsid randomisation
@ 2022-03-11 12:49 Petr Vorel
  2022-03-11 17:02 ` Martin Doucha
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2022-03-11 12:49 UTC (permalink / raw)
  To: ltp; +Cc: Neil Brown, Martin Doucha

Testing nfs with multiple versions (-v, i.e. nfs0*_06 - testing with
nfs06.sh) nfs_lib.sh exports multiple different directories all with the
same fsid= value, which is not supposed to work (and breaks on older
nfs-utils).

Therefore increase fsid value for each loop.

Reported-by: Neil Brown <neilb@suse.de>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

fsid check is not required, but added to prevent another false positive
in the future.

Thanks Neil!

Kind regards,
Petr

 testcases/network/nfs/nfs_stress/nfs_lib.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index 7a7cd9925b..ad96bb4438 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -79,7 +79,11 @@ nfs_server_udp_enabled()
 
 nfs_setup_server()
 {
-	local export_cmd="exportfs -i -o fsid=$$,no_root_squash,rw *:$remote_dir"
+
+	local fsid="$1"
+	local export_cmd="exportfs -i -o fsid=$fsid,no_root_squash,rw *:$remote_dir"
+
+	[ -z "$fsid" ] && tst_brk TBROK "empty fsid"
 
 	if tst_net_use_netns; then
 		if ! test -d $remote_dir; then
@@ -161,7 +165,7 @@ nfs_setup()
 		remote_dir="$TST_TMPDIR/$i/$type"
 		mkdir -p $local_dir
 
-		nfs_setup_server
+		nfs_setup_server $(($$ + n))
 
 		opts="-o proto=$type,vers=$i"
 		nfs_mount
-- 
2.35.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-13 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11 12:49 [LTP] [PATCH 1/1] nfs_lib: Fix fsid randomisation Petr Vorel
2022-03-11 17:02 ` Martin Doucha
2022-03-13 21:09   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.