Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178309518
D60760.1796477409.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60760.1796477409.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
@@ -451,7 +451,15 @@
int buflen, error;
size_t retval;
- buflen = min(roundup2(args->count, DEV_BSIZE), MAXBSIZE);
+ /*
+ * Linux dirent 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(args->count, MAXBSIZE);
+ else
+ buflen = roundup2(args->count, DEV_BSIZE);
bufsav = buf = malloc(buflen, M_LINUX, M_WAITOK);
error = linux_getdirentries(td, args->fd, &buf, buflen,
@@ -529,7 +537,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(args->count, 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
Sat, Dec 5, 1:30 PM (22 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41470537
Default Alt Text
D60760.1796477409.diff (1 KB)
Attached To
Mode
D60760: linux: Bound native getdents and getdents64 batches
Attached
Detach File
Event Timeline