public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12165] New: readdir() skips files with d_ino == 0
@ 2010-10-27 19:25 ppluzhnikov at google dot com
  2010-12-25 18:58 ` [Bug libc/12165] " drepper.fsp at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ppluzhnikov at google dot com @ 2010-10-27 19:25 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12165

           Summary: readdir() skips files with d_ino == 0
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: ppluzhnikov@google.com


As far as I can tell, POSIX or the Single Unix Specification says absolutely
nothing about inode numbers (as far as d_ino == 0 meaning anything at all).

This thread: http://mail.nl.linux.org/kernelnewbies/2003-02/msg00075.html
implies that

A) d_ino == 0 is perfectly OK for a filesystem to have, and
B) there used to be a Linux kernel bug, but it has been fixed "long time ago"
in 2003, so now *really* long time ago.

We've just got a tmpfs directory, where the 32-bit d_ino overflowed and a file
with d_ino == 0 was created. This directory can't be removed, because e.g. 'rm
-rf' doesn't "see" the file -- it removes all the files it does see, then tries
to remove the directory, and gets ENOTEMPTY.

Relevant code in glibc/sysdeps/unix/readdir.c appears to be:

      /* Skip deleted files.  */
    } while (dp->d_ino == 0);

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12165] readdir() skips files with d_ino == 0
  2010-10-27 19:25 [Bug libc/12165] New: readdir() skips files with d_ino == 0 ppluzhnikov at google dot com
@ 2010-12-25 18:58 ` drepper.fsp at gmail dot com
  2014-06-30  7:13 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: drepper.fsp at gmail dot com @ 2010-12-25 18:58 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12165

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Ulrich Drepper <drepper.fsp at gmail dot com> 2010-12-25 18:29:44 UTC ---
I'm closing this bug.  As discussed on the list, the kernel should not generate
such d_ino values.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/12165] readdir() skips files with d_ino == 0
  2010-10-27 19:25 [Bug libc/12165] New: readdir() skips files with d_ino == 0 ppluzhnikov at google dot com
  2010-12-25 18:58 ` [Bug libc/12165] " drepper.fsp at gmail dot com
@ 2014-06-30  7:13 ` fweimer at redhat dot com
  2022-09-19  6:55 ` [Bug libc/12165] readdir: Do not skip entries with zero d_ino values fweimer at redhat dot com
  2022-09-19 10:06 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2014-06-30  7:13 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12165

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/12165] readdir: Do not skip entries with zero d_ino values
  2010-10-27 19:25 [Bug libc/12165] New: readdir() skips files with d_ino == 0 ppluzhnikov at google dot com
  2010-12-25 18:58 ` [Bug libc/12165] " drepper.fsp at gmail dot com
  2014-06-30  7:13 ` fweimer at redhat dot com
@ 2022-09-19  6:55 ` fweimer at redhat dot com
  2022-09-19 10:06 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2022-09-19  6:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12165

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com

--- Comment #4 from Florian Weimer <fweimer at redhat dot com> ---
Patch posted:

[PATCH] Linux: Do not skip d_ino == 0 entries in readdir, readdir64 (bug 12165)
<https://sourceware.org/pipermail/libc-alpha/2022-September/142059.html>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/12165] readdir: Do not skip entries with zero d_ino values
  2010-10-27 19:25 [Bug libc/12165] New: readdir() skips files with d_ino == 0 ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2022-09-19  6:55 ` [Bug libc/12165] readdir: Do not skip entries with zero d_ino values fweimer at redhat dot com
@ 2022-09-19 10:06 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2022-09-19 10:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12165

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |2.37
         Resolution|---                         |FIXED

--- Comment #5 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for 2.37 via:

commit 766b73768b290b303f5b56268c6c0d588d5a9267
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Sep 19 08:10:41 2022 +0200

    Linux: Do not skip d_ino == 0 entries in readdir, readdir64 (bug 12165)

    POSIX does not say this value is special.  For example, old XFS file
    systems may still use inode number zero.

    Also update the comment regarding ENOENT.  Linux may return ENOENT
    for some file systems.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-09-19 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 19:25 [Bug libc/12165] New: readdir() skips files with d_ino == 0 ppluzhnikov at google dot com
2010-12-25 18:58 ` [Bug libc/12165] " drepper.fsp at gmail dot com
2014-06-30  7:13 ` fweimer at redhat dot com
2022-09-19  6:55 ` [Bug libc/12165] readdir: Do not skip entries with zero d_ino values fweimer at redhat dot com
2022-09-19 10:06 ` fweimer at redhat dot com

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).