[PATCH v2 4/9] linux: Use getdents64 on non-LFS readdir
Florian Weimer
fweimer@redhat.com
Tue Oct 13 15:59:06 GMT 2020
* Adhemerval Zanella via Libc-alpha:
> It reserves some space on the allocated internal buffer to be
> used as a the returned dirent struct. The kernel obtained dirent64
> struct are copied to the temporary buffer on each readdir call.
>
> The overflow test is moved once the dirent64 entry is copied
> to the temporary buffer, and a subsequent readdir will obtain the
> next entry. The idea is an overflow fails to return the entry on
> readdir, but a next readdir might still obtain the next entry.
> (for filesystem that does not have the concept of sequential d_off,
> such as ext4).
Can you make the translation buffer a separate allocation? Then you can
resize it to accommodate long names.
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Libc-alpha
mailing list