This adds support to "check" zfs and run llrevfs against zfs backed
nodes. This fixes some regressions added by LU-3264, specifically
that the stop function also exports the zfs pool.
The zfs "check" is really a non-entity since there is no functional
zfs fsck at this time.
Test-Parameters: mdsfilesystemtype=zfs mdtfilesystemtype=zfs ostfilesystemtype=zfs testlist=large-lun ostcount=2 envdefinitions=SLOW=yes
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Idc35d35152f1cbdc4afe6a0f627a5c1ba40b3faf
Reviewed-on: http://review.whamcloud.com/7395
Tested-by: Jenkins
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
[[ $SLOW = yes ]] && FULL_MODE=true
#########################################################################
# Dump the super block information for the filesystem present on device.
[[ $SLOW = yes ]] && FULL_MODE=true
#########################################################################
# Dump the super block information for the filesystem present on device.
local facet=$1
local dev=$2
local facet=$1
local dev=$2
log "dump the super block information on $facet device $dev"
log "dump the super block information on $facet device $dev"
- local cmd="$DUMPE2FS -h $dev"
+ local fstype=$(facet_fstype $facet)
+
+ case $fstype in
+ ldiskfs )
+ cmd="$DUMPE2FS -h $dev" ;;
+ zfs )
+ cmd="$ZDB -l $(facet_vdevice $facet)" ;;
+ * )
+ error "unknown fstype!" ;;
+ esac
+
+check_fsfacet() {
+ local facet=$1
+ local fstype=$(facet_fstype $facet)
+
+ case $fstype in
+ ldiskfs)
+ run_e2fsck $(facet_active_host $facet) $(facet_device $facet) \
+ "-y" || error "run e2fsck error"
+ ;;
+ zfs)
+ # Could call fsck.zfs, but currently it does nothing,
+ # Could also call zpool scrub, but that could take a LONG time
+ # do_facet $facet "fsck.zfs $(facet_device $facet)"
+ ;;
+ esac
+}
+
# Run e2fsck on MDS and OST
do_fsck() {
$RUN_FSCK || return
# Run e2fsck on MDS and OST
do_fsck() {
$RUN_FSCK || return
- local dev
- run_e2fsck $(facet_host $SINGLEMDS) $(mdsdevname ${SINGLEMDS//mds/}) \
- "-y" || error "run e2fsck error"
+
+ check_fsfacet $SINGLEMDS
+
for num in $(seq $OSTCOUNT); do
for num in $(seq $OSTCOUNT); do
- dev=$(ostdevname $num)
- run_e2fsck $(facet_host ost${num}) $dev "-y" ||
- error "run e2fsck error"
+ check_fsfacet ost${num}
done
}
################################## Main Flow ###################################
trap cleanupall EXIT
test_1 () {
done
}
################################## Main Flow ###################################
trap cleanupall EXIT
test_1 () {
+ [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
+ skip "Only applicable to ldiskfs-based nodes" && return
local dev
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
local dev
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
test_2 () {
local dev
local ostmnt
test_2 () {
local dev
local ostmnt
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
ostmnt=$(facet_mntpt ost${num})
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
ostmnt=$(facet_mntpt ost${num})
+ fstype=$(facet_fstype ost${num})
# Mount the OST as an ldiskfs filesystem.
# Mount the OST as an ldiskfs filesystem.
- log "mount the OST $dev as a ldiskfs filesystem"
- add ost${num} $(mkfs_opts ost${num}) $FSTYPE_OPT --reformat \
- $(ostdevname $num) > /dev/null ||
+ log "mount the OST $dev as a $fstype filesystem"
+ add ost${num} $(mkfs_opts ost${num} $dev) $FSTYPE_OPT \
+ --reformat $(ostdevname $num) \
+ $(ostvdevname $num) > /dev/null ||
error "format ost${num} error"
error "format ost${num} error"
- run_dumpe2fs ost${num} $dev
- do_facet ost${num} mount -t $(facet_fstype ost${num}) $dev \
+ if [ $fstype == zfs ]; then
+ import_zpool ost${num}
+ do_facet ost${num} "$ZFS set canmount=on $dev; " \
+ "$ZFS set mountpoint=legacy $dev; $ZFS list $dev"
+ fi
+ run_dumpfs ost${num} $dev
+ do_facet ost${num} mount -t $fstype $dev \
$ostmnt "$OST_MOUNT_OPTS"
# Run llverfs on the mounted ldiskfs filesystem in partial mode
# to ensure that the kernel can perform filesystem operations
# on the complete device without any errors.
$ostmnt "$OST_MOUNT_OPTS"
# Run llverfs on the mounted ldiskfs filesystem in partial mode
# to ensure that the kernel can perform filesystem operations
# on the complete device without any errors.
- log "run llverfs in partial mode on the OST ldiskfs $ostmnt"
+ log "run llverfs in partial mode on the OST $fstype $ostmnt"
do_rpc_nodes $(facet_host ost${num}) run_llverfs $ostmnt -vpl \
do_rpc_nodes $(facet_host ost${num}) run_llverfs $ostmnt -vpl \
- "no" || error "run_llverfs error on ldiskfs"
+ "no" || error "run_llverfs error on $fstype"
# Unmount the OST.
log "unmount the OST $dev"
# Unmount the OST.
log "unmount the OST $dev"
# After llverfs is run on the ldiskfs filesystem in partial
# mode, a full e2fsck should be run to catch any errors early.
# After llverfs is run on the ldiskfs filesystem in partial
# mode, a full e2fsck should be run to catch any errors early.
- $RUN_FSCK && run_e2fsck $(facet_host ost${num}) $dev "-y" ||
- error "run e2fsck error"
+ $RUN_FSCK && check_fsfacet ost${num}
- log "full mode, mount the OST $dev as a ldiskfs again"
+ log "full mode, mount the OST $dev as a $fstype again"
+ if [ $fstype == zfs ]; then
+ import_zpool ost${num}
+ fi
do_facet ost${num} mount -t $(facet_fstype ost${num}) \
$dev $ostmnt "$OST_MOUNT_OPTS"
cleanup_dirs ost${num} $ostmnt
do_facet ost${num} "sync"
do_facet ost${num} mount -t $(facet_fstype ost${num}) \
$dev $ostmnt "$OST_MOUNT_OPTS"
cleanup_dirs ost${num} $ostmnt
do_facet ost${num} "sync"
- run_dumpe2fs ost${num} $dev
+ run_dumpfs ost${num} $dev
# Run llverfs on the mounted ldiskfs filesystem in full
# mode to ensure that the kernel can perform filesystem
# operations on the complete device without any errors.
# Run llverfs on the mounted ldiskfs filesystem in full
# mode to ensure that the kernel can perform filesystem
# operations on the complete device without any errors.
- log "run llverfs in full mode on OST ldiskfs $ostmnt"
+ log "run llverfs in full mode on OST $fstype $ostmnt"
do_rpc_nodes $(facet_host ost${num}) run_llverfs \
$ostmnt -vl "no" ||
do_rpc_nodes $(facet_host ost${num}) run_llverfs \
$ostmnt -vl "no" ||
- error "run_llverfs error on ldiskfs"
+ error "run_llverfs error on $fstype"
# Unmount the OST.
log "unmount the OST $dev"
# Unmount the OST.
log "unmount the OST $dev"
# After llverfs is run on the ldiskfs filesystem in
# full mode, a full e2fsck should be run to catch any
# errors early.
# After llverfs is run on the ldiskfs filesystem in
# full mode, a full e2fsck should be run to catch any
# errors early.
- $RUN_FSCK && run_e2fsck $(facet_host ost${num}) $dev \
- "-y" || error "run e2fsck error"
+ $RUN_FSCK && check_fsfacet ost${num}
-run_test 2 "run llverfs on OST ldiskfs filesystem"
+run_test 2 "run llverfs on OST ldiskfs/zfs filesystem"
test_3 () {
[ -z "$CLIENTS" ] && skip_env "CLIENTS not defined, skipping" && return
test_3 () {
[ -z "$CLIENTS" ] && skip_env "CLIENTS not defined, skipping" && return
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
- run_dumpe2fs ost${num} $dev
+ run_dumpfs ost${num} $dev
done
# Run llverfs on the mounted Lustre filesystem both in partial and
done
# Run llverfs on the mounted Lustre filesystem both in partial and
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
for num in $(seq $OSTCOUNT); do
dev=$(ostdevname $num)
- run_dumpe2fs ost${num} $dev
+ run_dumpfs ost${num} $dev
done
log "run llverfs in full mode on the Lustre filesystem $MOUNT"
done
log "run llverfs in full mode on the Lustre filesystem $MOUNT"