t32_wait_til_devices_gone() {
local node=$1
local devices
+ local loops
local i=0
echo wait for devices to go
while ((i < 20)); do
devices=$(do_rpc_nodes $node $LCTL device_list | wc -l)
- ((devices == 0)) && return 0
+ loops=$(do_rpc_nodes $node losetup -a | grep -c t32)
+ ((devices == 0 && loops == 0)) && return 0
sleep 5
i=$((i + 1))
done
- echo "waiting for devices on $node: Given up"
+ echo "waiting for dev on $node: dev $devices loop $loops given up"
+ do_rpc_nodes $node "losetup -a"
+ do_rpc_nodes $node "$LCTL devices_list"
return 1
}
$r $LCTL set_param debug="$PTLDEBUG"
$r $TUNEFS --dryrun $tmp/mdt || {
+ $r losetup -a
error_noexit "tunefs.lustre before mounting the MDT"
return 1
}
mopts=loop,writeconf
if [ $fstype == "ldiskfs" ]; then
$r $TUNEFS --quota $tmp/mdt || {
+ $r losetup -a
error_noexit "Enable mdt quota feature"
return 1
}
t32_wait_til_devices_gone $node
$r mount -t lustre -o $mopts $tmp/mdt $tmp/mnt/mdt || {
+ $r losetup -a
error_noexit "Mounting the MDT"
return 1
}
mopts=loop,mgsnode=$nid,$writeconf
if [ $fstype == "ldiskfs" ]; then
$r $TUNEFS --quota $tmp/ost || {
+ $r losetup -a
error_noexit "Enable ost quota feature"
return 1
}
# mount a second time to make sure we didnt leave upgrade flag on
$r $TUNEFS --dryrun $tmp/mdt || {
+ $r losetup -a
error_noexit "tunefs.lustre before remounting the MDT"
return 1
}