From: Darrick J. Wong Date: Sat, 28 Oct 2017 17:08:56 +0000 (-0700) Subject: common/rc: force mkfs for xfs in _mkfs_dev X-Git-Tag: v2022.05.01~1806 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=36ea1258684bcf0c6001493ca2f3b482dc4f6610 common/rc: force mkfs for xfs in _mkfs_dev In generic/459, if the DISCARD of the thin device somehow fails with this message: device-mapper: thin: Data device (dm-1) discard unsupported: Disabling discard passdown. Then we can end up with arbitrary gunk in the thin device. This causes mkfs to fail because it's afraid to format the device. Don't be afraid, just zap it. FWIW mkfs.xfs thinks that the thinp device has an xfs external log because sometimes the thinp device just happen to be backed by the log of the previous test's scratch fs. Fix this by making the _mkfs_dev helper always format the device, per Eryu Guan's suggestion. [eguan: fix subject to reflect the fix is in common/rc] Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index 9e8fcdb6..0de1db49 100644 --- a/common/rc +++ b/common/rc @@ -628,7 +628,10 @@ _mkfs_dev() $MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* \ 2>$tmp.mkfserr 1>$tmp.mkfsstd ;; - + xfs) + $MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* \ + 2>$tmp.mkfserr 1>$tmp.mkfsstd + ;; *) yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* \ 2>$tmp.mkfserr 1>$tmp.mkfsstd