Page MenuHomeFreeBSD

D60760.1796477409.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D60760.1796477409.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
@@ -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

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)

Event Timeline