_dmthin_mkfs()
{
_scratch_options mkfs
- _mkfs_dev $SCRATCH_OPTIONS $@ $DMTHIN_VOL_DEV
+ _mkfs_dev $SCRATCH_OPTIONS "$@" $DMTHIN_VOL_DEV
+}
+_dmthin_try_mkfs()
+{
+ _scratch_options mkfs
+ _try_mkfs_dev $SCRATCH_OPTIONS "$@" $DMTHIN_VOL_DEV
}
esac
}
-_mkfs_dev()
+_try_mkfs_dev()
{
- local tmp=`mktemp -u`
case $FSTYP in
nfs*)
# do nothing for nfs
# do nothing for pvfs2
;;
udf)
- $MKFS_UDF_PROG $MKFS_OPTIONS $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
+ $MKFS_UDF_PROG $MKFS_OPTIONS $*
;;
btrfs)
- $MKFS_BTRFS_PROG $MKFS_OPTIONS $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
+ $MKFS_BTRFS_PROG $MKFS_OPTIONS $*
;;
ext2|ext3|ext4)
- $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* \
- 2>$tmp.mkfserr 1>$tmp.mkfsstd
+ $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $*
;;
xfs)
- $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* \
- 2>$tmp.mkfserr 1>$tmp.mkfsstd
+ $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $*
;;
*)
- yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* \
- 2>$tmp.mkfserr 1>$tmp.mkfsstd
+ yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $*
;;
esac
+}
- if [ $? -ne 0 ]; then
+_mkfs_dev()
+{
+ local tmp=`mktemp -u`
+ if ! _try_mkfs_dev "$@" 2>$tmp.mkfserr 1>$tmp.mkfsstd; then
# output stored mkfs output
cat $tmp.mkfserr >&2
cat $tmp.mkfsstd
_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE $CLUSTER_SIZE 0
_dmthin_set_fail
-_dmthin_mkfs
+_dmthin_try_mkfs >> $seqres.full 2>&1 || \
+ _notrun "Could not format small thinp filesystem for test"
_dmthin_mount
# There're two bugs at here, one is dm-thin bug, the other is filesystem