unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Fix getdents{64} regression on some FS
@ 2020-10-21 14:15 Adhemerval Zanella via Libc-alpha
  2020-10-21 14:15 ` [PATCH v3 1/7] linux: Do not skip entries with zero d_ino values [BZ #12165] Adhemerval Zanella via Libc-alpha
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2020-10-21 14:15 UTC (permalink / raw)
  To: libc-alpha, Florian Weimer; +Cc: James Clarke, John Paul Adrian Glaubitz

This is updated version [1], rebased against master add with some
suggestion from previous review.  The main changes are:

  - The translation buffer is allocated as an auxiliarry one (instead
    of a reserved spacefrom the dirstream) and readdir might reallocate
    it if it finds a large entry.

  - Failures in non-LFS readdir (such as d_ino/d_off overflow or failure
    in expand the translation buffer) is ignored.  This allows code that
    does not handle possible failure in readdir to successful read the
    rest of entries in the directory.

  - So minor fixes in dirent/tst-seekdir2.c

  - Added __attribute_deprecated_msg__ on getdirentries to redirect to
    getdents64.

I have checked on x86_64-linux-gnu, powerpc64-linux-gnu and on some
32-bit ABIs arm-linux-gnueabihf, powerpc-linux-gnu, and sparcv9-linux-gnu.


[1] https://sourceware.org/pipermail/libc-alpha/2020-October/118274.html

Adhemerval Zanella (7):
  linux: Do not skip entries with zero d_ino values [BZ #12165]
  linux: Use getdents64 on non-LFS readdir
  linux: Set internal DIR filepos as off64_t [BZ #23960, BZ #24050]
  linux: Add __readdir64_unlocked
  linux: Add __old_readdir64_unlocked
  linux: Use getdents64 on readdir64 compat implementation
  dirent: Deprecate getdirentries

 NEWS                                  |   3 +
 dirent/Makefile                       |   2 +-
 dirent/dirent.h                       |  14 +-
 dirent/tst-seekdir2.c                 | 158 +++++++++++++++++++++
 include/dirent.h                      |   1 +
 sysdeps/unix/sysv/linux/Makefile      |   3 +
 sysdeps/unix/sysv/linux/closedir.c    |   8 ++
 sysdeps/unix/sysv/linux/dirstream.h   |  11 +-
 sysdeps/unix/sysv/linux/getdents64.c  |  93 ------------
 sysdeps/unix/sysv/linux/olddirent.h   |   4 +-
 sysdeps/unix/sysv/linux/opendir.c     |  37 +++++
 sysdeps/unix/sysv/linux/readdir.c     |  83 +++++++----
 sysdeps/unix/sysv/linux/readdir64.c   | 196 +++++++++++++++-----------
 sysdeps/unix/sysv/linux/readdir64_r.c | 159 +++++----------------
 sysdeps/unix/sysv/linux/rewinddir.c   |   5 +
 sysdeps/unix/sysv/linux/seekdir.c     |  36 ++++-
 sysdeps/unix/sysv/linux/telldir.c     |  47 +++++-
 sysdeps/unix/sysv/linux/telldir.h     |  64 +++++++++
 18 files changed, 583 insertions(+), 341 deletions(-)
 create mode 100644 dirent/tst-seekdir2.c
 create mode 100644 sysdeps/unix/sysv/linux/telldir.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-05-12 15:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 14:15 [PATCH v3 0/7] Fix getdents{64} regression on some FS Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 1/7] linux: Do not skip entries with zero d_ino values [BZ #12165] Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 2/7] linux: Use getdents64 on non-LFS readdir Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 3/7] linux: Set internal DIR filepos as off64_t [BZ #23960, BZ #24050] Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 4/7] linux: Add __readdir64_unlocked Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 5/7] linux: Add __old_readdir64_unlocked Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 6/7] linux: Use getdents64 on readdir64 compat implementation Adhemerval Zanella via Libc-alpha
2020-10-21 14:15 ` [PATCH v3 7/7] dirent: Deprecate getdirentries Adhemerval Zanella via Libc-alpha
2022-01-06 21:48   ` John Paul Adrian Glaubitz
2022-01-06 21:59     ` Sam James via Libc-alpha
2022-01-06 22:01       ` John Paul Adrian Glaubitz
2022-05-10 19:30       ` John Paul Adrian Glaubitz
2022-05-12 15:40         ` Adhemerval Zanella via Libc-alpha
2021-07-22  8:28 ` [PATCH v3 0/7] Fix getdents{64} regression on some FS John Paul Adrian Glaubitz
2021-08-19 16:07 ` John Paul Adrian Glaubitz
2021-08-19 16:19   ` Adhemerval Zanella via Libc-alpha
2021-08-19 16:50     ` John Paul Adrian Glaubitz
2021-08-19 16:52       ` Adhemerval Zanella via Libc-alpha
2021-08-19 17:02         ` John Paul Adrian Glaubitz
2021-08-19 17:15           ` Florian Weimer via Libc-alpha
2021-08-19 20:30             ` John Paul Adrian Glaubitz
2021-08-20 10:34               ` Dave Flogeras via Libc-alpha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).