All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_copy: fix copy of hard 4k devices
@ 2015-06-17 19:24 Eric Sandeen
  2015-06-19 13:19 ` Brian Foster
  2015-06-19 15:07 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2015-06-17 19:24 UTC (permalink / raw)
  To: xfs-oss

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>
---

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 279527c..b39c84d 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -654,8 +654,9 @@ main(int argc, char **argv)
 
 	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));
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_copy: fix copy of hard 4k devices
  2015-06-17 19:24 [PATCH] xfs_copy: fix copy of hard 4k devices Eric Sandeen
@ 2015-06-19 13:19 ` Brian Foster
  2015-06-19 15:07 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2015-06-19 13:19 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Wed, Jun 17, 2015 at 02:24:18PM -0500, Eric Sandeen wrote:
> 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>

> 
> diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
> index 279527c..b39c84d 100644
> --- a/copy/xfs_copy.c
> +++ b/copy/xfs_copy.c
> @@ -654,8 +654,9 @@ main(int argc, char **argv)
>  
>  	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));
>  
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_copy: fix copy of hard 4k devices
  2015-06-17 19:24 [PATCH] xfs_copy: fix copy of hard 4k devices Eric Sandeen
  2015-06-19 13:19 ` Brian Foster
@ 2015-06-19 15:07 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2015-06-19 15:07 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-19 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 19:24 [PATCH] xfs_copy: fix copy of hard 4k devices Eric Sandeen
2015-06-19 13:19 ` Brian Foster
2015-06-19 15:07 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.