xfs
[Top] [All Lists]

[PATCH 2/2] metadump: handle multi-block directories

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH 2/2] metadump: handle multi-block directories
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 06 Jul 2015 13:17:20 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <559AC5AA.5040900@xxxxxxxxxxx>
References: <559AC5AA.5040900@xxxxxxxxxxx>
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@xxxxxxxxxx>
---

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;

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