ONLY=${ONLY:-"$*"}
-# bug number for skipped test: LU-7005
-ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT 50i"
+# bug number for skipped test:
+ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
is_sles11() # LU-2181
}
umount_client() {
- local MOUNTPATH=$1
- echo "umount lustre on ${MOUNTPATH}....."
- zconf_umount $(hostname) $MOUNTPATH || return 97
+ local mountpath=$1
+ shift
+ echo "umount lustre on $mountpath....."
+ zconf_umount $HOSTNAME $mountpath $@ || return 97
}
manual_umount_client(){
local rc
local FORCE=$1
echo "manual umount lustre on ${MOUNT}...."
- do_facet client "umount -d ${FORCE} $MOUNT"
+ do_facet client "umount ${FORCE} $MOUNT"
rc=$?
return $rc
}
setup
touch $DIR/$tfile || error "touch $DIR/$tfile failed"
stop_ost || error "Unable to stop OST1"
- cleanup
+ umount_client $MOUNT -f || error “unmount $MOUNT failed”
+ cleanup_nocli
eno=$?
# ok for ost to fail shutdown
if [ 202 -ne $eno ] && [ 0 -ne $eno ]; then
# cleanup may return an error from the failed
# disconnects; for now I'll consider this successful
# if all the modules have unloaded.
- umount -d $MOUNT &
+ $UMOUNT -f $MOUNT &
UMOUNT_PID=$!
sleep 6
echo "killing umount"
start_mds || error "MDS start failed"
stop_ost || error "Unable to stop OST1"
mount_client $MOUNT || error "mount_client $MOUNT failed"
- cleanup || error "cleanup_nocli failed with $?"
+ umount_client $MOUNT -f || error "umount_client $MOUNT failed"
+ cleanup_nocli || error "cleanup_nocli failed with $?"
grep " $MOUNT " /etc/mtab &&
error "$MOUNT entry in mtab after unmount"
pass
# check_mount will block trying to contact ost
mcreate $DIR/$tfile || error "mcreate $DIR/$tfile failed"
rm -f $DIR/$tfile || error "remove $DIR/$tfile failed"
- umount_client $MOUNT
+ umount_client $MOUNT -f
pass
echo "Client mount with a running ost"
umount $tmp/mnt/lustre || rc=$?
fi
if $shall_cleanup_mdt; then
- $r umount -d $tmp/mnt/mdt || rc=$?
+ $r $UMOUNT $tmp/mnt/mdt || rc=$?
fi
if $shall_cleanup_mdt1; then
- $r umount -d $tmp/mnt/mdt1 || rc=$?
+ $r $UMOUNT $tmp/mnt/mdt1 || rc=$?
fi
if $shall_cleanup_ost; then
- $r umount -d $tmp/mnt/ost || rc=$?
+ $r $UMOUNT $tmp/mnt/ost || rc=$?
fi
$r rm -rf $tmp
$r $MOUNT_CMD -o $mopts $mdt_dev $tmp/mnt/mdt
$r $LCTL replace_nids $fsname-OST0000 $ostnid
$r $LCTL replace_nids $fsname-MDT0000 $nid
- $r umount -d $tmp/mnt/mdt
+ $r $UMOUNT $tmp/mnt/mdt
fi
mopts=exclude=$fsname-OST0000
shall_cleanup_lustre=false
else
if [ "$dne_upgrade" != "no" ]; then
- $r umount -d $tmp/mnt/mdt1 || {
+ $r $UMOUNT $tmp/mnt/mdt1 || {
error_noexit "Unmounting the MDT2"
return 1
}
shall_cleanup_mdt1=false
fi
- $r umount -d $tmp/mnt/mdt || {
+ $r $UMOUNT $tmp/mnt/mdt || {
error_noexit "Unmounting the MDT"
return 1
}
shall_cleanup_mdt=false
- $r umount -d $tmp/mnt/ost || {
+ $r $UMOUNT $tmp/mnt/ost || {
error_noexit "Unmounting the OST"
return 1
}
cp /etc/hosts $MOUNT2/ || error "copy /etc/hosts $MOUNT2/ failed"
$GETSTRIPE $MOUNT2/hosts || error "$GETSTRIPE $MOUNT2/hosts failed"
- umount -d $MOUNT2
+ umount $MOUNT2
stop fs2ost -f
stop fs2mds -f
cleanup_nocli || error "cleanup_nocli failed with $?"
rc=3
fi
- umount -d $MOUNT2
+ $UMOUNT $MOUNT2
stop fs3ost -f || error "unable to stop OST3"
stop fs2ost -f || error "unable to stop OST2"
stop fs2mds -f || error "unable to stop second MDS"
echo mount_op=$mount_op
- do_facet $SINGLEMDS "umount -d $mntpt && rm -f $mdsdev_sym"
+ do_facet $SINGLEMDS "$UMOUNT $mntpt && rm -f $mdsdev_sym"
if $(echo $mount_op | grep -q "unable to set tunable"); then
error "set tunables failed for symlink device"
stop_ost2 || error "Unable to stop OST2"
fi
- umount_client $MOUNT || error "Unable to unmount client"
+ umount_client $MOUNT -f || error "Unable to unmount client"
stop_ost || error "Unable to stop OST1"
stop_mds || error "Unable to stop MDS"
#writeconf to remove all ost2 traces for subsequent tests
"$TEST" "${FSNAME}-MDT0001.mdc.active" 1 ||
error "Unable to activate MDT2"
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} mds2 FULL
+ if [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.60) ]
+ then
+ wait_dne_interconnect
+ fi
$LFS mkdir -i1 $DIR/$tdir/2 || error "mkdir $DIR/$tdir/2 failed"
# create some file
createmany -o $DIR/$tdir/2/$tfile-%d 1 || error "create files failed"
start_ost2 || error "Unable to start OST1"
wait $pid
stop_ost2 || error "Unable to stop OST1"
- cleanup || error "cleanup failed with $?"
+ umount_client $MOUNT -f || error “unmount $MOUNT failed”
+ cleanup_nocli || error “stop server failed”
#writeconf to remove all ost2 traces for subsequent tests
writeconf_or_reformat
}
local large_value="$(generate_string $(max_xattr_size))"
local small_value="bar"
- local name="trusted.big"
- log "save large xattr $name on $file"
- setfattr -n $name -v $large_value $file ||
- error "saving $name on $file failed"
+ local name="trusted.big"
+ log "save large xattr $name on $file"
+ setfattr -n $name -v $large_value $file ||
+ error "saving $name on $file failed"
- local new_value=$(get_xattr_value $name $file)
- [[ "$new_value" != "$large_value" ]] &&
- error "$name different after saving"
+ local new_value=$(get_xattr_value $name $file)
+ [[ "$new_value" != "$large_value" ]] &&
+ error "$name different after saving"
- log "shrink value of $name on $file"
- setfattr -n $name -v $small_value $file ||
- error "shrinking value of $name on $file failed"
+ log "shrink value of $name on $file"
+ setfattr -n $name -v $small_value $file ||
+ error "shrinking value of $name on $file failed"
- new_value=$(get_xattr_value $name $file)
- [[ "$new_value" != "$small_value" ]] &&
- error "$name different after shrinking"
+ new_value=$(get_xattr_value $name $file)
+ [[ "$new_value" != "$small_value" ]] &&
+ error "$name different after shrinking"
- log "grow value of $name on $file"
- setfattr -n $name -v $large_value $file ||
- error "growing value of $name on $file failed"
+ log "grow value of $name on $file"
+ setfattr -n $name -v $large_value $file ||
+ error "growing value of $name on $file failed"
- new_value=$(get_xattr_value $name $file)
- [[ "$new_value" != "$large_value" ]] &&
- error "$name different after growing"
+ new_value=$(get_xattr_value $name $file)
+ [[ "$new_value" != "$large_value" ]] &&
+ error "$name different after growing"
- log "check value of $name on $file after remounting MDS"
- fail $SINGLEMDS
- new_value=$(get_xattr_value $name $file)
- [[ "$new_value" != "$large_value" ]] &&
- error "$name different after remounting MDS"
+ log "check value of $name on $file after remounting MDS"
+ fail $SINGLEMDS
+ new_value=$(get_xattr_value $name $file)
+ [[ "$new_value" != "$large_value" ]] &&
+ error "$name different after remounting MDS"
- log "remove large xattr $name from $file"
- setfattr -x $name $file || error "removing $name from $file failed"
+ log "remove large xattr $name from $file"
+ setfattr -x $name $file || error "removing $name from $file failed"
- rm -f $file
- stopall
+ if $lxattr; then
+ stopall || error "stopping for e2fsck run"
+ for num in $(seq $MDSCOUNT); do
+ run_e2fsck $(facet_active_host mds$num) \
+ $(mdsdevname $num) "-y" ||
+ error "e2fsck MDT$num failed"
+ done
+ setup_noconfig || error "remounting the filesystem failed"
+ fi
+
+ # need to delete this file to avoid problems in other tests
+ rm -f $file
+ stopall || error "stopping systems to turn off large_xattr"
if $lxattr; then
for num in $(seq $MDSCOUNT); do
do_facet mds${num} $TUNE2FS -O ^large_xattr \
stop_ost2 || error "Unable to stop second ost"
echo "$LFS df"
$LFS df --lazy || error "lfs df failed"
- cleanup || error "cleanup failed with $?"
+ umount_client $MOUNT -f || error “unmount $MOUNT failed”
+ cleanup_nocli || error "cleanup_nocli failed with $?"
#writeconf to remove all ost2 traces for subsequent tests
writeconf_or_reformat
}
do_facet $SINGLEMDS \
"mount -t $(facet_fstype $SINGLEMDS) $opts $devname $brpt"
do_facet $SINGLEMDS "rm -f ${brpt}/last_rcvd"
- do_facet $SINGLEMDS "umount -d $brpt"
+ do_facet $SINGLEMDS "$UMOUNT $brpt"
# restart MDS, the "last_rcvd" file should be recreated.
start_mds || error "fail to restart the MDS"
#define OBD_FAIL_TGT_REPLAY_DELAY 0x709 | FAIL_SKIP
do_facet $SINGLEMDS "lctl set_param fail_loc=0x20000709 fail_val=5"
- facet_failover $SINGLEMDS || error "failover: $?"
+ facet_failover --fsck $SINGLEMDS || error "failover: $?"
client_up
echo "recovery status"
for i in $(seq $((mmr - 1))); do
chmod 0600 $dir/file-$i &
done
+ sleep 1
# send one additional modify RPC
do_facet $facet "$LCTL set_param fail_loc=0"
for i in $(seq $mmr); do
chmod 0666 $dir/file-$i &
done
+ sleep 1
# send one additional modify RPC
do_facet $facet "$LCTL set_param fail_loc=0"
# check this additional modify RPC blocked getting a modify RPC slot
checkstat -vp 0644 $dir/file-$((mmr + 1)) ||
- error "Unexpectedly send $mmr modify RPCs in parallel"
+ error "Unexpectedly send $(($mmr + 1)) modify RPCs in parallel"
wait
}
}
run_test 90d "check one close RPC is allowed above max_mod_rpcs_in_flight"
+check_uuid_on_ost() {
+ local nid=$1
+ do_facet ost1 "$LCTL get_param obdfilter.${FSNAME}*.exports.'$nid'.uuid"
+}
+
+check_uuid_on_mdt() {
+ local nid=$1
+ do_facet $SINGLEMDS "$LCTL get_param mdt.${FSNAME}*.exports.'$nid'.uuid"
+}
+
+test_91() {
+ local uuid
+ local nid
+ local found
+
+ load_modules
+
+ [[ $(lustre_version_code ost1) -ge $(version_code 2.7.63) ]] ||
+ { skip "Need OST version at least 2.7.63" && return 0; }
+ [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.63) ]] ||
+ { skip "Need MDT version at least 2.7.63" && return 0; }
+
+ start_mds || error "MDS start failed"
+ start_ost || error "unable to start OST"
+ mount_client $MOUNT || error "client start failed"
+ check_mount || error "check_mount failed"
+
+ if remote_mds; then
+ nid=$($LCTL list_nids | head -1 | sed "s/\./\\\./g")
+ else
+ nid="0@lo"
+ fi
+ uuid=$(get_client_uuid $MOUNT)
+
+ echo "list nids on mdt:"
+ do_facet $SINGLEMDS "$LCTL list_param mdt.${FSNAME}*.exports.*"
+ echo "uuid from $nid:"
+ do_facet $SINGLEMDS "$LCTL get_param mdt.${FSNAME}*.exports.'$nid'.uuid"
+
+ found=$(check_uuid_on_mdt $nid | grep $uuid)
+ [ -z "$found" ] && error "can't find $uuid $nid on MDT"
+ found=$(check_uuid_on_ost $nid | grep $uuid)
+ [ -z "$found" ] && error "can't find $uuid $nid on OST"
+
+ # umount the client so it won't reconnect
+ manual_umount_client --force || error "failed to umount $?"
+ # shouldn't disappear on MDS after forced umount
+ found=$(check_uuid_on_mdt $nid | grep $uuid)
+ [ -z "$found" ] && error "can't find $uuid $nid"
+
+ echo "evict $nid"
+ do_facet $SINGLEMDS \
+ "$LCTL set_param -n mdt.${mds1_svc}.evict_client nid:$nid"
+
+ found=$(check_uuid_on_mdt $nid | grep $uuid)
+ [ -n "$found" ] && error "found $uuid $nid on MDT"
+ found=$(check_uuid_on_ost $nid | grep $uuid)
+ [ -n "$found" ] && error "found $uuid $nid on OST"
+
+ # check it didn't reconnect (being umounted)
+ sleep $((TIMEOUT+1))
+ found=$(check_uuid_on_mdt $nid | grep $uuid)
+ [ -n "$found" ] && error "found $uuid $nid on MDT"
+ found=$(check_uuid_on_ost $nid | grep $uuid)
+ [ -n "$found" ] && error "found $uuid $nid on OST"
+
+ cleanup
+}
+run_test 91 "evict-by-nid support"
+
if ! combined_mgs_mds ; then
stop mgs
fi