Whamcloud - gitweb
LU-17276 tests: Enqueue same range flocks 81/53881/2
authorYang Sheng <ys@whamcloud.com>
Tue, 30 Jan 2024 13:14:33 +0000 (21:14 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 4 Mar 2024 20:04:13 +0000 (20:04 +0000)
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 <ys@whamcloud.com>
Change-Id: Ifa23ba7c16ad8601b1e3e7891a136589ea44e54a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53881
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index e67d765..af565e7 100755 (executable)
@@ -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"