]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs: handle 4k sector devices more cleanly
authorEric Sandeen <sandeen@sandeen.net>
Tue, 12 Jan 2010 16:22:43 +0000 (10:22 -0600)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 12 Jan 2010 16:22:43 +0000 (10:22 -0600)
commitfd5eda53f726895ce5a7233448ad3c2311823fb1
tree161498afa6563ceb30d9404432e08b5ddc3b1ada
parenta8de1cf93a56007458baeafadf8611c550572023
mkfs: handle 4k sector devices more cleanly

Trying to mkfs a 4k sector device today fails w/o manually specifying
sector size:

# modprobe scsi_debug sector_size=4096 dev_size_mb=32
# mkfs.xfs -f /dev/sdc
mkfs.xfs: warning - cannot set blocksize on block device /dev/sdc: Invalid argument
Warning: the data subvolume sector size 512 is less than the sector size
reported by the device (4096).
... <fail>

add sectorsize to the device topology info, and use that if present.

Also check that explicitly requested sector sizes are not smaller
than the hardware size.  This already fails today, but with the more
cryptic "cannot set blocksize" ioctl error above.

With a few more suggested comments & cleanups from Christoph.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
include/libxfs.h
libxfs/init.h
libxfs/linux.c
mkfs/xfs_mkfs.c