[LTP] [PATCH 2/3] nfs03.sh: Wait for all files to be removed

Richard Palethorpe rpalethorpe@suse.de
Wed Sep 20 09:59:12 CEST 2023


Hello,

Martin Doucha <mdoucha@suse.cz> writes:

> A race condition between the two parallel calls of rm_files may cause
> NFS unmount to fail and then the NFS client will get confused by remote
> filesystem change which leads to strange failures. Make sure both
> rm_files calls finish before returning from the main test function.

You mean unmounting fails if there are still operations in progress?

Like does umount fail with EBUSY?

>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/network/nfs/nfs_stress/nfs03.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/testcases/network/nfs/nfs_stress/nfs03.sh b/testcases/network/nfs/nfs_stress/nfs03.sh
> index e5f4de67c..e9ef5fb78 100755
> --- a/testcases/network/nfs/nfs_stress/nfs03.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs03.sh
> @@ -66,11 +66,13 @@ do_test()
>  	cd ../dir1
>  	wait $pid1
>  	rm_files &
> +	pid3=$!
>  
>  	tst_res TINFO "cd dir2 & removing files"
>  	cd ../dir2
>  	wait $pid2
>  	rm_files
> +	wait $pid3
>  
>  	tst_res TPASS "test done"
>  }
> -- 
> 2.42.0


-- 
Thank you,
Richard.


More information about the ltp mailing list