]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs.xfs: fix detection of empty devices
authorChristoph Hellwig <hch@lst.de>
Fri, 5 Feb 2010 07:52:52 +0000 (08:52 +0100)
committerChristoph Hellwig <hch@lst.de>
Fri, 5 Feb 2010 07:52:52 +0000 (08:52 +0100)
commitc2b707cf506c83ad4ab38c97c11cf358cc0bec88
tree4ecc9603cd5585053e2d076d51a024f45f334d53
parent66210ef2f6aa5821a4c9cebc28414a265ee16019
mkfs.xfs: fix detection of empty devices

We currently fail to detect that a device does indeed not contain any
signature and we are indeed fine to proceed with it due to mishandling
the return value of blkid_do_fullprobe.  Fix that up and add some
better diagnostics of the blkid detection.

from RH bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=561870

# dd if=/dev/zero of=k bs=1MB count=2 seek=20; mkfs.xfs k
# mkfs.xfs: probe of k failed, cannot detect existing filesystem.
# mkfs.xfs: Use the -f option to force overwrite

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c