# bug number: LU-8411 LU-9054
ALWAYS_EXCEPT+=" 407 312"
+if $SHARED_KEY; then
+ # bug number: LU-14181 LU-14181
+ ALWAYS_EXCEPT+=" 64e 64f"
+fi
+
selinux_status=$(getenforce)
if [ "$selinux_status" != "Disabled" ]; then
# bug number:
if [ "$mds1_FSTYPE" = "zfs" ]; then
# bug number for skipped test:
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT "
+ ALWAYS_EXCEPT+=" "
# 13 (min)"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b"
fi
+if [ "$ost1_FSTYPE" = "zfs" ]; then
+ # bug number for skipped test: LU-1941 LU-1941 LU-1941 LU-1941
+ ALWAYS_EXCEPT+=" 130a 130b 130c 130d 130e 130f 130g"
+fi
+
# Get the SLES distro version
#
# Returns a version string that should only be used in comparing
[ "$exp_val" == "$imp_val" ] ||
error "export flags '$exp_val' != import flags '$imp_val'"
- # Compare the value of client version
+ # Compare client versions. Only compare top-3 fields for compatibility
exp_client_version=$(awk '/target_version:/ { print $2 }' $temp_exp)
- exp_val=$(version_code $exp_client_version)
- imp_val=$CLIENT_VERSION
+ exp_val=$(version_code $(cut -d. -f1,2,3 <<<$exp_client_version))
+ imp_val=$(version_code $(lustre_build_version client | cut -d. -f1,2,3))
[ "$exp_val" == "$imp_val" ] ||
- error "export client version '$exp_val' != '$imp_val'"
+ error "exp version '$exp_client_version'($exp_val) != " \
+ "'$(lustre_build_version client)'($imp_val)"
}
run_test 0d "check export proc ============================="
}
run_test 31p "remove of open striped directory"
+test_31q() {
+ [ $MDSCOUNT -lt 3 ] && skip_env "needs >= 3 MDTs"
+
+ $LFS mkdir -i 3,1 $DIR/$tdir || error "mkdir failed"
+ index=$($LFS getdirstripe -i $DIR/$tdir)
+ [ $index -eq 3 ] || error "first stripe index $index != 3"
+ index=$($LFS getdirstripe $DIR/$tdir | tail -1 | awk '{print $1}')
+ [ $index -eq 1 ] || error "second stripe index $index != 1"
+
+ # when "-c <stripe_count>" is set, the number of MDTs specified after
+ # "-i" should equal to the stripe count
+ $LFS mkdir -i 3,1 -c 3 $DIR/$tdir.2 && error "mkdir should fail" || true
+}
+run_test 31q "create striped directory on specific MDTs"
+
cleanup_test32_mount() {
local rc=0
trap 0
local file2_stripe_size=$($LFS getstripe -S $file2)
[[ $file2_stripe_size -eq $new_def_stripe_size ]] ||
+ {
+ echo "file2_stripe_size: '$file2_stripe_size'"
+ echo "new_def_stripe_size: '$new_def_stripe_size'"
error "$file2 didn't inherit stripe size $new_def_stripe_size"
+ }
local dir3=$MOUNT/$tdir-3
mkdir $dir3 || error "mkdir $dir3 failed"
local dir3_layout=$(get_layout_param $dir3)
local root_dir_layout=$(get_layout_param $MOUNT)
[[ "$dir3_layout" = "$root_dir_layout" ]] ||
+ {
+ echo "dir3_layout: '$dir3_layout'"
+ echo "root_dir_layout: '$root_dir_layout'"
error "$dir3 should show the default layout from $MOUNT"
+ }
# set OST pool on root directory
local pool=$TESTNAME
local file3_pool=$($LFS getstripe -p $file3)
[[ "$file3_pool" = "$pool" ]] ||
- error "$file3 didn't inherit OST pool $pool"
+ error "$file3 ('$file3_pool') didn't inherit OST pool '$pool'"
local dir4=$MOUNT/$tdir-4
mkdir $dir4 || error "mkdir $dir4 failed"
echo "$LFS getstripe -d $MOUNT"
$LFS getstripe -d $MOUNT
[[ "$dir4_layout" = "$root_dir_layout" ]] ||
+ {
+ echo "dir4_layout: '$dir4_layout'"
+ echo "root_dir_layout: '$root_dir_layout'"
error "$dir4 should show the default layout from $MOUNT"
+ }
# new file created in $dir4 should inherit the pool from
# the filesystem default
local file4_pool=$($LFS getstripe -p $file4)
[[ "$file4_pool" = "$pool" ]] ||
- error "$file4 didn't inherit OST pool $pool"
+ error "$file4 ('$file4_pool') didn't inherit OST pool $pool"
# new subdirectory under non-root directory should inherit
# the default layout from its parent directory
dir4_layout=$(get_layout_param $dir4)
local dir5_layout=$(get_layout_param $dir5)
[[ "$dir4_layout" = "$dir5_layout" ]] ||
+ {
+ echo "dir4_layout: '$dir4_layout'"
+ echo "dir5_layout: '$dir5_layout'"
error "$dir5 should inherit the default layout from $dir4"
+ }
# though subdir under ROOT doesn't inherit default layout, but
# its sub dir/file should be created with default layout.
local fm_file=$DIR/$tfile
$LFS setstripe -S 131072 -c 2 $fm_file || error "setstripe on $fm_file"
- [ "$(facet_fstype ost$(($($LFS getstripe -i $fm_file) + 1)))" = "zfs" ] &&
- skip_env "ORI-366/LU-1941: FIEMAP unimplemented on ZFS"
NUM_BLKS=512
EXPECTED_LEN=$(( (NUM_BLKS / 2) * 64 ))
- for ((i = 0; i < $NUM_BLKS; i++))
- do
- dd if=/dev/zero of=$fm_file count=1 bs=64k seek=$((2*$i)) conv=notrunc > /dev/null 2>&1
+ for ((i = 0; i < $NUM_BLKS; i++)); do
+ dd if=/dev/zero of=$fm_file count=1 bs=64k seek=$((2*$i)) \
+ conv=notrunc > /dev/null 2>&1
done
filefrag -ves $fm_file || error "filefrag $fm_file failed"
filefrag_op=$(filefrag -ve -k $fm_file |
sed -n '/ext:/,/found/{/ext:/d; /found/d; p}')
- last_lun=$(echo $filefrag_op | cut -d: -f5 |
- sed -e 's/^[ \t]*/0x/' | sed -e 's/0x0x/0x/')
+ last_lun=$(echo $filefrag_op | cut -d: -f5)
IFS=$'\n'
tot_len=0
num_luns=1
- for line in $filefrag_op
- do
- frag_lun=$(echo $line | cut -d: -f5 |
- sed -e 's/^[ \t]*/0x/' | sed -e 's/0x0x/0x/')
+ for line in $filefrag_op; do
+ frag_lun=$(echo $line | cut -d: -f5)
ext_len=$(echo $line | cut -d: -f4)
- if (( $frag_lun != $last_lun )); then
+ if [[ "$frag_lun" != "$last_lun" ]]; then
if (( tot_len != $EXPECTED_LEN )); then
cleanup_130
- error "FIEMAP on $fm_file failed; returned " \
- "len $tot_len for OST $last_lun instead " \
- "of $EXPECTED_LEN"
- return
+ error "OST$last_lun $tot_len != $EXPECTED_LEN"
else
(( num_luns += 1 ))
tot_len=0
done
if (( num_luns != 2 || tot_len != $EXPECTED_LEN )); then
cleanup_130
- error "FIEMAP on $fm_file failed; returned wrong number " \
- "of luns or wrong len for OST $last_lun"
- return
+ error "OST$last_lun $num_luns != 2, $tot_len != $EXPECTED_LEN"
fi
- cleanup_130
-
echo "FIEMAP with continuation calls succeeded"
}
run_test 130e "FIEMAP (test continuation FIEMAP calls)"
filefrag_extents=$(filefrag -vek $fm_file |
awk '/extents? found/ { print $2 }')
if [[ "$filefrag_extents" != "0" ]]; then
- error "FIEMAP on $fm_file failed; " \
- "returned $filefrag_extents expected 0"
+ error "$fm_file: filefrag_extents=$filefrag_extents != 0"
fi
rm -f $fm_file
}
run_test 130f "FIEMAP (unstriped file)"
+test_130g() {
+ local file=$DIR/$tfile
+ local nr=$((OSTCOUNT * 100))
+
+ $LFS setstripe -C $nr $file ||
+ error "failed to setstripe -C $nr $file"
+
+ dd if=/dev/zero of=$file count=$nr bs=1M
+ sync
+ nr=$($LFS getstripe -c $file)
+
+ local extents=$(filefrag -v $file |
+ sed -n '/ext:/,/found/{/ext:/d; /found/d; p}' | wc -l)
+
+ echo "filefrag list $extents extents in file with stripecount $nr"
+ if (( extents < nr )); then
+ $LFS getstripe $file
+ filefrag -v $file
+ error "filefrag printed $extents < $nr extents"
+ fi
+
+ rm -f $file
+}
+run_test 130g "FIEMAP (overstripe file)"
+
# Test for writev/readv
test_131a() {
rwv -f $DIR/$tfile -w -n 3 524288 1048576 1572864 ||
local TF="$TMP/$tfile"
+ stack_trap "rm -f $DIR/$tfile; wait_delete_completed"
dd if=/dev/urandom of=$TF bs=6096 count=1 || error "dd failed"
cp $TF $DIR/$tfile
cancel_lru_locks $OSC
echo "12345" >>$DIR/$tfile
cancel_lru_locks $OSC
cmp $TF $DIR/$tfile || error "$TF $DIR/$tfile differ (append2)"
-
- rm -f $TF
- true
}
run_test 150a "truncate/append tests"
test_150b() {
- [ "$ost1_FSTYPE" != ldiskfs ] && skip "non-ldiskfs backend"
- [ $OST1_VERSION -lt $(version_code 2.13.50) ] &&
- skip "Need OST version at least 2.13.53"
+ check_for_fallocate
+
touch $DIR/$tfile
+ stack_trap "rm -f $DIR/$tfile; wait_delete_completed"
check_fallocate $DIR/$tfile || error "fallocate failed"
}
run_test 150b "Verify fallocate (prealloc) functionality"
-test_150c() {
- local bytes
- local want
+test_150bb() {
+ check_for_fallocate
- [ "$ost1_FSTYPE" != ldiskfs ] && skip "non-ldiskfs backend"
- [ $OST1_VERSION -lt $(version_code 2.13.50) ] &&
- skip "Need OST version at least 2.13.53"
+ touch $DIR/$tfile
+ stack_trap "rm -f $DIR/$tfile; wait_delete_completed"
+ dd if=/dev/urandom of=$DIR/$tfile bs=1M count=20 || error "dd failed"
+ > $DIR/$tfile
+ fallocate -l $((1048576 * 20)) $DIR/$tfile || error "fallocate failed"
+ # precomputed md5sum for 20MB of zeroes
+ local expect="8f4e33f3dc3e414ff94e5fb6905cba8c"
+ local sum=($(md5sum $DIR/$tfile))
- $LFS setstripe -c $OSTCOUNT -S1M $DIR/$tdir || error "setstripe failed"
- fallocate -l ${OSTCOUNT}m $DIR/$tdir || error "fallocate failed"
+ [[ "${sum[0]}" == "$expect" ]] || error "fallocate unwritten is not zero"
+
+ do_nodes $(comma_list $(osts_nodes)) \
+ "$LCTL set_param osd-ldiskfs.*.fallocate_zero_blocks=1" ||
+ error "set osd-ldiskfs.*.fallocate_zero_blocks=1"
+
+ > $DIR/$tfile
+ fallocate -l $((1048576 * 20)) $DIR/$tfile || error "fallocate failed"
+ sum=($(md5sum $DIR/$tfile))
+
+ [[ "${sum[0]}" == "$expect" ]] || error "fallocate zero is not zero"
+}
+run_test 150bb "Verify fallocate modes both zero space"
+
+test_150c() {
+ check_for_fallocate
+
+ stack_trap "rm -f $DIR/$tfile; wait_delete_completed"
+ $LFS setstripe -c $OSTCOUNT -S1M $DIR/$tfile || error "setstripe failed"
+ fallocate -l ${OSTCOUNT}m $DIR/$tfile || error "fallocate failed"
sync; sync_all_data
cancel_lru_locks $OSC
sleep 5
- bytes=$(($(stat -c '%b * %B' $DIR/$tdir)))
+ bytes=$(($(stat -c '%b * %B' $DIR/$tfile)))
want=$((OSTCOUNT * 1048576))
# Must allocate all requested space, not more than 5% extra
(( $bytes >= $want && $bytes < $want * 105 / 100 )) ||
error "bytes $bytes is not $want"
+
+ rm -f $DIR/$tfile
+ # verify fallocate on PFL file
+ $LFS setstripe -E1M -c1 -E16M -c3 -Eeof -c 4 $DIR/$tfile ||
+ error "Create $DIR/$tfile failed"
+ fallocate -l $((1048576 * 1024)) $DIR/$tfile ||
+ error "fallocate failed"
+ sync; sync_all_data
+ cancel_lru_locks $OSC
+ sleep 5
+ local bytes=$(($(stat -c '%b * %B' $DIR/$tfile)))
+ local want=$((1024 * 1048576))
+
+ # Must allocate all requested space, not more than 5% extra
+ (( $bytes >= $want && $bytes < $want * 105 / 100 )) ||
+ error "bytes $bytes is not $want"
}
run_test 150c "Verify fallocate Size and Blocks"
test_150d() {
- local bytes
- local want
-
- [ "$ost1_FSTYPE" != ldiskfs ] && skip "non-ldiskfs backend"
- [ $OST1_VERSION -lt $(version_code 2.13.50) ] &&
- skip "Need OST version at least 2.13.53"
+ check_for_fallocate
+ stack_trap "rm -f $DIR/$tfile; wait_delete_completed"
$LFS setstripe -c $OSTCOUNT -S1M $DIR/$tdir || error "setstripe failed"
fallocate -o 1G -l ${OSTCOUNT}m $DIR/$tdir || error "fallocate failed"
sync; sync_all_data
cancel_lru_locks $OSC
sleep 5
- bytes=$(($(stat -c '%b * %B' $DIR/$tdir)))
- want=$((OSTCOUNT * 1048576))
+ local bytes=$(($(stat -c '%b * %B' $DIR/$tdir)))
+ local want=$((OSTCOUNT * 1048576))
# Must allocate all requested space, not more than 5% extra
(( $bytes >= $want && $bytes < $want * 105 / 100 )) ||
run_test 150d "Verify fallocate Size and Blocks - Non zero start"
test_150e() {
- [ "$ost1_FSTYPE" != ldiskfs ] && skip "non-ldiskfs backend"
- [ $OST1_VERSION -ge $(version_code 2.13.55) ] ||
- skip "Need OST version at least 2.13.55"
+ check_for_fallocate
echo "df before:"
$LFS df
+ stack_trap "rm -f $DIR/$tfile; wait_delete_completed"
$LFS setstripe -c${OSTCOUNT} $DIR/$tfile ||
error "$LFS setstripe -c${OSTCOUNT} $DIR/$tfile failed"
min_size_ost=$($LFS df | awk "/$FSNAME-OST/ { print \$4 }" |
sort -un | head -1)
- # Get 90% of the available space
- local space=$(((min_size_ost * 90)/100 * OSTCOUNT))
+ # Get 100MB per OST of the available space to reduce run time
+ # else 60% of the available space if we are running SLOW tests
+ if [ $SLOW == "no" ]; then
+ local space=$((1024 * 100 * OSTCOUNT))
+ else
+ local space=$(((min_size_ost * 60)/100 * OSTCOUNT))
+ fi
fallocate -l${space}k $DIR/$tfile ||
error "fallocate ${space}k $DIR/$tfile failed"
echo "df after unlink:"
$LFS df
}
-run_test 150e "Verify 90% of available OST space consumed by fallocate"
+run_test 150e "Verify 60% of available OST space consumed by fallocate"
#LU-2902 roc_hit was not able to read all values from lproc
function roc_hit_init() {
(( $OST1_VERSION >= $(version_code 2.13.54) )) ||
skip "OFD access log unsupported"
- do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
setup_165
+ do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
sleep 5
do_facet ost1 ofd_access_log_reader --list
skip "OFD access log unsupported"
setup_165
+ do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
+ sleep 5
+
+ do_facet ost1 ofd_access_log_reader --list
lfs setstripe -c 1 -i 0 "${file}"
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
error "cannot create '${file}'"
- do_facet ost1 ofd_access_log_reader --list
- do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
sleep 5
do_facet ost1 killall -TERM ofd_access_log_reader
wait
fi
do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
+ sleep 5
+
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r524288c ||
error "cannot read '${file}'"
sleep 5
+
do_facet ost1 killall -TERM ofd_access_log_reader
wait
rc=$?
run_test 165b "ofd access log entries are produced and consumed"
test_165c() {
+ local trace="/tmp/${tfile}.trace"
local file="${DIR}/${tdir}/${tfile}"
(( $OST1_VERSION >= $(version_code 2.13.54) )) ||
test_mkdir "${DIR}/${tdir}"
setup_165
+ do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
+ sleep 5
lfs setstripe -c 1 -i 0 "${DIR}/${tdir}"
done
sync
- do_facet ost1 ofd_access_log_reader --list
+
+ do_facet ost1 killall -TERM ofd_access_log_reader
+ wait
+ rc=$?
+ if ((rc != 0)); then
+ error "ofd_access_log_reader exited with rc = '${rc}'"
+ fi
+
unlinkmany "${file}-%d" 128
}
run_test 165c "full ofd access logs do not block IOs"
-oal_peek_entry_count() {
- do_facet ost1 ofd_access_log_reader --list |
- awk '$1 == "_entry_count:" { print $2; }'
+oal_get_read_count() {
+ local stats="$1"
+
+ # STATS lustre-OST0001 alr_read_count 1
+
+ do_facet ost1 cat "${stats}" |
+ awk '$1 == "STATS" && $3 == "alr_read_count" { count = $4; }
+ END { print count; }'
}
-oal_expect_entry_count() {
- local entry_count=$(oal_peek_entry_count)
- local expect="$1"
+oal_expect_read_count() {
+ local stats="$1"
+ local count
+ local expect="$2"
- if ((entry_count == expect)); then
+ # Ask ofd_access_log_reader to write stats.
+ do_facet ost1 killall -USR1 ofd_access_log_reader
+
+ # Allow some time for things to happen.
+ sleep 1
+
+ count=$(oal_get_read_count "${stats}")
+ if ((count == expect)); then
return 0
fi
- error_noexit "bad entry count, got ${entry_count}, expected ${expect}"
- do_facet ost1 ofd_access_log_reader --list >&2
+ error_noexit "bad read count, got ${count}, expected ${expect}"
+ do_facet ost1 cat "${stats}" >&2
exit 1
}
test_165d() {
- local trace="/tmp/${tfile}.trace"
+ local stats="/tmp/${tfile}.stats"
local file="${DIR}/${tdir}/${tfile}"
local param="obdfilter.${FSNAME}-OST0000.access_log_mask"
- local entry_count
(( $OST1_VERSION >= $(version_code 2.13.54) )) ||
skip "OFD access log unsupported"
test_mkdir "${DIR}/${tdir}"
setup_165
+ do_facet ost1 ofd_access_log_reader --stats="${stats}" &
+ sleep 5
+
lfs setstripe -c 1 -i 0 "${file}"
do_facet ost1 lctl set_param "${param}=rw"
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
error "cannot create '${file}'"
- oal_expect_entry_count 1
+ oal_expect_read_count "${stats}" 1
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
error "cannot read '${file}'"
- oal_expect_entry_count 2
+ oal_expect_read_count "${stats}" 2
do_facet ost1 lctl set_param "${param}=r"
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
error "cannot create '${file}'"
- oal_expect_entry_count 2
+ oal_expect_read_count "${stats}" 2
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
error "cannot read '${file}'"
- oal_expect_entry_count 3
+ oal_expect_read_count "${stats}" 3
do_facet ost1 lctl set_param "${param}=w"
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
error "cannot create '${file}'"
- oal_expect_entry_count 4
+ oal_expect_read_count "${stats}" 4
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
error "cannot read '${file}'"
- oal_expect_entry_count 4
+ oal_expect_read_count "${stats}" 4
do_facet ost1 lctl set_param "${param}=0"
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
error "cannot create '${file}'"
- oal_expect_entry_count 4
+ oal_expect_read_count "${stats}" 4
$MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
error "cannot read '${file}'"
- oal_expect_entry_count 4
+ oal_expect_read_count "${stats}" 4
+
+ do_facet ost1 killall -TERM ofd_access_log_reader
+ wait
+ rc=$?
+ if ((rc != 0)); then
+ error "ofd_access_log_reader exited with rc = '${rc}'"
+ fi
}
run_test 165d "ofd_access_log mask works"
+test_165e() {
+ local stats="/tmp/${tfile}.stats"
+ local file0="${DIR}/${tdir}-0/${tfile}"
+ local file1="${DIR}/${tdir}-1/${tfile}"
+
+ (( $OST1_VERSION >= $(version_code 2.13.54) )) ||
+ skip "OFD access log unsupported"
+
+ [[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
+
+ test_mkdir -c 1 -i 0 "${DIR}/${tdir}-0"
+ test_mkdir -c 1 -i 1 "${DIR}/${tdir}-1"
+
+ lfs setstripe -c 1 -i 0 "${file0}"
+ lfs setstripe -c 1 -i 0 "${file1}"
+
+ setup_165
+ do_facet ost1 ofd_access_log_reader -I 1 --stats="${stats}" &
+ sleep 5
+
+ $MULTIOP "${file0}" oO_CREAT:O_WRONLY:w512c ||
+ error "cannot create '${file0}'"
+ sync
+ oal_expect_read_count "${stats}" 0
+
+ $MULTIOP "${file1}" oO_CREAT:O_WRONLY:w512c ||
+ error "cannot create '${file1}'"
+ sync
+ oal_expect_read_count "${stats}" 1
+
+ do_facet ost1 killall -TERM ofd_access_log_reader
+ wait
+ rc=$?
+ if ((rc != 0)); then
+ error "ofd_access_log_reader exited with rc = '${rc}'"
+ fi
+}
+run_test 165e "ofd_access_log MDT index filter works"
+
+test_165f() {
+ local trace="/tmp/${tfile}.trace"
+ local rc
+ local count
+
+ setup_165
+ do_facet ost1 timeout 60 ofd_access_log_reader \
+ --exit-on-close --debug=- --trace=- > "${trace}" &
+ sleep 5
+ stop ost1
+
+ wait
+ rc=$?
+
+ if ((rc != 0)); then
+ error_noexit "ofd_access_log_reader exited with rc = '${rc}'"
+ cat "${trace}"
+ exit 1
+ fi
+}
+run_test 165f "ofd_access_log_reader --exit-on-close works"
+
test_169() {
# do directio so as not to populate the page cache
log "creating a 10 Mb file"
verify_jobstats "touch $DIR/$tfile" $SINGLEMDS
fi
+ if lctl set_param jobid_var=USER jobid_name="S.%j.%e.%u.%H.E"; then
+ JOBENV="JOBCOMPLEX"
+ JOBCOMPLEX="S.$USER.touch.$(id -u).$(hostname -s).E"
+
+ verify_jobstats "touch $DIR/$tfile" $SINGLEMDS
+ fi
+
# test '%j' access to per-session jobid - if supported
if lctl list_param jobid_this_session > /dev/null 2>&1
then
}
run_test 398d "run aiocp to verify block size > stripe size"
+test_398e() {
+ dd if=/dev/zero of=$DIR/$tfile bs=1234 count=1
+ touch $DIR/$tfile.new
+ dd if=$DIR/$tfile of=$DIR/$tfile.new bs=1M count=1 oflag=direct
+}
+run_test 398e "O_Direct open cleared by fcntl doesn't cause hang"
+
test_fake_rw() {
local read_write=$1
if [ "$read_write" = "write" ]; then
[[ $offset == 1000000 ]] || error "offset $offset != 1000000"
printf "Seeking data from 1000000 ... "
lseek_test -d 1000000 $file && error "lseek should fail"
- # full first component, non-inited second one
+ rm $file
+
+ # full component followed by non-inited one
+ $LFS setstripe -E 1M -c2 -E eof $file
dd if=/dev/urandom of=$file bs=1M count=1
printf "Seeking hole from 1000000 ... "
offset=$(lseek_test -l 1000000 $file)
# init second component and truncate back
echo "123" >> $file
$TRUNCATE $file 1048576
- ls -lia $file
printf "Seeking hole from 1000000 ... "
offset=$(lseek_test -l 1000000 $file)
echo $offset
}
run_test 430c "lseek: external tools check"
+test_431() { # LU-14187
+ local file=$DIR/$tdir/$tfile
+
+ mkdir -p $DIR/$tdir
+ $LFS setstripe -c 1 -i 0 $file || error "lfs setstripe failed"
+ dd if=/dev/urandom of=$file bs=4k count=1
+ dd if=/dev/urandom of=$file bs=4k count=1 seek=10 conv=notrunc
+ dd if=/dev/urandom of=$file bs=4k count=1 seek=12 conv=notrunc
+ #define OBD_FAIL_OST_RESTART_IO 0x251
+ do_facet ost1 "$LCTL set_param fail_loc=0x251"
+ $LFS setstripe -c 1 -i 0 $file.0 || error "lfs setstripe failed"
+ cp $file $file.0
+ cancel_lru_locks
+ sync_all_data
+ echo 3 > /proc/sys/vm/drop_caches
+ diff $file $file.0 || error "data diff"
+}
+run_test 431 "Restart transaction for IO"
+
prep_801() {
[[ $MDS1_VERSION -lt $(version_code 2.9.55) ]] ||
[[ $OST1_VERSION -lt $(version_code 2.9.55) ]] &&
# open intent should update default EA size
# see mdc_update_max_ea_from_body()
# notice this is the very first RPC to MDS2
- cp /etc/services $DIR/$tdir/mds2 ||
- error "Failed to copy files to mds$n"
+ out=$(cp /etc/services $DIR/$tdir/mds2 2>&1)
+ ret=$?
+ echo $out
+ # With SSK, this situation can lead to -EPERM being returned.
+ # In that case, simply retry.
+ if [ $ret -ne 0 ] && $SHARED_KEY; then
+ if echo "$out" | grep -q "not permitted"; then
+ cp /etc/services $DIR/$tdir/mds2
+ ret=$?
+ fi
+ fi
+ [ $ret -eq 0 ] || error "Failed to copy files to mds$n"
}
run_test 820 "update max EA from open intent"