All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] mkfs01 testcases issue
@ 2015-12-25 17:37 Shuang Qiu
  2016-01-05 13:48 ` Cyril Hrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Shuang Qiu @ 2015-12-25 17:37 UTC (permalink / raw)
  To: ltp

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.

--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] mkfs01 testcases issue
  2015-12-25 17:37 [LTP] mkfs01 testcases issue Shuang Qiu
@ 2016-01-05 13:48 ` Cyril Hrubis
  2016-01-05 14:21   ` Cyril Hrubis
  2016-01-05 14:35   ` Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Cyril Hrubis @ 2016-01-05 13:48 UTC (permalink / raw)
  To: ltp

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?

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.

> 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.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] mkfs01 testcases issue
  2016-01-05 13:48 ` Cyril Hrubis
@ 2016-01-05 14:21   ` Cyril Hrubis
  2016-01-05 14:35   ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2016-01-05 14:21 UTC (permalink / raw)
  To: ltp

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?

And looks like mkswap has been fixed allready in:

commit c1f1b301718ec0f5ffeae5b631c3ff38455b9ccd
Author: Milan Broz <mbroz@redhat.com>
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.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] mkfs01 testcases issue
  2016-01-05 13:48 ` Cyril Hrubis
  2016-01-05 14:21   ` Cyril Hrubis
@ 2016-01-05 14:35   ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2016-01-05 14:35 UTC (permalink / raw)
  To: ltp

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?

And I've reported the problem with mkfs.vfat here:

https://github.com/dosfstools/dosfstools/issues/19

Let's see if it gets fixed.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-05 14:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-25 17:37 [LTP] mkfs01 testcases issue Shuang Qiu
2016-01-05 13:48 ` Cyril Hrubis
2016-01-05 14:21   ` Cyril Hrubis
2016-01-05 14:35   ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.