mkfs01 testcases issue
Hi,
While running LTP commands testcases,these three tests(mkfs01_msdos,mkfs01_vfat,mkswap01) sometimes failed. It is because that mkfs.vfat/mkswap on the test block device which is made as btrfs( in previous mkfs01_btrfs test) does not work. blkid still show "TYPE="btrfs" after mkfs.vfat/mkswap. Seems the issue is only reproduced with a very small size of block device(less than 20M).
Does anyone hit similar issue,is it a kernel or btrfs bug?
Anyway,how about making the test block device $LTP_DEV to the original filesystem in tst_release_device(),so it will avoid such effect between different testcases.
testcases/lib/test.sh +1 -0
@@ -253,6 +253,7 @@ tst_acquire_device() tst_release_device() { if [ ${TST_DEVICE_FLAG} -eq 0 ]; then + tst_mkfs ${LTP_DEV_FS_TYPE} ${LTP_DEV} return fi
Thanks
Shuang
Hi!
Quoted 8 lines
While running LTP commands testcases,these three
tests(mkfs01_msdos,mkfs01_vfat,mkswap01)sometimes failed. It is because that mkfs.vfat/mkswap on the test block device which is made asbtrfs( in previous mkfs01_btrfs test)does not work. blkid still show "TYPE="btrfs" after mkfs.vfat/mkswap. Seems the issue is only reproduced with a very small size of block device(less than 20M).
Does anyone hit similar issue,is it a kernel or btrfs bug?
Hmm, looks like blkid does not work for vfat formatted partition if the partition was formatted with btrfs beforehand. I can reproduce the problem with:
dd if=/dev/zero of=disk.img bs=1024 count=18000
losetup /dev/loop0 disk.img
mkfs.btrfs /dev/loop0
mkfs.vfat /dev/loop0
blkid /dev/loop0
The output from the blkid is indeed empty, i.e. the loop device is not recognized as a fat partition.
Trying to mount the device results in:
mount: /dev/loop0: more filesystems detected. This should not happen,
use -t <type> to explicitly specify the filesystem type or use wipefs(8) to clean up the device.
So it looks like mkfs.vfat/mkswap fails to erase btrfs magic string, which I would call a bug in the mkfs/mkswap.
Quoted 3 lines
Anyway,how about making the test block device $LTP_DEV to the original filesystem in tst_release_device(),so it will avoid such effect between different testcases.
We can consider calling wipefs before we format the device with a filesystem, but I would rather see mkfs/mkswap fixed.
Signature · 2 lines
Cyril Hrubis [email protected]
Hi!
Quoted 8 lines
Quoted 8 lines
While running LTP commands testcases,these three
tests(mkfs01_msdos,mkfs01_vfat,mkswap01)sometimes failed. It is because that mkfs.vfat/mkswap on the test block device which is made asbtrfs( in previous mkfs01_btrfs test)does not work. blkid still show "TYPE="btrfs" after mkfs.vfat/mkswap. Seems the issue is only reproduced with a very small size of block device(less than 20M).
Does anyone hit similar issue,is it a kernel or btrfs bug?
And looks like mkswap has been fixed allready in:
commit c1f1b301718ec0f5ffeae5b631c3ff38455b9ccd
Author: Milan Broz <[email protected]> Date: Mon Sep 10 12:58:39 2012 +0200
mkswap: wipe old signature if there is no part table by default
Historically mkswap avoids wiping any signature on "whole disk", until force option is given.
While the idea is that it should not wipe possible boot loader, in reality it leads to many situations where e.g. LUKS device is overwritten but still can be detected as LUKS (but unusable).
Patch chnges behaviour that only if partition table is detected, signatures are not wiped.
Also it removes check for block device - loop device can now map partitions in-kernel, so using mkswap on disk image in file should behave the same as on disk.
Also it adds warning that know signature was wiped.
Signature · 2 lines
Cyril Hrubis [email protected]
Hi!
Quoted 8 lines
Quoted 8 lines
While running LTP commands testcases,these three
tests(mkfs01_msdos,mkfs01_vfat,mkswap01)sometimes failed. It is because that mkfs.vfat/mkswap on the test block device which is made asbtrfs( in previous mkfs01_btrfs test)does not work. blkid still show "TYPE="btrfs" after mkfs.vfat/mkswap. Seems the issue is only reproduced with a very small size of block device(less than 20M).
Does anyone hit similar issue,is it a kernel or btrfs bug?
And I've reported the problem with mkfs.vfat here:
https://github.com/dosfstools/dosfstools/issues/19
Let's see if it gets fixed.
Signature · 2 lines
Cyril Hrubis [email protected]