rm -fr $DIR/d33
test_mkdir -p $DIR/d33
chown $RUNAS_ID $DIR/d33
- $RUNAS $OPENFILE -f 1286739555 $DIR/d33/f33 && error "create" || true
+ $RUNAS $OPENFILE -f 1286739555 $DIR/d33/f33
}
-run_test 33b "test open file with malformed flags (No panic and return error)"
+run_test 33b "test open file with malformed flags (No panic)"
test_33c() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
return $?
}
-test_103 () {
+test_103a() {
[ "$UID" != 0 ] && skip_env "must run as root" && return
[ -z "$(lctl get_param -n mdc.*-mdc-*.connect_flags | grep acl)" ] &&
skip "must have acl enabled" && return
fi
done
}
-run_test 103 "acl test ========================================="
+run_test 103a "acl test ========================================="
+
+test_103b() {
+ local noacl=false
+ local MDT_DEV=$(mdsdevname ${SINGLEMDS//mds/})
+ local mountopts=$MDS_MOUNT_OPTS
+
+ if [[ "$MDS_MOUNT_OPTS" =~ "noacl" ]]; then
+ noacl=true
+ else
+ # stop the MDT
+ stop $SINGLEMDS || error "failed to stop MDT."
+ # remount the MDT
+ if [ -z "$MDS_MOUNT_OPTS" ]; then
+ MDS_MOUNT_OPTS="-o noacl"
+ else
+ MDS_MOUNT_OPTS="${MDS_MOUNT_OPTS},noacl"
+ fi
+ start $SINGLEMDS $MDT_DEV $MDS_MOUNT_OPTS ||
+ error "failed to start MDT."
+ MDS_MOUNT_OPTS=$mountopts
+ fi
+
+ touch $DIR/$tfile
+ setfacl -m u:bin:rw $DIR/$tfile && error "setfacl should fail"
+
+ if ! $noacl; then
+ # stop the MDT
+ stop $SINGLEMDS || error "failed to stop MDT."
+ # remount the MDT
+ start $SINGLEMDS $MDT_DEV $MDS_MOUNT_OPTS ||
+ error "failed to start MDT."
+ fi
+
+ true
+}
+run_test 103b "MDS mount option 'noacl'"
+
+test_103c() {
+ mkdir -p $DIR/$tdir
+ cp -rp $DIR/$tdir $DIR/$tdir.bak
+
+ [ -n "$(getfattr -d -m. $DIR/$tdir | grep posix_acl_default)" ] &&
+ error "$DIR/$tdir shouldn't contain default ACL"
+ [ -n "$(getfattr -d -m. $DIR/$tdir.bak | grep posix_acl_default)" ] &&
+ error "$DIR/$tdir.bak shouldn't contain default ACL"
+ true
+}
+run_test 103c "'cp -rp' won't set empty acl"
test_104a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
dd if=/dev/urandom of=$file bs=4k count=4 2>&1 > /dev/null
idx=$(printf %04x $i)
BEFORE=$(get_osd_param $list *OST*$idx stats |
- awk '$1 == "cache_access" {sum += $2}
+ awk '$1 == "cache_access" {sum += $7}
END { printf("%0.0f", sum) }')
cancel_lru_locks osc
cat $file >/dev/null
AFTER=$(get_osd_param $list *OST*$idx stats |
- awk '$1 == "cache_access" {sum += $2}
+ awk '$1 == "cache_access" {sum += $7}
END { printf("%0.0f", sum) }')
echo BEFORE:$BEFORE AFTER:$AFTER
function roc_hit() {
local list=$(comma_list $(osts_nodes))
echo $(get_osd_param $list '' stats |
- awk '$1 == "cache_hit" {sum += $2}
+ awk '$1 == "cache_hit" {sum += $7}
END { printf("%0.0f", sum) }')
}
}
run_test 154d "Verify open file fid"
+test_154e()
+{
+ [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.50) ]] &&
+ skip "Need MDS version at least 2.6.50" && return
+
+ if ls -a $MOUNT | grep -q '^\.lustre$'; then
+ error ".lustre returned by readdir"
+ fi
+}
+run_test 154e ".lustre is not returned by readdir"
+
test_155_small_load() {
local temp=$TMP/$tfile
local file=$DIR/$tfile
test_mkdir -p -c1 $DIR/$tdir/d2/p/q/r
# regular file
FID=$($LFS path2fid $DIR/$tdir/d2/$tfile | tr -d '[]')
- check_path "$tdir/d2/$tfile" $FSNAME $FID --link 0
+ check_path "$tdir/d2/$tfile" $FSNAME $FID --link 0 ||
+ error "check path $tdir/d2/$tfile failed"
# softlink
ln -s $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/slink
FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink | tr -d '[]')
- check_path "$tdir/d2/p/q/r/slink" $FSNAME $FID --link 0
+ check_path "$tdir/d2/p/q/r/slink" $FSNAME $FID --link 0 ||
+ error "check path $tdir/d2/p/q/r/slink failed"
# softlink to wrong file
ln -s /this/is/garbage $DIR/$tdir/d2/p/q/r/slink.wrong
FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink.wrong | tr -d '[]')
- check_path "$tdir/d2/p/q/r/slink.wrong" $FSNAME $FID --link 0
+ check_path "$tdir/d2/p/q/r/slink.wrong" $FSNAME $FID --link 0 ||
+ error "check path $tdir/d2/p/q/r/slink.wrong failed"
# hardlink
ln $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/hlink
mv $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/a/b/c/new_file
FID=$($LFS path2fid $DIR/$tdir/d2/a/b/c/new_file | tr -d '[]')
# fid2path dir/fsname should both work
- check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1
- check_path "$DIR/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0
+ check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1 ||
+ error "check path $tdir/d2/a/b/c/new_file failed"
+ check_path "$DIR/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0 ||
+ error "check path $DIR/$tdir/d2/p/q/r/hlink failed"
# hardlink count: check that there are 2 links
# Doesnt work with CMD yet: 17935
# hardlink indexing: remove the first link
rm $DIR/$tdir/d2/p/q/r/hlink
- check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 0
+ check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 0 ||
+ error "check path $DIR/$tdir/d2/a/b/c/new_file failed"
return 0
}
for ((i=0;i<5;i++)); do
FID=$($LFS path2fid $DIR/$tdir/striped_dir/f$i | tr -d '[]') ||
error "get fid for f$i failed"
- check_path "$tdir/striped_dir/f$i" $FSNAME $FID --link 0
+ check_path "$tdir/striped_dir/f$i" $FSNAME $FID --link 0 ||
+ error "check path $tdir/striped_dir/f$i failed"
FID=$($LFS path2fid $DIR/$tdir/striped_dir/d$i | tr -d '[]') ||
error "get fid for d$i failed"
- check_path "$tdir/striped_dir/d$i" $FSNAME $FID --link 0
+ check_path "$tdir/striped_dir/d$i" $FSNAME $FID --link 0 ||
+ error "check path $tdir/striped_dir/d$i failed"
done
return 0
# The new system calls are supported in glibc >= 2.14.
test_237() {
- echo "Test file_handle syscalls" > $DIR/$tfile
+ echo "Test file_handle syscalls" > $DIR/$tfile ||
+ error "write failed"
check_fhandle_syscalls $DIR/$tfile ||
error "check_fhandle_syscalls failed"
}
}
run_test 239 "osp_sync test"
+test_240() {
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ mkdir -p $DIR/$tdir
+
+ $LFS mkdir -i 0 $DIR/$tdir/d0 ||
+ error "failed to mkdir $DIR/$tdir/d0 on MDT0"
+ $LFS mkdir -i 1 $DIR/$tdir/d0/d1 ||
+ error "failed to mkdir $DIR/$tdir/d0/d1 on MDT1"
+
+ umount_client $MOUNT || error "umount failed"
+ #define OBD_FAIL_TGT_DELAY_CONDITIONAL 0x713
+ do_facet mds2 lctl set_param fail_loc=0x713 fail_val=1
+ mount_client $MOUNT || error "failed to mount client"
+
+ echo "stat $DIR/$tdir/d0/d1, should not fail/ASSERT"
+ stat $DIR/$tdir/d0/d1 || error "fail to stat $DIR/$tdir/d0/d1"
+}
+run_test 240 "race between ldlm enqueue and the connection RPC (no ASSERT)"
+
cleanup_test_300() {
trap 0
umask $SAVE_UMASK
}
run_test 300g "check default striped directory for striped directory"
+test_300h() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ local stripe_count
+ local file
+
+ mkdir $DIR/$tdir
+
+ $LFS setdirstripe -i 0 -c$MDSCOUNT -t all_char $DIR/$tdir/striped_dir ||
+ error "set striped dir error"
+
+ createmany -o $DIR/$tdir/striped_dir/f- 10 ||
+ error "create files under striped dir failed"
+
+ # unfortunately, we need to umount to clear dir layout cache for now
+ # once we fully implement dir layout, we can drop this
+ umount_client $MOUNT || error "umount failed"
+ mount_client $MOUNT || error "mount failed"
+
+ #set the stripe to be unknown hash type
+ #define OBD_FAIL_UNKNOWN_LMV_STRIPE 0x1901
+ $LCTL set_param fail_loc=0x1901
+ for ((i = 0; i < 10; i++)); do
+ $CHECKSTAT -t file $DIR/$tdir/striped_dir/f-$i ||
+ error "stat f-$i failed"
+ rm $DIR/$tdir/striped_dir/f-$i || error "unlink f-$i failed"
+ done
+
+ touch $DIR/$tdir/striped_dir/f0 &&
+ error "create under striped dir with unknown hash should fail"
+
+ $LCTL set_param fail_loc=0
+
+ umount_client $MOUNT || error "umount failed"
+ mount_client $MOUNT || error "mount failed"
+
+ return 0
+}
+run_test 300h "client handle unknown hash type striped directory"
+
test_400a() { # LU-1606, was conf-sanity test_74
local extra_flags=''
local out=$TMP/$tfile