}
run_test 60 "check mkfs.lustre --mkfsoptions -E -O options setting"
+test_61() { # LU-2237
+ # Currently, the test is only valid for ldiskfs backend
+ [ "$FSTYPE" != "ldiskfs" ] && skip "non-ldiskfs backend" && return
+
+ local devname=$(mdsdevname ${SINGLEMDS//mds/})
+ local brpt=$(facet_mntpt brpt)
+ local opts=""
+
+ if ! do_facet $SINGLEMDS "test -b $devname"; then
+ opts="-o loop"
+ fi
+
+ stop_mds
+ local obj=$(do_facet $SINGLEMDS \
+ "$DEBUGFS -c -R \\\"stat last_rcvd\\\" $devname" |
+ grep Inode)
+ if [ -z "$obj" ]; then
+ # The MDT may be just re-formatted, mount the MDT for the
+ # first time to guarantee the "last_rcvd" file is there.
+ start_mds || error "fail to mount the MDS for the first time"
+ stop_mds
+ fi
+
+ # remove the "last_rcvd" file
+ do_facet $SINGLEMDS "mkdir -p $brpt"
+ do_facet $SINGLEMDS "mount -t $FSTYPE $opts $devname $brpt"
+ do_facet $SINGLEMDS "rm -f ${brpt}/last_rcvd"
+ do_facet $SINGLEMDS "umount $brpt"
+
+ # restart MDS, the "last_rcvd" file should be recreated.
+ start_mds || error "fail to restart the MDS"
+ obj=$(do_facet $SINGLEMDS \
+ "$DEBUGFS -c -R \\\"stat last_rcvd\\\" $devname" | grep Inode)
+ [ ! -z "$obj" ] || error "fail to re-create the last_rcvd"
+ stop_mds
+}
+run_test 61 "re-create the lost last_rcvd file when server mount"
+
if ! combined_mgs_mds ; then
stop mgs
fi