All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH 2/2] metadump: handle multi-block directories
Date: Mon, 06 Jul 2015 13:17:20 -0500	[thread overview]
Message-ID: <559AC630.2090101@sandeen.net> (raw)
In-Reply-To: <559AC5AA.5040900@sandeen.net>

commit 6e79202b metadump: fully support discontiguous directory blocks

assembled a buffer from multiple dir blocks, and we can use that in
obfuscate_dir_data_block() to continue past the first filesystem block
and continue obfuscating the entire thing.

Without this, anything after the first block was skipped, and
remained as cleartext.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/db/metadump.c b/db/metadump.c
index 5baec6c..33f3ec9 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -1152,9 +1152,6 @@ obfuscate_dir_data_block(
 
 	datahdr = (struct xfs_dir2_data_hdr *)block;
 
-	if (offset % mp->m_dir_geo->fsbcount != 0)
-		return;	/* corrupted, leave it alone */
-
 	if (is_block_format) {
 		xfs_dir2_leaf_entry_t	*blp;
 		xfs_dir2_block_tail_t	*btp;
@@ -1187,7 +1184,7 @@ obfuscate_dir_data_block(
 
 	dir_offset = M_DIROPS(mp)->data_entry_offset;
 	ptr = block + dir_offset;
-	endptr = block + mp->m_sb.sb_blocksize;
+	endptr = block + mp->m_dir_geo->blksize;
 
 	while (ptr < endptr && dir_offset < end_of_data) {
 		xfs_dir2_data_entry_t	*dep;

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

      parent reply	other threads:[~2015-07-06 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 18:15 [PATCH 0/2] metadump: 2 more patches Eric Sandeen
2015-07-06 18:16 ` [PATCH 1/2] metadump: Fill attribute values with 'v' rather than NUL Eric Sandeen
2015-07-26 16:16   ` Christoph Hellwig
2015-07-06 18:17 ` Eric Sandeen [this message]

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=559AC630.2090101@sandeen.net \
    --to=sandeen@sandeen.net \
    --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 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.