Skip to content
Snippets Groups Projects
Commit 7209244f authored by Elena Gryaznova's avatar Elena Gryaznova
Browse files

b=16551

i=Adilger
fix for remote [mds|ost] with nodsh
parent 5e227cbf
No related branches found
No related tags found
No related merge requests found
...@@ -898,24 +898,25 @@ reset_enospc() { ...@@ -898,24 +898,25 @@ reset_enospc() {
[ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0 [ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0
mkdir -p $DIR/d27/nospc mkdir -p $DIR/d27/nospc
rmdir $DIR/d27/nospc rmdir $DIR/d27/nospc
lctl set_param fail_loc=$FAIL_LOC do_nodes $(comma_list $(osts_nodes)) lctl set_param fail_loc=$FAIL_LOC
} }
exhaust_precreations() { exhaust_precreations() {
OSTIDX=$1 OSTIDX=$1
OST=$(lctl get_param -n lov.${LOVNAME}.target_obd | grep ${OSTIDX}": " | \
OST=$(lfs osts | grep ${OSTIDX}": " | \
awk '{print $2}' | sed -e 's/_UUID$//') awk '{print $2}' | sed -e 's/_UUID$//')
# on the mdt's osc # on the mdt's osc
last_id=$(lctl get_param -n osc.${OST}-osc.prealloc_last_id) last_id=$(do_facet mds lctl get_param -n osc.${OST}-osc.prealloc_last_id)
next_id=$(lctl get_param -n osc.${OST}-osc.prealloc_next_id) next_id=$(do_facet mds lctl get_param -n osc.${OST}-osc.prealloc_next_id)
mkdir -p $DIR/d27/${OST} mkdir -p $DIR/d27/${OST}
$SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1 $SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1
#define OBD_FAIL_OST_ENOSPC 0x215 #define OBD_FAIL_OST_ENOSPC 0x215
lctl set_param fail_loc=0x215 do_facet ost$((OSTIDX + 1)) lctl set_param fail_loc=0x215
echo "Creating to objid $last_id on ost $OST..." echo "Creating to objid $last_id on ost $OST..."
createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2)) createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2))
lctl get_param -n osc.${OST}-osc.prealloc* | grep '[0-9]' do_facet mds "lctl get_param -n osc.${OST}-osc.prealloc*" | grep '[0-9]'
reset_enospc $2 reset_enospc $2
} }
...@@ -929,7 +930,8 @@ exhaust_all_precreations() { ...@@ -929,7 +930,8 @@ exhaust_all_precreations() {
test_27n() { test_27n() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc reset_enospc
rm -f $DIR/d27/f27n rm -f $DIR/d27/f27n
...@@ -943,7 +945,8 @@ run_test 27n "create file with some full OSTs ==================" ...@@ -943,7 +945,8 @@ run_test 27n "create file with some full OSTs =================="
test_27o() { test_27o() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc reset_enospc
rm -f $DIR/d27/f27o rm -f $DIR/d27/f27o
...@@ -958,7 +961,8 @@ run_test 27o "create file with all full OSTs (should error) ====" ...@@ -958,7 +961,8 @@ run_test 27o "create file with all full OSTs (should error) ===="
test_27p() { test_27p() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc reset_enospc
rm -f $DIR/d27/f27p rm -f $DIR/d27/f27p
...@@ -977,7 +981,8 @@ run_test 27p "append to a truncated file with some full OSTs ===" ...@@ -977,7 +981,8 @@ run_test 27p "append to a truncated file with some full OSTs ==="
test_27q() { test_27q() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc reset_enospc
rm -f $DIR/d27/f27q rm -f $DIR/d27/f27q
...@@ -997,7 +1002,8 @@ run_test 27q "append to truncated file with all OSTs full (should error) ===" ...@@ -997,7 +1002,8 @@ run_test 27q "append to truncated file with all OSTs full (should error) ==="
test_27r() { test_27r() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc reset_enospc
rm -f $DIR/d27/f27r rm -f $DIR/d27/f27r
...@@ -1028,7 +1034,7 @@ run_test 27t "check that utils parse path correctly" ...@@ -1028,7 +1034,7 @@ run_test 27t "check that utils parse path correctly"
test_27u() { # bug 4900 test_27u() { # bug 4900
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
#define OBD_FAIL_MDS_OSC_PRECREATE 0x139 #define OBD_FAIL_MDS_OSC_PRECREATE 0x139
...@@ -1048,7 +1054,8 @@ run_test 27u "skip object creation on OSC w/o objects ==========" ...@@ -1048,7 +1054,8 @@ run_test 27u "skip object creation on OSC w/o objects =========="
test_27v() { # bug 4900 test_27v() { # bug 4900
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
exhaust_all_precreations exhaust_all_precreations
...@@ -1566,10 +1573,12 @@ test_36f() { ...@@ -1566,10 +1573,12 @@ test_36f() {
run_test 36f "utime on file racing with OST BRW write ==========" run_test 36f "utime on file racing with OST BRW write =========="
test_36g() { test_36g() {
remote_ost && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
mkdir -p $DIR/$tdir
export FMD_MAX_AGE=`do_facet ost1 lctl get_param -n obdfilter.*.client_cache_seconds 2> /dev/null | head -n 1` export FMD_MAX_AGE=`do_facet ost1 lctl get_param -n obdfilter.*.client_cache_seconds 2> /dev/null | head -n 1`
FMD_BEFORE="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`" FMD_BEFORE="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
touch $DIR/d36/$tfile touch $DIR/$tdir/$tfile
sleep $((FMD_MAX_AGE + 12)) sleep $((FMD_MAX_AGE + 12))
FMD_AFTER="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`" FMD_AFTER="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
[ "$FMD_AFTER" -gt "$FMD_BEFORE" ] && \ [ "$FMD_AFTER" -gt "$FMD_BEFORE" ] && \
...@@ -2225,13 +2234,21 @@ test_52c() { # 12848 simulating client < 1.4.7 ...@@ -2225,13 +2234,21 @@ test_52c() { # 12848 simulating client < 1.4.7
run_test 52c "immutable flag test for client < 1.4.7 =======" run_test 52c "immutable flag test for client < 1.4.7 ======="
test_53() { test_53() {
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
remote_ost_nodsh && skip "remote OST with nodsh" && return
for VALUE in `lctl get_param osc.*-osc.prealloc_last_id`; do
local param
local ostname
local mds_last
local ost_last
local ostnum
for VALUE in $(do_facet mds lctl get_param osc.*-osc.prealloc_last_id); do
param=`echo ${VALUE[0]} | cut -d "=" -f1`; param=`echo ${VALUE[0]} | cut -d "=" -f1`;
ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2` ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2`
mds_last=`lctl get_param -n $param` mds_last=$(do_facet mds lctl get_param -n $param)
ost_last=`lctl get_param -n obdfilter.$ostname.last_id` ostnum=$(echo $ostname | sed 's/lustre-OST//g' | awk '{print ($1+0)}' )
ost_last=$(do_facet ost$ostnum lctl get_param -n obdfilter.$ostname.last_id)
echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last" echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
if [ $ost_last != $mds_last ]; then if [ $ost_last != $mds_last ]; then
error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last" error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
...@@ -2580,12 +2597,13 @@ test_56q() { ...@@ -2580,12 +2597,13 @@ test_56q() {
run_test 56q "check lfs find -gid and ! -gid ===============================" run_test 56q "check lfs find -gid and ! -gid ==============================="
test_57a() { test_57a() {
remote_mds && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
local MNTDEV="mds.*.mntdev" local MNTDEV="mds.*.mntdev"
DEV=$(lctl get_param -n $MNTDEV) DEV=$(do_facet mds lctl get_param -n $MNTDEV)
[ -z "$DEV" ] && error "can't access $MNTDEV" [ -z "$DEV" ] && error "can't access $MNTDEV"
for DEV in `lctl get_param -n $MNTDEV`; do for DEV in $(do_facet mds lctl get_param -n $MNTDEV); do
dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV" do_facet mds dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV"
DEVISIZE=`awk '/Inode size:/ { print $3 }' $TMP/t57a.dump` DEVISIZE=`awk '/Inode size:/ { print $3 }' $TMP/t57a.dump`
[ "$DEVISIZE" -gt 128 ] || error "inode size $DEVISIZE" [ "$DEVISIZE" -gt 128 ] || error "inode size $DEVISIZE"
rm $TMP/t57a.dump rm $TMP/t57a.dump
...@@ -2864,7 +2882,7 @@ run_test 65j "set default striping on root directory (bug 6367)=" ...@@ -2864,7 +2882,7 @@ run_test 65j "set default striping on root directory (bug 6367)="
test_65k() { # bug11679 test_65k() { # bug11679
[ "$OSTCOUNT" -lt 2 ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt 2 ] && skip "too few OSTs" && return
remote_mds_nodsh && skip "remote MDS" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return
echo "Check OST status: " echo "Check OST status: "
MDS_OSCS=`do_facet mds lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'` MDS_OSCS=`do_facet mds lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'`
...@@ -3025,30 +3043,29 @@ run_test 68 "support swapping to Lustre ========================" ...@@ -3025,30 +3043,29 @@ run_test 68 "support swapping to Lustre ========================"
# bug5265, obdfilter oa2dentry return -ENOENT # bug5265, obdfilter oa2dentry return -ENOENT
# #define OBD_FAIL_OST_ENOENT 0x217 # #define OBD_FAIL_OST_ENOENT 0x217
test_69() { test_69() {
[ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] && remote_ost_nodsh && skip "remote OST with nodsh" && return
skip "skipping test for remote OST" && return
f="$DIR/$tfile" f="$DIR/$tfile"
touch $f $SETSTRIPE $f -c 1 -i 0
$DIRECTIO write ${f}.2 0 1 || error "directio write error" $DIRECTIO write ${f}.2 0 1 || error "directio write error"
#define OBD_FAIL_OST_ENOENT 0x217 #define OBD_FAIL_OST_ENOENT 0x217
lctl set_param fail_loc=0x217 do_facet ost1 lctl set_param fail_loc=0x217
truncate $f 1 # vmtruncate() will ignore truncate() error. truncate $f 1 # vmtruncate() will ignore truncate() error.
$DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT" $DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT"
lctl set_param fail_loc=0 do_facet ost1 lctl set_param fail_loc=0
$DIRECTIO write $f 0 2 || error "write error" $DIRECTIO write $f 0 2 || error "write error"
cancel_lru_locks osc cancel_lru_locks osc
$DIRECTIO read $f 0 1 || error "read error" $DIRECTIO read $f 0 1 || error "read error"
#define OBD_FAIL_OST_ENOENT 0x217 #define OBD_FAIL_OST_ENOENT 0x217
lctl set_param fail_loc=0x217 do_facet ost1 lctl set_param fail_loc=0x217
$DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT" $DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT"
lctl set_param fail_loc=0 do_facet ost1 lctl set_param fail_loc=0
rm -f $f rm -f $f
} }
run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======" run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======"
...@@ -3371,29 +3388,31 @@ test_77f() { # bug 10889 ...@@ -3371,29 +3388,31 @@ test_77f() { # bug 10889
run_test 77f "repeat checksum error on write (expect error) ====" run_test 77f "repeat checksum error on write (expect error) ===="
test_77g() { # bug 10889 test_77g() { # bug 10889
[ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] && \ remote_ost_nodsh && skip "remote OST with nodsh" && return
skip "remote OST" && return
[ ! -f $F77_TMP ] && setup_f77 [ ! -f $F77_TMP ] && setup_f77
$SETSTRIPE $DIR/f77g -c 1 -i 0
#define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a #define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a
lctl set_param fail_loc=0x8000021a do_facet ost1 lctl set_param fail_loc=0x8000021a
set_checksums 1 set_checksums 1
dd if=$F77_TMP of=$DIR/f77g bs=1M count=$F77SZ || \ dd if=$F77_TMP of=$DIR/f77g bs=1M count=$F77SZ || \
error "write error: rc=$?" error "write error: rc=$?"
lctl set_param fail_loc=0 do_facet ost1 lctl set_param fail_loc=0
set_checksums 0 set_checksums 0
} }
run_test 77g "checksum error on OST write ======================" run_test 77g "checksum error on OST write ======================"
test_77h() { # bug 10889 test_77h() { # bug 10889
[ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] && \ remote_ost_nodsh && skip "remote OST with nodsh" && return
skip "remote OST" && return
[ ! -f $DIR/f77g ] && skip "requires 77g - skipping" && return [ ! -f $DIR/f77g ] && skip "requires 77g - skipping" && return
cancel_lru_locks osc cancel_lru_locks osc
#define OBD_FAIL_OST_CHECKSUM_SEND 0x21b #define OBD_FAIL_OST_CHECKSUM_SEND 0x21b
lctl set_param fail_loc=0x8000021b do_facet ost1 lctl set_param fail_loc=0x8000021b
set_checksums 1 set_checksums 1
cmp $F77_TMP $DIR/f77g || error "file compare failed" cmp $F77_TMP $DIR/f77g || error "file compare failed"
lctl set_param fail_loc=0 do_facet ost1 lctl set_param fail_loc=0
set_checksums 0 set_checksums 0
} }
run_test 77h "checksum error on OST read =======================" run_test 77h "checksum error on OST read ======================="
...@@ -3465,17 +3484,11 @@ test_78() { # bug 10901 ...@@ -3465,17 +3484,11 @@ test_78() { # bug 10901
run_test 78 "handle large O_DIRECT writes correctly ============" run_test 78 "handle large O_DIRECT writes correctly ============"
test_79() { # bug 12743 test_79() { # bug 12743
[ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] &&
skip "skipping test for remote OST" && return
wait_delete_completed wait_delete_completed
BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | BKTOTAL=$(calc_osc_kbytes kbytestotal)
awk 'BEGIN{total=0}; {total+=$1}; END{print total}'` BKFREE=$(calc_osc_kbytes kbytesfree)
BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | BKAVAIL=$(calc_osc_kbytes kbytesavail)
awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail |
awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
STRING=`df -P $MOUNT | tail -n 1 | awk '{print $2","$3","$4}'` STRING=`df -P $MOUNT | tail -n 1 | awk '{print $2","$3","$4}'`
DFTOTAL=`echo $STRING | cut -d, -f1` DFTOTAL=`echo $STRING | cut -d, -f1`
DFUSED=`echo $STRING | cut -d, -f2` DFUSED=`echo $STRING | cut -d, -f2`
...@@ -4232,7 +4245,6 @@ free_min_max () { ...@@ -4232,7 +4245,6 @@ free_min_max () {
test_116() { test_116() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return [ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
remote_mds && skip "remote MDS" && return
echo -n "Free space priority " echo -n "Free space priority "
lctl get_param -n lov.*.qos_prio_free lctl get_param -n lov.*.qos_prio_free
...@@ -4361,7 +4373,7 @@ run_test 118a "verify O_SYNC works ==========" ...@@ -4361,7 +4373,7 @@ run_test 118a "verify O_SYNC works =========="
test_118b() test_118b()
{ {
remote_ost_nodsh && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async reset_async
...@@ -4396,7 +4408,7 @@ run_test 118b "Reclaim dirty pages on fatal error ==========" ...@@ -4396,7 +4408,7 @@ run_test 118b "Reclaim dirty pages on fatal error =========="
test_118c() test_118c()
{ {
remote_ost_nodsh && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async reset_async
...@@ -4438,7 +4450,7 @@ run_test 118c "Fsync blocks on EROFS until dirty pages are flushed ==========" ...@@ -4438,7 +4450,7 @@ run_test 118c "Fsync blocks on EROFS until dirty pages are flushed =========="
test_118d() test_118d()
{ {
remote_ost_nodsh && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async reset_async
...@@ -4542,7 +4554,7 @@ test_118g() { ...@@ -4542,7 +4554,7 @@ test_118g() {
run_test 118g "Don't stay in wait if we got local -ENOMEM ==========" run_test 118g "Don't stay in wait if we got local -ENOMEM =========="
test_118h() { test_118h() {
remote_ost_nodsh && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async reset_async
...@@ -4576,7 +4588,7 @@ test_118h() { ...@@ -4576,7 +4588,7 @@ test_118h() {
run_test 118h "Verify timeout in handling recoverables errors ==========" run_test 118h "Verify timeout in handling recoverables errors =========="
test_118i() { test_118i() {
remote_ost_nodsh && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async reset_async
...@@ -4614,7 +4626,7 @@ test_118i() { ...@@ -4614,7 +4626,7 @@ test_118i() {
run_test 118i "Fix error before timeout in recoverable error ==========" run_test 118i "Fix error before timeout in recoverable error =========="
test_118j() { test_118j() {
remote_ost_nodsh && skip "remote OST" && return remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async reset_async
...@@ -4650,6 +4662,8 @@ run_test 118j "Simulate unrecoverable OST side error ==========" ...@@ -4650,6 +4662,8 @@ run_test 118j "Simulate unrecoverable OST side error =========="
test_118k() test_118k()
{ {
remote_ost_nodsh && skip "remote OSTs with nodsh" && return
#define OBD_FAIL_OST_BRW_WRITE_BULK 0x20e #define OBD_FAIL_OST_BRW_WRITE_BULK 0x20e
set_nodes_failloc "$(osts_nodes)" 0x20e set_nodes_failloc "$(osts_nodes)" 0x20e
mkdir -p $DIR/$tdir mkdir -p $DIR/$tdir
...@@ -5209,6 +5223,7 @@ run_test 128 "interactive lfs for 2 consecutive find's" ...@@ -5209,6 +5223,7 @@ run_test 128 "interactive lfs for 2 consecutive find's"
test_129() { test_129() {
[ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return 0 [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return 0
remote_mds_nodsh && skip "remote MDS with nodsh" && return
DEV=$(basename $(do_facet mds lctl get_param -n mds.*.mntdev)) DEV=$(basename $(do_facet mds lctl get_param -n mds.*.mntdev))
[ -z "$DEV" ] && error "can't access mds mntdev" [ -z "$DEV" ] && error "can't access mds mntdev"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment