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:
}
run_test 27P "basic ops on foreign dir of foreign_symlink type"
+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
+
+ echo 'It is what it is' > $DIR/$tdir-1/$tfile
+ lov_getstripe_old $DIR/$tdir-1/$tfile || error "$DIR/$tdir-1/$tfile: rc = $?"
+
+ ln -s $DIR/$tdir-1/$tfile $DIR/$tdir-2/$tfile
+ lov_getstripe_old $DIR/$tdir-2/$tfile || error "$DIR/$tdir-2/$tfile: rc = $?"
+
+ ln -s $DIR/$tdir-1/$tfile $TMP/$tfile
+ lov_getstripe_old $TMP/$tfile || error "$TMP/$tfile: rc = $?"
+
+ # Create some bad symlinks and ensure that we don't loop
+ # forever or something. These should return ELOOP (40) and
+ # ENOENT (2) but I don't want to test for that because there's
+ # always some weirdo architecture that needs to ruin
+ # everything by defining these error numbers differently.
+
+ ln -s $TMP/$tfile.loop $TMP/$tfile.loop
+ lov_getstripe_old $TMP/$tfile.loop && error "$TMP/$tfile.loop: rc = $?"
+
+ ln -s $TMP/$tfile.none $TMP/$tfile.broken
+ lov_getstripe_old $TMP/$tfile.broken && error "$TMP/$tfile.broken: rc = $?"
+
+ return 0
+}
+run_test 27Q "llapi_file_get_stripe() works on symlinks"
+
# createtest also checks that device nodes are created and
# then visible correctly (#2091)
test_28() { # bug 2091
test_56a() {
local numfiles=3
+ local numdirs=2
local dir=$DIR/$tdir
rm -rf $dir
#test lfs getstripe with -v prints lmm_fid
filenum=$($LFS getstripe -v $dir | grep -c lmm_fid)
- [[ $filenum -eq $((numfiles * numcomp)) ]] ||
+ local countfids=$((numdirs + numfiles * numcomp))
+ [[ $filenum -eq $countfids ]] ||
error "$LFS getstripe -v $dir: "\
- "got $filenum want $((numfiles * numcomp)) lmm_fid"
+ "got $filenum want $countfids lmm_fid"
[[ $($LFS getstripe $dir | grep -c lmm_fid) -eq 0 ]] ||
error "$LFS getstripe $dir: showed lmm_fid by default"
echo "$LFS getstripe --verbose passed"
}
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 103e "inheritance of big amount of default ACLs"
+test_103f() {
+ (( $MDS1_VERSION >= $(version_code 2.14.51) )) ||
+ skip "MDS needs to be at least 2.14.51"
+
+ large_xattr_enabled || skip_env "ea_inode feature disabled"
+
+ # enable changelog to consume more internal MDD buffers
+ changelog_register
+
+ mkdir -p $DIR/$tdir
+ # add big LOV EA
+ $LFS setstripe -C 1000 $DIR/$tdir
+ setfacl -d -m user:$U:rwx $DIR/$tdir || error "Cannot add default ACLs"
+ mkdir $DIR/$tdir/inherited || error "failed to create subdirectory"
+ rmdir $DIR/$tdir/inherited || error "Cannot remove subdirectory"
+ rmdir $DIR/$tdir || error "Cannot remove directory"
+}
+run_test 103f "changelog doesn't interfere with default ACLs buffers"
+
test_104a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
}
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"
--filename=$DIR/$tfile || true
wait $bg_pid
- rm -rf $DIR/$tfile
+ rm -f $DIR/$tfile
}
run_test 398b "DIO and buffer IO race"
--filename=$DIR/$tfile
[ $? -eq 0 ] || error "fio large block size failed"
- rm -rf $DIR/$tfile
+ rm -f $DIR/$tfile
$LCTL set_param debug="$saved_debug"
}
run_test 398c "run fio to test AIO"
test_398d() { # LU-13846
- test -f aiocp || skip_env "no aiocp installed"
- local aio_file=$DIR/aio_file
+ which aiocp || skip_env "no aiocp installed"
+ local aio_file=$DIR/$tfile.aio
$LFS setstripe -c -1 -S 1M $DIR/$tfile $aio_file
dd if=/dev/urandom of=$DIR/$tfile bs=1M count=64
aiocp -a $PAGE_SIZE -b 64M -s 64M -f O_DIRECT $DIR/$tfile $aio_file
+ stack_trap "rm -f $DIR/$tfile $aio_file"
- diff $DIR/$tfile $aio_file || "file diff after aiocp"
+ diff $DIR/$tfile $aio_file || error "file diff after aiocp"
# make sure we don't crash and fail properly
aiocp -a 512 -b 64M -s 64M -f O_DIRECT $DIR/$tfile $aio_file &&
error "aio not aligned with PAGE SIZE should fail"
- rm -rf $DIR/$tfile $aio_file
+ rm -f $DIR/$tfile $aio_file
}
run_test 398d "run aiocp to verify block size > stripe size"
}
run_test 398e "O_Direct open cleared by fcntl doesn't cause hang"
+test_398f() { # LU-14687
+ which aiocp || skip_env "no aiocp installed"
+ local aio_file=$DIR/$tfile.aio
+
+ $LFS setstripe -c -1 -S 1M $DIR/$tfile $aio_file
+
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=64
+ stack_trap "rm -f $DIR/$tfile $aio_file"
+
+ #define OBD_FAIL_LLITE_PAGE_ALLOC 0x1418
+ $LCTL set_param fail_loc=0x1418
+ # make sure we don't crash and fail properly
+ aiocp -b 64M -s 64M -f O_DIRECT $DIR/$tfile $aio_file &&
+ error "aio with page allocation failure succeeded"
+ $LCTL set_param fail_loc=0
+ diff $DIR/$tfile $aio_file
+ [[ $? != 0 ]] || error "no diff after failed aiocp"
+}
+run_test 398f "verify aio handles ll_direct_rw_pages errors correctly"
+
test_fake_rw() {
local read_write=$1
if [ "$read_write" = "write" ]; then