X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=20599f5e81d429ceb90ebb591ad35ac9f9a3c277;hp=3f8badb51da6853c5d284ea7ab62d482b709c2ee;hb=a35113b690e39dcd39e126efc9085b3bc160b4ff;hpb=aed82035c0d194347f5cab17ebd48f355c379b1b diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 3f8badb..20599f5 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2111,6 +2111,29 @@ test_31n() { } run_test 31n "check link count of unlinked file" +link_one() { + local TEMPNAME=$(mktemp $1_XXXXXX) + mlink $TEMPNAME $1 2> /dev/null && + echo "$BASHPID: link $TEMPNAME to $1 succeeded" + munlink $TEMPNAME +} + +test_31o() { # LU-2901 + mkdir -p $DIR/$tdir + for LOOP in $(seq 100); do + rm -f $DIR/$tdir/$tfile* + for THREAD in $(seq 8); do + link_one $DIR/$tdir/$tfile.$LOOP & + done + wait + local LINKS=$(ls -1 $DIR/$tdir | grep -c $tfile.$LOOP) + [ $LINKS -gt 1 ] && ls $DIR/$tdir && + error "$LINKS duplicate links to $tfile.$LOOP" && + break || true + done +} +run_test 31o "duplicate hard links with same filename" + cleanup_test32_mount() { trap 0 $UMOUNT $DIR/$tdir/ext2-mountpoint