Skip to content

Commit 5f1fc2f

Browse files
committed
nfs_lib.sh: Unexport on proper side on netns
f6b2670 changed exportfs run locally on netns, therefore unexporting should be also run at the same namespace. This is not problematic now, but will be a problem with TST_ALL_FILESYSTEMS=1, which is sensitive for timing. Fixes: f6b2670 ("nfs_lib.sh: run exportfs at "server side" in LTP_NETNS case") Link: https://lore.kernel.org/ltp/[email protected]/ Acked-by: Cyril Hrubis <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent a05e671 commit 5f1fc2f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

testcases/network/nfs/nfs_stress/nfs_lib.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,16 @@ nfs_cleanup()
215215
for i in $VERSION; do
216216
type=$(get_socket_type $n)
217217
remote_dir="$(get_remote_dir $i $type)"
218-
tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir"
219-
tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir"
218+
219+
if tst_net_use_netns; then
220+
if test -d $remote_dir; then
221+
exportfs -u *:$remote_dir
222+
rm -rf $remote_dir
223+
fi
224+
else
225+
tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir"
226+
tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir"
227+
fi
220228
n=$(( n + 1 ))
221229
done
222230
}

0 commit comments

Comments
 (0)