Mercurial > gnulib
changeset 37896:f87ff404df5e
fts: don't unconditionally use leaf optimization for NFS
NFS st_nlink are not accurate on all implementations,
leading to aborts() if that assumption is made.
See <https://bugzilla.redhat.com/1299169>
* lib/fts.c (leaf_optimization_applies): Remove NFS from
the white list, and document the issue.
author | Pádraig Brady <P@draigBrady.com> |
---|---|
date | Mon, 18 Jan 2016 17:29:28 +0000 |
parents | b574afad9095 |
children | 04353adc4fee |
files | ChangeLog lib/fts.c |
diffstat | 2 files changed, 19 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Jan 15 10:12:41 2016 -0800 +++ b/ChangeLog Mon Jan 18 17:29:28 2016 +0000 @@ -1,3 +1,12 @@ +2016-01-18 Pádraig Brady <P@draigBrady.com> + + fts: don't unconditionally use leaf optimization for NFS + NFS st_nlink are not accurate on all implementations, + leading to aborts() if that assumption is made. + See <https://bugzilla.redhat.com/1299169> + * lib/fts.c (leaf_optimization_applies): Remove NFS from + the white list, and document the issue. + 2016-01-15 Paul Eggert <eggert@cs.ucla.edu> KO Myung-Hun <komh@chollian.net>
--- a/lib/fts.c Fri Jan 15 10:12:41 2016 -0800 +++ b/lib/fts.c Mon Jan 18 17:29:28 2016 +0000 @@ -718,22 +718,23 @@ switch (fs_buf.f_type) { - case S_MAGIC_NFS: - /* NFS provides usable dirent.d_type but not necessarily for all entries - of large directories. See <https://bugzilla.redhat.com/1252549>. */ - return true; - /* List here the file system types that lack usable dirent.d_type info, yet for which the optimization does apply. */ case S_MAGIC_REISERFS: case S_MAGIC_XFS: return true; + /* Explicitly list here any other file system type for which the + optimization is not applicable, but need documentation. */ + 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> + NFS should return true. However st_nlink values are not accurate on + all implementations as per <https://bugzilla.redhat.com/1299169>. */ + /* fall through */ case S_MAGIC_PROC: - /* Explicitly listing this or any other file system type for which - the optimization is not applicable is not necessary, but we leave - it here to document the risk. Per http://bugs.debian.org/143111, - /proc may have bogus stat.st_nlink values. */ + /* Per <http://bugs.debian.org/143111> /proc may have + bogus stat.st_nlink values. */ /* fall through */ default: return false;