xfs
[Top] [All Lists]

[PATCH 2/4] metadump: check for non-zero inode alignment

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/4] metadump: check for non-zero inode alignment
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Mon, 23 Feb 2015 10:51:47 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1424706709-21594-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1424706709-21594-1-git-send-email-bfoster@xxxxxxxxxx>
The copy_inode_chunk() function performs some basic sanity checks on the
inode record, block number, etc. One of these checks includes whether
the inode chunk is aligned according to sb_inoalignmt. sb_inoalignment
can equal 0 with larger block sizes. This results in a mod-by-zero,
"badly aligned inode ..." warnings and skipped inodes in metadump
images. This can be reproduced with a '-m crc=1,finobt=1 -b size=64k' fs
on ppc64.

Update copy_inode_chunk() to only enforce the inode alignment check when
sb_inoalignmt is non-zero.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 db/metadump.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/db/metadump.c b/db/metadump.c
index 604fcf4..94f92bc 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -1865,6 +1865,7 @@ copy_inode_chunk(
                        (mp->m_sb.sb_inopblock > XFS_INODES_PER_CHUNK &&
                                        off % XFS_INODES_PER_CHUNK != 0) ||
                        (xfs_sb_version_hasalign(&mp->m_sb) &&
+                                       mp->m_sb.sb_inoalignmt != 0 &&
                                        agbno % mp->m_sb.sb_inoalignmt != 0)) {
                if (show_warnings)
                        print_warning("badly aligned inode (start = %llu)",
-- 
1.9.3

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