If we have a pure 4k device with no 512 emulation, xfs_copy
fails straightaway because it tries to do a 512-byte direct
IO read of the superblock.
Do like we do in xfs_db, and read in the max possible sector size,
because we don't yet know what the filesystem's sector size is.
This fixes a failure in xfs/032 on a hard 4k device.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
memset(&mbuf, 0, sizeof(xfs_mount_t));
libxfs_buftarg_init(&mbuf, xargs.ddev, xargs.logdev, xargs.rtdev);
- sbp = libxfs_readbuf(mbuf.m_ddev_targp, XFS_SB_DADDR, 1, 0,
- &xfs_sb_buf_ops);
+ sbp = libxfs_readbuf(mbuf.m_ddev_targp, XFS_SB_DADDR,
+ 1 << (XFS_MAX_SECTORSIZE_LOG - BBSHIFT),
+ 0, &xfs_sb_buf_ops);
sb = &mbuf.m_sb;
libxfs_sb_from_disk(sb, XFS_BUF_TO_SBP(sbp));