]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs.xfs: always use underlying fs sector size when mkfs'ing a file
authorEric Sandeen <sandeen@sandeen.net>
Thu, 30 Jul 2015 23:04:11 +0000 (09:04 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:04:11 +0000 (09:04 +1000)
commit20cec860e16b267ea0c71a2f648fa2b26aad2e65
treec152b8db450ce14fc48e8aa46f4a92c9a4946755
parentc63ce10a9450020382bbbe2c48788961b19830f4
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