[v2,0/9] Fix getdents{64} regression on some FS

Message ID 20201002170620.1611673-1-adhemerval.zanella@linaro.org
Headers
Series Fix getdents{64} regression on some FS |

Message

Adhemerval Zanella Oct. 2, 2020, 5:06 p.m. UTC
  This is updated version [1], rebased against master add with some
suggestion from previous review.  I am re-sending because BZ #23960
report keep being updated with users that see the BZ #23960 issue in
different scenarios.

I have reports from both Debian and Gentoo developers that this
patchset fixes the issues they saw with recent glibc on some
scenarios (schroot plus qemu) and on some filesystem (ext4).  They
can correct me with their testing status.

[1] https://sourceware.org/pipermail/libc-alpha/2020-April/112866.html

Adhemerval Zanella (9):
  linux: Move posix dir implementations to Linux
  linux: Simplify opendir buffer allocation
  linux: Add __readdir_unlocked
  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                               |  11 +-
 dirent/tst-seekdir2.c                         | 156 +++++++++++++++++
 include/dirent.h                              |   5 +-
 support/temp_file.c                           |  12 +-
 support/temp_file.h                           |   7 +
 sysdeps/posix/readdir.c                       | 127 --------------
 sysdeps/posix/readdir_r.c                     | 159 ------------------
 sysdeps/posix/telldir.c                       |  33 ----
 sysdeps/unix/sysv/linux/Makefile              |   3 +
 sysdeps/{posix => unix/sysv/linux}/closedir.c |   4 +
 sysdeps/{posix => unix/sysv/linux}/dirfd.c    |   0
 .../{posix => unix/sysv/linux}/dirstream.h    |   7 +-
 .../{posix => unix/sysv/linux}/fdopendir.c    |   0
 sysdeps/unix/sysv/linux/getdents64.c          |  95 +----------
 sysdeps/unix/sysv/linux/olddirent.h           |   4 +-
 sysdeps/{posix => unix/sysv/linux}/opendir.c  |  56 +++---
 sysdeps/unix/sysv/linux/readdir.c             |  69 +++++++-
 sysdeps/unix/sysv/linux/readdir.h             | 159 ++++++++++++++++++
 sysdeps/unix/sysv/linux/readdir64.c           | 149 ++++++++++++++--
 sysdeps/unix/sysv/linux/readdir64_r.c         | 103 ++++++++++--
 sysdeps/unix/sysv/linux/readdir_r.c           |  50 +++++-
 .../{posix => unix/sysv/linux}/rewinddir.c    |   5 +
 sysdeps/{posix => unix/sysv/linux}/seekdir.c  |  36 +++-
 sysdeps/unix/sysv/linux/telldir.c             |  76 +++++++++
 sysdeps/unix/sysv/linux/telldir.h             |  64 +++++++
 27 files changed, 907 insertions(+), 488 deletions(-)
 create mode 100644 dirent/tst-seekdir2.c
 delete mode 100644 sysdeps/posix/readdir.c
 delete mode 100644 sysdeps/posix/readdir_r.c
 delete mode 100644 sysdeps/posix/telldir.c
 rename sysdeps/{posix => unix/sysv/linux}/closedir.c (95%)
 rename sysdeps/{posix => unix/sysv/linux}/dirfd.c (100%)
 rename sysdeps/{posix => unix/sysv/linux}/dirstream.h (93%)
 rename sysdeps/{posix => unix/sysv/linux}/fdopendir.c (100%)
 rename sysdeps/{posix => unix/sysv/linux}/opendir.c (74%)
 create mode 100644 sysdeps/unix/sysv/linux/readdir.h
 rename sysdeps/{posix => unix/sysv/linux}/rewinddir.c (95%)
 rename sysdeps/{posix => unix/sysv/linux}/seekdir.c (65%)
 create mode 100644 sysdeps/unix/sysv/linux/telldir.c
 create mode 100644 sysdeps/unix/sysv/linux/telldir.h
  

Comments

Dave Flogeras Oct. 4, 2020, 1:08 p.m. UTC | #1
On Fri, Oct 2, 2020 at 2:06 PM Adhemerval Zanella <
adhemerval.zanella@linaro.org> wrote:

> I have reports from both Debian and Gentoo developers that this
> patchset fixes the issues they saw with recent glibc on some
> scenarios (schroot plus qemu) and on some filesystem (ext4).  They
> can correct me with their testing status.
>
>
I can confirm that the initial version of this patch (discussed privately
via email) has been working on Gentoo armv6j and armv7a for me for months.
This includes both testing within a qemu chroot (where the problem was
noticed), and also on the target hardware.  On the target the symptoms do
not show up even unpatched, as it is 32 bit userspace calling a 32 bit
kernel, but I thought I'd mention that I observed no ill effects there with
the patchset.

I would definitely appreciate it if this was eventually back-ported to at
least 2.32, since Gentoo policy likely prevents patching system packages
like glibc without upstream endorsement.  It would be great to have this
fixed, since it has been an issue for over a year.

PS. I'm not a full Gentoo developer, just a longtime member of the
community, and power user.  I will however push these issues through the
proper channels.

Thanks!
Dave