Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176300337
D60760.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
702 B
Referenced Files
None
Subscribers
None
D60760.diff
View Options
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -529,7 +529,15 @@
int buflen, error;
size_t retval;
- buflen = min(roundup2(args->count, DEV_BSIZE), MAXBSIZE);
+ /*
+ * Linux dirent64 records are no larger than native dirents.
+ * For counts of at least DEV_BSIZE, keep the native batch
+ * within the caller's buffer size.
+ */
+ if (args->count >= DEV_BSIZE)
+ buflen = min(rounddown2(args->count, DEV_BSIZE), MAXBSIZE);
+ else
+ buflen = roundup2(args->count, DEV_BSIZE);
bufsav = buf = malloc(buflen, M_LINUX, M_WAITOK);
error = linux_getdirentries(td, args->fd, &buf, buflen,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 18, 6:38 PM (9 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40923818
Default Alt Text
D60760.diff (702 B)
Attached To
Mode
D60760: linux: Avoid oversized native getdents64 batches
Attached
Detach File
Event Timeline
Log In to Comment