]> www.infradead.org Git - users/hch/xfsprogs.git/commit
mkfs: ignore stripe geom if sunit or swidth == physical sector size
authorEric Sandeen <sandeen@redhat.com>
Wed, 29 Oct 2014 05:34:38 +0000 (16:34 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 29 Oct 2014 05:34:38 +0000 (16:34 +1100)
commite21c11e3bac9d37fa404ae28b36bac6989b1623b
tree704cc586cea26570bf3fe750615190c6d2ae1fb7
parentc7dd81c7cd77b3a2432899063f333d2b8322fcdc
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>
mkfs/xfs_mkfs.c