summaryrefslogtreecommitdiff
path: root/lib/fts.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-04-05 08:48:01 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-04-05 08:48:41 -0700
commit2e53df541a30d438859087ed4b5a396e04697b9b (patch)
tree4dbe1be67495327875058c1f5ca360039f03d003 /lib/fts.c
parentb665c3e28c3c5ad3ceb4c2c0f20cd934ca979377 (diff)
downloadgnulib-2e53df541a30d438859087ed4b5a396e04697b9b.tar.gz
fts: treat CIFS like NFS
Problem reported by Kamil Dudka in: https://lists.gnu.org/r/bug-gnulib/2018-04/msg00015.html * lib/fts.c (S_MAGIC_CIFS): New macro. (dirent_inode_sort_may_be_useful, leaf_optimization): Treat CIFS like NFS.
Diffstat (limited to 'lib/fts.c')
-rw-r--r--lib/fts.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/fts.c b/lib/fts.c
index bfa73e31ef..3814e58fc8 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -685,6 +685,7 @@ enum leaf_optimization
/* Linux-specific constants from coreutils' src/fs.h */
# define S_MAGIC_AFS 0x5346414F
+# define S_MAGIC_CIFS 0xFF534D42
# define S_MAGIC_NFS 0x6969
# define S_MAGIC_PROC 0x9FA0
# define S_MAGIC_REISERFS 0x52654973
@@ -792,8 +793,9 @@ dirent_inode_sort_may_be_useful (FTSENT const *p)
switch (filesystem_type (p))
{
- case S_MAGIC_TMPFS:
+ case S_MAGIC_CIFS:
case S_MAGIC_NFS:
+ case S_MAGIC_TMPFS:
/* On a file system of any of these types, sorting
is unnecessary, and hence wasteful. */
return false;
@@ -827,6 +829,10 @@ leaf_optimization (FTSENT const *p)
/* Although AFS mount points are not counted in st_nlink, they
act like directories. See <https://bugs.debian.org/143111>. */
FALLTHROUGH;
+ case S_MAGIC_CIFS:
+ /* Leaf optimization causes 'find' to abort. See
+ <https://lists.gnu.org/r/bug-gnulib/2018-04/msg00015.html>. */
+ FALLTHROUGH;
case S_MAGIC_NFS:
/* NFS provides usable dirent.d_type but not necessarily for all entries
of large directories, so as per <https://bugzilla.redhat.com/1252549>