[Top] [All Lists]

[PATCH] xfs_copy: accept XFS_ABTB_CRC_MAGIC

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs_copy: accept XFS_ABTB_CRC_MAGIC
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Tue, 25 Feb 2014 20:03:20 -0600
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
xfs_copy needs a fair bit of work for CRCs because it rewrites
UUIDs by default, but this change will get it working properly
with the "-d" (duplicate) option which keeps the same UUID.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

However, I wonder if we should fail CRC filesystems outright
for now if -d isn't specified, because it will invalidate every
CRC and generally make a mess of things...

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 9986fbf..7c807a4 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -957,7 +957,9 @@ main(int argc, char **argv)
                                 ((char *)btree_buf.data +
                                  pos - btree_buf.position);
-                       ASSERT(be32_to_cpu(block->bb_magic) == XFS_ABTB_MAGIC);
+                       ASSERT(be32_to_cpu(block->bb_magic) == 
+                               (xfs_sb_version_hascrc(&mp->m_sb) ?
+                                XFS_ABTB_CRC_MAGIC : XFS_ABTB_MAGIC));
                        if (be16_to_cpu(block->bb_level) == 0)

<Prev in Thread] Current Thread [Next in Thread>