From: Jian Yu Date: Mon, 13 Mar 2023 00:32:16 +0000 (-0700) Subject: LU-16589 tests: fix hard-link failure in sanityn/55d X-Git-Tag: 2.15.55~65 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=25c6b7ad2859729197c3cc6e6dcf0621e4bda6fa;p=fs%2Flustre-release.git LU-16589 tests: fix hard-link failure in sanityn/55d Since coreutils version 8.31, the stat() and lstat() operations were removed from ln by commit 571f63f5010b, which caused the following dir hard-link failure in sanityn/55d: ln: failed to create hard link '/mnt/lustre2/d55d.sanityn/d55d.sanityn/' => '/mnt/lustre2/d55d.sanityn/f1': No such file or directory This actually reveals a kernel issue which is fixed by commit v5.18-rc2-188-gb3d4650d82c7. To avoid the kernel issue and keep the test effective, this patch appends the target filename to the $tdir/ so as to fix the hard-link failure. Test-Parameters: trivial env=ONLY=55d testlist=sanityn Test-Parameters: trivial clientdistro=el9.1 env=ONLY=55d testlist=sanityn Test-Parameters: trivial clientdistro=el9.0 env=ONLY=55d testlist=sanityn Test-Parameters: trivial clientdistro=sles15sp4 env=ONLY=55d testlist=sanityn Test-Parameters: trivial clientdistro=sles15sp3 env=ONLY=55d testlist=sanityn Change-Id: I42313e43eaea3d94007d534bf38efdeacf2ede43 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50127 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 5cabe65..a1f2d03 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -3491,9 +3491,9 @@ test_55d() mkdir -p $DIR2/$tdir/$tdir || error "(1) mkdir failed" # link in reverse locking order - ln $DIR2/$tdir/f1 $DIR2/$tdir/$tdir/ + ln $DIR2/$tdir/f1 $DIR2/$tdir/$tdir/f1 || error "(2) ln failed" - wait $PID1 && error "(2) mv succeeded" + ! wait $PID1 || error "(3) mv succeeded" rm -rf $DIR/$tdir } run_test 55d "rename file vs link"