about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-03 11:08:11 -0800
committerPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-03 11:08:11 -0800
commit630cc91e1bb6762360c7640d58cb21eb50f9c2dd (patch)
treefdb651c50a6ee0917e010d4e21c7ce79d669a891
parentf5f58a704cbdd6c8abaa71ce6131645d7308c63c (diff)
downloadglibc-630cc91e1bb6762360c7640d58cb21eb50f9c2dd.tar.gz
glibc-630cc91e1bb6762360c7640d58cb21eb50f9c2dd.tar.xz
glibc-630cc91e1bb6762360c7640d58cb21eb50f9c2dd.zip
For b/3162458, don't skip files with d_ino==0 -- our tmpfs systems sometimes create them due to inode wraparound.
-rw-r--r--README.google8
-rw-r--r--posix/glob.c4
-rw-r--r--sysdeps/posix/readdir.c4
-rw-r--r--sysdeps/posix/readdir_r.c4
4 files changed, 20 insertions, 0 deletions
diff --git a/README.google b/README.google
index 6322484c30..50900b9c3c 100644
--- a/README.google
+++ b/README.google
@@ -155,3 +155,11 @@ stdio-common/tstdiomisc.c
   Forward-ported from cl/51376114 (from cl/41709-p2).
   (ppluzhnikov, google-local)
 
+posix/glob.c
+sysdeps/unix/readdir.c
+sysdeps/unix/readdir_r.c
+  For b/3162458, don't skip files with d_ino==0 -- our tmpfs systems
+  sometimes create them due to inode wraparound.
+  Forward-ported from cl/51430993 (from cl/45000-p2).
+  (ppluzhnikov, google-local)
+
diff --git a/posix/glob.c b/posix/glob.c
index f1431088a2..6f693f748d 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -142,6 +142,10 @@
 # define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
 #endif /* POSIX */
 
+/* Google-local: for b/3162458, don't ignore entries with d_ino == 0  */
+#undef REAL_DIR_ENTRY
+#define REAL_DIR_ENTRY(dp) 1
+
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/sysdeps/posix/readdir.c b/sysdeps/posix/readdir.c
index 7bb956a916..aec1b9557d 100644
--- a/sysdeps/posix/readdir.c
+++ b/sysdeps/posix/readdir.c
@@ -107,8 +107,12 @@ __READDIR (DIR *dirp)
       dirp->filepos += reclen;
 #endif
 
+#if 1  /* Google-local: for b/3162458, don't ignore entries with d_ino == 0  */
+    } while (0);
+#else
       /* Skip deleted files.  */
     } while (dp->d_ino == 0);
+#endif
 
 #ifndef NOT_IN_libc
   __libc_lock_unlock (dirp->lock);
diff --git a/sysdeps/posix/readdir_r.c b/sysdeps/posix/readdir_r.c
index ee88c9b46d..d819ec0048 100644
--- a/sysdeps/posix/readdir_r.c
+++ b/sysdeps/posix/readdir_r.c
@@ -128,7 +128,11 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
 
       /* Skip deleted and ignored files.  */
     }
+#if 1  /* Google-local: for b/3162458, don't ignore entries with d_ino == 0  */
+  while (0);
+#else
   while (dp->d_ino == 0);
+#endif
 
   if (dp != NULL)
     {