Page MenuHomeFreeBSD

D60760.diff
No OneTemporary

D60760.diff

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

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)

Event Timeline