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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;

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



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux