public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: xfs@oss.sgi.com
Subject: [PATCH 2/4] metadump: check for non-zero inode alignment
Date: Mon, 23 Feb 2015 10:51:47 -0500	[thread overview]
Message-ID: <1424706709-21594-3-git-send-email-bfoster@redhat.com> (raw)
In-Reply-To: <1424706709-21594-1-git-send-email-bfoster@redhat.com>

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@redhat.com>
---
 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

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

  parent reply	other threads:[~2015-02-23 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 15:51 [PATCH 0/4] xfsprogs: a couple metadump fixes and sb logging backports Brian Foster
2015-02-23 15:51 ` [PATCH 1/4] metadump: include NULLFSINO check in inode copy code Brian Foster
2015-02-23 15:51 ` Brian Foster [this message]
2015-02-23 15:51 ` [PATCH 3/4] xfsprogs: remove bitfield based superblock updates Brian Foster
2015-02-23 15:51 ` [PATCH 4/4] xfsprogs: consolidate superblock logging functions Brian Foster
2015-02-23 22:08 ` [PATCH 0/4] xfsprogs: a couple metadump fixes and sb logging backports Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424706709-21594-3-git-send-email-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox