[PATCH 04/15] mkfs: validate all input values

Christoph Hellwig hch at infradead.org
Tue Dec 3 03:42:07 CST 2013


On Tue, Dec 03, 2013 at 10:12:02AM +1100, Dave Chinner wrote:
> How does this make sense, though?
> 
> # mkfs.xfs -s size=4s /dev/vda
> 
> Specifying the sector size in *sectors* is currently considered a
> valid thing to do. That's insane and fundamentally broken, because
> this
> 
> # mkfs.xfs -b size=4s -s size=2s /dev/vda
> 
> results in the block size conversion using a 512 byte sector size,
> and everything else using a 1024 byte sector size for conversions.
> e.g:
> 
> # mkfs.xfs -b size=4s -s size=2s -n size=2s /dev/vda
> 
> results in a block size of 2k (4*512) and a directory block size of
> 2k (2*1024). i.e. the result of unit conversion is dependent on
> where the sector size is specified on the command line!

True.  Guess we should indeed just outright rejecting it.  I was more
concerned about using the sector size before defined for other
parameters, but given how seldomly we specify it on the command line
anyway we're probably better off just using the normal table based
validation.



More information about the xfs mailing list