]> www.infradead.org Git - users/hch/xfsprogs.git/commit
mkfs.xfs: always use underlying fs sector size when mkfs'ing a file
authorEric Sandeen <sandeen@sandeen.net>
Tue, 23 Jun 2015 01:36:22 +0000 (11:36 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 23 Jun 2015 01:36:22 +0000 (11:36 +1000)
commitb0cda2f64c3c8082df111a14332fec9140f43cbb
treebcdd9aaf8817e93996d1a797ac65c622feb9f558
parentaaf90a2d2d20d00d5c933098257f806311222ff0
mkfs.xfs: always use underlying fs sector size when mkfs'ing a file

If we are mkfs'ing a file, and that file is on a 4k sector filesystem,
we should make the fs image file with the same sector size, or things
may fail when they try to do direct IO in 512 byte chunks (depending
on whether it is a 512e or "hard" 4k device).

Earlier commits attempted this to some degree:

5a7d59 xfsprogs: try to handle mkfs of a file on 4k sector device
3800a2 mkfs.xfs: don't call blkid_get_topology on existing regular files

but inexplicably missed the case where mkfs.xfs with "-d file" was
specified.

One more try; in get_topology(), try to get the underlying fs sector
size in *all* cases where we are mkfs'ing a file, and set the sector size
accordingly.

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