forked from pool/xfsprogs
33 lines
1008 B
Diff
33 lines
1008 B
Diff
Index: libhandle/handle.c
|
|
===================================================================
|
|
--- libhandle/handle.c.orig
|
|
+++ 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: libhandle/jdm.c
|
|
===================================================================
|
|
--- libhandle/jdm.c.orig
|
|
+++ 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 ),
|