ALWAYS_EXCEPT+=" 411"
fi
-# 5 12 8 12 (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="27m 64b 68 71 115 135 136 300o"
+# 5 12 8 12 (min)"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="27m 60i 64b 68 71 115 135 136 300o"
if [ "$mds1_FSTYPE" = "zfs" ]; then
# bug number for skipped test:
test_27Q() {
rm -f $TMP/$tfile $TMP/$tfile.loop $TMP/$tfile.none $TMP/$tfile.broken
+ stack_trap "rm -f $TMP/$tfile*"
test_mkdir $DIR/$tdir-1
test_mkdir $DIR/$tdir-2
}
run_test 56ab "lfs find --blocks"
+# LU-11188
+test_56aca() {
+ local dir="$DIR/$tdir"
+ local perms=(001 002 003 004 005 006 007
+ 010 020 030 040 050 060 070
+ 100 200 300 400 500 600 700
+ 111 222 333 444 555 666 777)
+ local perm_minus=(8 8 4 8 4 4 2
+ 8 8 4 8 4 4 2
+ 8 8 4 8 4 4 2
+ 4 4 2 4 2 2 1)
+ local perm_slash=(8 8 12 8 12 12 14
+ 8 8 12 8 12 12 14
+ 8 8 12 8 12 12 14
+ 16 16 24 16 24 24 28)
+
+ test_mkdir "$dir"
+ for perm in ${perms[*]}; do
+ touch "$dir/$tfile.$perm"
+ chmod $perm "$dir/$tfile.$perm"
+ done
+
+ for ((i = 0; i < ${#perms[*]}; i++)); do
+ local num=$($LFS find $dir -perm ${perms[i]} | wc -l)
+ (( $num == 1 )) ||
+ error "lfs find -perm ${perms[i]}:"\
+ "$num != 1"
+
+ num=$($LFS find $dir -perm -${perms[i]} -type f| wc -l)
+ (( $num == ${perm_minus[i]} )) ||
+ error "lfs find -perm -${perms[i]}:"\
+ "$num != ${perm_minus[i]}"
+
+ num=$($LFS find $dir -perm /${perms[i]} -type f| wc -l)
+ (( $num == ${perm_slash[i]} )) ||
+ error "lfs find -perm /${perms[i]}:"\
+ "$num != ${perm_slash[i]}"
+ done
+}
+run_test 56aca "check lfs find -perm with octal representation"
+
+test_56acb() {
+ local dir=$DIR/$tdir
+ # p is the permission of write and execute for user, group and other
+ # without the umask. It is used to test +wx.
+ local p=$(printf "%o" "$((0333 & ~$(umask)))")
+ local perms=(1000 000 2000 4000 $p 644 111 110 100 004)
+ local symbolic=(+t a+t u+t g+t o+t
+ g+s u+s o+s +s o+sr
+ o=r,ug+o,u+w
+ u+ g+ o+ a+ ugo+
+ u- g- o- a- ugo-
+ u= g= o= a= ugo=
+ o=r,ug+o,u+w u=r,a+u,u+w
+ g=r,ugo=g,u+w u+x,+X +X
+ u+x,u+X u+X u+x,g+X o+r,+X
+ u+x,go+X +wx +rwx)
+
+ test_mkdir $dir
+ for perm in ${perms[*]}; do
+ touch "$dir/$tfile.$perm"
+ chmod $perm "$dir/$tfile.$perm"
+ done
+
+ for (( i = 0; i < ${#symbolic[*]}; i++ )); do
+ local num=$($LFS find $dir -perm ${symbolic[i]} | wc -l)
+
+ (( $num == 1 )) ||
+ error "lfs find $dir -perm ${symbolic[i]}: $num != 1"
+ done
+}
+run_test 56acb "check lfs find -perm with symbolic representation"
+
+test_56acc() {
+ local dir=$DIR/$tdir
+ local tests="17777 787 789 abcd
+ ug=uu ug=a ug=gu uo=ou urw
+ u+xg+x a=r,u+x,"
+
+ test_mkdir $dir
+ for err in $tests; do
+ if $LFS find $dir -perm $err 2>/dev/null; then
+ error "lfs find -perm $err: parsing should have failed"
+ fi
+ done
+}
+run_test 56acc "check parsing error for lfs find -perm"
+
test_56ba() {
[ $MDS1_VERSION -lt $(version_code 2.10.50) ] &&
skip "Need MDS version at least 2.10.50"
}
run_test 60h "striped directory with missing stripes can be accessed"
+function t60i_load() {
+ mkdir $DIR/$tdir
+ #define OBD_FAIL_LLOG_PAUSE_AFTER_PAD 0x131c
+ $LCTL set_param fail_loc=0x131c fail_val=1
+ for ((i=0; i<5000; i++)); do
+ touch $DIR/$tdir/f$i
+ done
+}
+
+test_60i() {
+ changelog_register || error "changelog_register failed"
+ local cl_user="${CL_USERS[$SINGLEMDS]%% *}"
+ changelog_users $SINGLEMDS | grep -q $cl_user ||
+ error "User $cl_user not found in changelog_users"
+ changelog_chmask "ALL"
+ t60i_load &
+ local PID=$!
+ for((i=0; i<100; i++)); do
+ changelog_dump >/dev/null ||
+ error "can't read changelog"
+ done
+ kill $PID
+ wait $PID
+ changelog_deregister || error "changelog_deregister failed"
+ $LCTL set_param fail_loc=0
+}
+run_test 60i "llog: new record vs reader race"
+
test_61a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
which getfattr > /dev/null 2>&1 || skip_env "no getfattr command"
which setfattr > /dev/null 2>&1 || skip_env "no setfattr command"
- local root_layout=$(save_layout $MOUNT)
- stack_trap "restore_layout $MOUNT $root_layout" EXIT
+ save_layout_restore_at_exit $MOUNT
# new subdirectory under root directory should not inherit
# the default layout from root
}
run_test 160m "Changelog clear race"
+test_160n() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ [[ $MDS1_VERSION -ge $(version_code 2.14.51) ]] ||
+ skip "Need MDS version at least 2.14.51"
+ local cl_users
+ local cl_user1
+ local cl_user2
+ local pid1
+ local first_rec
+ local last_rec=0
+
+ # Create a user
+ changelog_register || error "first changelog_register failed"
+
+ cl_users=(${CL_USERS[mds1]})
+ cl_user1="${cl_users[0]}"
+
+ # generate some changelog records to accumulate on MDT0
+ test_mkdir -i0 -c1 $DIR/$tdir || error "test_mkdir $tdir failed"
+ first_rec=$(changelog_users $SINGLEMDS |
+ awk '/^current.index:/ { print $NF }')
+ while (( last_rec < (( first_rec + 65000)) )); do
+ createmany -m $DIR/$tdir/$tfile 10000 ||
+ error "create $DIR/$tdir/$tfile failed"
+
+ for i in $(seq 0 10000); do
+ mrename $DIR/$tdir/$tfile$i $DIR/$tdir/$tfile-new$i \
+ > /dev/null
+ done
+
+ unlinkmany $DIR/$tdir/$tfile-new 10000 ||
+ error "unlinkmany failed unlink"
+ last_rec=$(changelog_users $SINGLEMDS |
+ awk '/^current.index:/ { print $NF }')
+ echo last record $last_rec
+ (( last_rec == 0 )) && error "no changelog found"
+ done
+
+#define OBD_FAIL_MDS_CHANGELOG_DEL 0x16c
+ do_facet mds1 $LCTL set_param fail_loc=0x8000016c fail_val=0
+
+ __changelog_clear mds1 $cl_user1 0 &
+ pid1=$!
+ sleep 2
+ __changelog_clear mds1 $cl_user1 0 ||
+ error "fail to cancel record for $cl_user1"
+ wait $pid1
+ [[ $? -eq 0 ]] || error "fail to cancel record for $cl_user2"
+}
+run_test 160n "Changelog destroy race"
test_161a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"