]> www.infradead.org Git - users/hch/xfsprogs.git/commit
mkfs: more sunit/swidth sanity checking
authorEric Sandeen <sandeen@redhat.com>
Fri, 2 Feb 2018 15:32:45 +0000 (09:32 -0600)
committerEric Sandeen <sandeen@redhat.com>
Fri, 2 Feb 2018 15:32:45 +0000 (09:32 -0600)
commit16adcb8831cf75d405ab8f4b581e70af79f4dba8
tree35d17db3a1eb666dd657ed980d36b85db2a117a9
parent7d25f65f268565c07ef094ff7d25fb5a36cd3b9d
mkfs: more sunit/swidth sanity checking

This fixes 2 issues with stripe geometry validation.

# mkfs.xfs -d sunit=64,swidth=0 ...
both data sunit and data swidth options must be specified

But I did specify it, I specified 0!

So use cli_opt_set() to detect that it was specified.

But we can't allow the above configuration (in fact it causes
a % 0 later in mkfs), so catch it in the "swidth must be a
multiple of sunit" test a bit further down.

(sunit=0,swidth=0 /is/ valid, it's used to override disk
geometry if desired.)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c