]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Various fixes to allow xfsdump/xfsrestore to work with 64K
authorMark Goodwin <markgw@sgi.com>
Thu, 8 Jan 2009 01:37:11 +0000 (12:37 +1100)
committerMark Goodwin <markgw@sgi.com>
Thu, 8 Jan 2009 01:37:11 +0000 (12:37 +1100)
page size. This is essentially Chinner's patch from a while
back.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Mark Goodwin <markgw@sgi.com>
libhandle/handle.c
libhandle/jdm.c

index c535f2ff84a0ea74ee18105b6ec3f3c95af264cf..6276797485ec12360f53af2ea772b4fb8b9e7ead 100644 (file)
@@ -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 852c586889a0b703903be8228b0df73d927966e1..070407bc7ad6af50b769df949e636d9bbf8d2a09 100644 (file)
@@ -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 ),