Skip to contentSkip to conversation

allow xfsrestore to run on 64k page size machines

hack David Chinner 1 participant 1 message May 22, 2008

lore
Share & tools
lore
#0 lore raw

xfsrestore has assumptions about page size built into the inode hunk size in the dump format. Seems to be a stupid thing to do - this patch simply comments out the asserts to allow it to work on 64k page size machine, but probably subtly breaks the code. Nasty hack, really, but allows xfsqa tests to pass.

---
 xfsdump/restore/inomap.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
xfsdump/restore/inomap.c +6 -6
Index: xfs-cmds/xfsdump/restore/inomap.c
===================================================================
@@ -197,8 +197,8 @@ inomap_restore_pers( drive_t *drivep,
 	 */
 	ASSERT( INOPERSEG == ( sizeof( (( seg_t * )0 )->lobits ) * NBBY ));
 	ASSERT( sizeof( hnk_t ) == HNKSZ );
-	ASSERT( HNKSZ >= pgsz );
-	ASSERT( ! ( HNKSZ % pgsz ));
+	//ASSERT( HNKSZ >= pgsz );
+	//ASSERT( ! ( HNKSZ % pgsz ));
 	ASSERT( sizeof( pers_t ) <= PERSSZ );
 
 	/* get inomap info from media hdr
@@ -224,8 +224,8 @@ inomap_restore_pers( drive_t *drivep,
 
 	/* mmap the persistent hdr and space for the map
 	 */
-	ASSERT( sizeof( hnk_t ) * ( size_t )hnkcnt >= pgsz );
-	ASSERT( ! ( sizeof( hnk_t ) * ( size_t )hnkcnt % pgsz ));
+	//ASSERT( sizeof( hnk_t ) * ( size_t )hnkcnt >= pgsz );
+	//ASSERT( ! ( sizeof( hnk_t ) * ( size_t )hnkcnt % pgsz ));
 	persp = ( pers_t * ) mmap_autogrow(
 				     PERSSZ
 				     +
@@ -355,8 +355,8 @@ inomap_sync_pers( char *hkdir )
 	/* sanity checks
 	 */
 	ASSERT( sizeof( hnk_t ) == HNKSZ );
-	ASSERT( HNKSZ >= pgsz );
-	ASSERT( ! ( HNKSZ % pgsz ));
+	//ASSERT( HNKSZ >= pgsz );
+	//ASSERT( ! ( HNKSZ % pgsz ));
 
 	/* only needed once per session
 	 */