From: Mark Goodwin Date: Thu, 8 Jan 2009 01:37:11 +0000 (+1100) Subject: Various fixes to allow xfsdump/xfsrestore to work with 64K X-Git-Tag: v3.0.0~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa23a327ad7bb659f94c492119c928038d13b069;p=thirdparty%2Fxfsprogs-dev.git 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 Signed-off-by: Lachlan McIlroy Signed-off-by: Mark Goodwin --- diff --git a/libhandle/handle.c b/libhandle/handle.c index c535f2ff8..627679748 100644 --- a/libhandle/handle.c +++ b/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); diff --git a/libhandle/jdm.c b/libhandle/jdm.c index 852c58688..070407bc7 100644 --- a/libhandle/jdm.c +++ b/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 ),