From f94dca9dcbd46c31c5f5e88ecb639a7c9f55159a Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Tue, 30 Jan 2024 21:14:33 +0800 Subject: [PATCH] LU-17276 tests: Enqueue same range flocks The ldlm_interval buffer will be released and referenced between flocks or extent locks. Add a test case to trigger such scene. Signed-off-by: Yang Sheng Change-Id: Ifa23ba7c16ad8601b1e3e7891a136589ea44e54a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53881 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index e67d765..af565e7 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -13031,6 +13031,37 @@ test_105e() { # bug 22660 && 22040 } run_test 105e "Two conflicting flocks from same process" +wait_end() { + echo $* + while :; do + [ -f $TMP/${tfile}_sTOP ] && return + sleep 1 + done +} + +test_105f() { + flock_is_enabled || skip_env "mount w/o flock enabled" + + local pmax=$(ulimit -u) + local i=0 + touch $DIR/$tfile + [ $pmax -gt 20 ] && pmax=20 + for((i=0; i <= $pmax; i++)) { + wait_end "R4000, 5000" | flocks_test 6 $DIR/$tfile & + } + for((i=0; i <= 10; i++)) { + local locks=$(do_facet $SINGLEMDS $LCTL get_param -n \ + ldlm.namespaces.mdt-${FSNAME}-MDT0000*.lock_count) + [ $locks -ge $pmax ] && break + [ $i -eq 10 ] && error "The locks cannot be added after 10 secs" + sleep 1 + } + touch $TMP/${tfile}_sTOP + wait + rm -r $DIR/$tfile $TMP/${tfile}_sTOP +} +run_test 105f "Enqueue same range flocks" + test_106() { #bug 10921 test_mkdir $DIR/$tdir $DIR/$tdir && error "exec $DIR/$tdir succeeded" -- 1.8.3.1