mkfs: ignore stripe geom if sunit or swidth == physical sector size
Today, this geometry:
# modprobe scsi_debug opt_blks=2048 dev_size_mb=2048
# blockdev --getpbsz --getss --getiomin --getioopt /dev/sdd
512
512
512
1048576
will result in a warning at mkfs time, like this:
# mkfs.xfs -f -d su=64k,sw=12 -l su=64k /dev/sdd
mkfs.xfs: Specified data stripe width 1536 is not the same as the volume stripe width 2048
because our geometry discovery thinks it looks like a
valid striping setup which the commandline is overriding.
However, a stripe unit of 512 really isn't indicative of
a proper stripe geometry.
Prior to this patch, we reset only sunit *or* swidth,
if either was equal to physical block size, but not
necessarily both.
Change the heuristic so that if either the discovered
sunit or the discovered swidth is physical block size,
we reset *both* to zero and ignore the geom completely.
While we're at it, don't pass &dummy in for multiple
arguments to blkid_get_topology(); that'll mean that
inside the function, the last assignment wins, and could
lead to unexpected results.
Reported-by: Stan Hoeppner <stan@hardwarefreak.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>