public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsdump support for 64K page size
@ 2009-01-07 15:10 Bill Kendall
  2009-01-08  2:19 ` Mark Goodwin
  0 siblings, 1 reply; 9+ messages in thread
From: Bill Kendall @ 2009-01-07 15:10 UTC (permalink / raw)
  To: xfs; +Cc: xfs-dev

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

Various fixes to allow xfsdump/xfsrestore to work with 64K
page size. This is essentially Chinner's patch from a while
back.

Signed-off-by: Bill Kendall <wkendall@sgi.com>

[-- Attachment #2: 64k_pagesize --]
[-- Type: text/plain, Size: 2826 bytes --]

---
 xfsdump/dump/content.c      |    2 +-
 xfsdump/restore/inomap.c    |    6 ------
 xfsprogs/libhandle/handle.c |    5 ++++-
 xfsprogs/libhandle/jdm.c    |    4 ++++
 4 files changed, 9 insertions(+), 8 deletions(-)

Index: xfs-cmds/xfsdump/restore/inomap.c
===================================================================
--- xfs-cmds.orig/xfsdump/restore/inomap.c
+++ xfs-cmds/xfsdump/restore/inomap.c
@@ -197,8 +197,6 @@ 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( sizeof( pers_t ) <= PERSSZ );
 
 	/* get inomap info from media hdr
@@ -224,8 +222,6 @@ 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 ));
 	persp = ( pers_t * ) mmap_autogrow(
 				     PERSSZ
 				     +
@@ -355,8 +351,6 @@ inomap_sync_pers( char *hkdir )
 	/* sanity checks
 	 */
 	ASSERT( sizeof( hnk_t ) == HNKSZ );
-	ASSERT( HNKSZ >= pgsz );
-	ASSERT( ! ( HNKSZ % pgsz ));
 
 	/* only needed once per session
 	 */
Index: xfs-cmds/xfsdump/dump/content.c
===================================================================
--- xfs-cmds.orig/xfsdump/dump/content.c
+++ xfs-cmds/xfsdump/dump/content.c
@@ -210,7 +210,7 @@ typedef struct extent_group_context exte
 
 /* minimum sizes for extended attributes buffers
  */
-#define EXTATTR_LISTBUF_SZ	( 4 * pgsz )
+#define EXTATTR_LISTBUF_SZ	( XATTR_LIST_MAX )
 #define EXTATTR_RTRVARRAY_LEN	( 1 * pgsz )
 #define EXTATTR_DUMPBUF_SZ	( 4 * pgsz )
 
Index: xfs-cmds/xfsprogs/libhandle/handle.c
===================================================================
--- xfs-cmds.orig/xfsprogs/libhandle/handle.c
+++ xfs-cmds/xfsprogs/libhandle/handle.c
@@ -360,8 +360,11 @@ attr_list_by_handle(
 
 	memcpy(&alhreq.pos, cursor, sizeof(alhreq.pos));
 	alhreq.flags = flags;
-	alhreq.buflen = bufsize;
 	alhreq.buffer = buf;
+	alhreq.buflen = bufsize;
+	/* prevent needless EINVAL from the kernel */
+	if (alhreq.buflen > XATTR_LIST_MAX)
+		alhreq.buflen = XATTR_LIST_MAX;
 
 	error = xfsctl(path, fd, XFS_IOC_ATTRLIST_BY_HANDLE, &alhreq);
 
Index: xfs-cmds/xfsprogs/libhandle/jdm.c
===================================================================
--- xfs-cmds.orig/xfsprogs/libhandle/jdm.c
+++ xfs-cmds/xfsprogs/libhandle/jdm.c
@@ -166,6 +166,10 @@ jdm_attr_list(	jdm_fshandle_t *fshp,
 	filehandle_t filehandle;
 	int rval;
 
+	/* prevent needless EINVAL from the kernel */
+	if (bufsz > XATTR_LIST_MAX)
+		bufsz = XATTR_LIST_MAX;
+
 	jdm_fill_filehandle( &filehandle, fshandlep, statp );
 	rval = attr_list_by_handle (( void * )&filehandle,
 			sizeof( filehandle ),

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-01-15 18:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 15:10 [PATCH] xfsdump support for 64K page size Bill Kendall
2009-01-08  2:19 ` Mark Goodwin
2009-01-08 15:37   ` Christoph Hellwig
2009-01-08 22:28   ` Dave Chinner
2009-01-08 23:02     ` Eric Sandeen
2009-01-09 19:36     ` Bill Kendall
2009-01-09 19:41       ` Christoph Hellwig
2009-01-14 22:48       ` Dave Chinner
2009-01-15 18:59         ` Bill Kendall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox