Discussion:
[PATCH] utimensat: remove FIXME for old Linux kernels
(too old to reply)
Paul Eggert
2016-11-01 15:56:08 UTC
Permalink
Raw Message
* lib/utimensat.c (rpl_utimensat): Update FIXME comment.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Belatedy do a "simplify
this in 2012" FIXME, by assuming the file system bug is absent
unless demonstrated to be present. We no longer need to worry
about Linux kernel 2.6.32 when building with newer kernels.
---
ChangeLog | 9 +++++++++
lib/utimensat.c | 4 ++--
m4/utimensat.m4 | 18 ++++--------------
3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c8ac92c..999dc04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-11-01 Paul Eggert <***@cs.ucla.edu>
+
+ utimensat: remove FIXME for old Linux kernels
+ * lib/utimensat.c (rpl_utimensat): Update FIXME comment.
+ * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Belatedy do a "simplify
+ this in 2012" FIXME, by assuming the file system bug is absent
+ unless demonstrated to be present. We no longer need to worry
+ about Linux kernel 2.6.32 when building with newer kernels.
+
2016-10-16 Bruno Haible <***@clisp.org>

qsort_r: Fix macrology for platforms that lack the function.
diff --git a/lib/utimensat.c b/lib/utimensat.c
index ae4da8f..7ca3e4b 100644
--- a/lib/utimensat.c
+++ b/lib/utimensat.c
@@ -69,8 +69,8 @@ rpl_utimensat (int fd, char const *file, struct timespec const times[2],

The same bug occurs in Solaris 11.1 (Apr 2013).

- FIXME: Simplify this for Linux in 2016 and for Solaris in
- 2024, when file system bugs are no longer common. */
+ FIXME: Simplify this in 2024, when these file system bugs are
+ no longer common on Gnulib target platforms. */
if (times && (times[0].tv_nsec == UTIME_OMIT
|| times[1].tv_nsec == UTIME_OMIT))
{
diff --git a/m4/utimensat.m4 b/m4/utimensat.m4
index 550cd23..d9a4cd3 100644
--- a/m4/utimensat.m4
+++ b/m4/utimensat.m4
@@ -1,4 +1,4 @@
-# serial 5
+# serial 6
# See if we need to provide utimensat replacement.

dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
@@ -51,20 +51,10 @@ AC_DEFUN([gl_FUNC_UTIMENSAT],
}
return result;
]])],
-dnl FIXME: simplify this in 2012, when file system bugs are no longer common
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef __linux__
-/* The Linux kernel added utimensat in 2.6.22, but has bugs with UTIME_OMIT
- in several file systems as recently as 2.6.32. Always replace utimensat
- to support older kernels. */
-choke me
-#endif
- ]])],
- [gl_cv_func_utimensat_works=yes],
- [gl_cv_func_utimensat_works="needs runtime check"])],
+ [gl_cv_func_utimensat_works=yes],
[gl_cv_func_utimensat_works=no],
- [gl_cv_func_utimensat_works="guessing no"])])
- if test "$gl_cv_func_utimensat_works" != yes; then
+ [gl_cv_func_utimensat_works="guessing yes"])])
+ if test "$gl_cv_func_utimensat_works" = no; then
REPLACE_UTIMENSAT=1
fi
fi
--
2.7.4
Bruno Haible
2016-11-01 18:20:45 UTC
Permalink
Raw Message
Hi Paul,
Post by Paul Eggert
We no longer need to worry
about Linux kernel 2.6.32 when building with newer kernels.
Should this change be accompanied with a documentation change
in doc/posix-functions/utimensat.texi ?

And what about m4/futimens.m4 and doc/posix-functions/futimens.texi ?

Bruno
Paul Eggert
2016-11-01 22:42:19 UTC
Permalink
Raw Message
Post by Bruno Haible
Should this change be accompanied with a documentation change
in doc/posix-functions/utimensat.texi ?
It's not strictly needed, as Gnulib still works around bugs in older
systems, it's just that 'configure' now defaults to assuming the older
bugs don't exist instead of assuming that they do exist. Although I can
imagine documenting the assumption, this sort of thing hasn't been done
in the past.
Post by Bruno Haible
And what about m4/futimens.m4 and doc/posix-functions/futimens.texi ?
Thanks, I missed that, and I should fix futimens to be consistent. I
installed the attached.
Bruno Haible
2016-11-01 23:39:41 UTC
Permalink
Raw Message
Post by Paul Eggert
Post by Bruno Haible
Should this change be accompanied with a documentation change
in doc/posix-functions/utimensat.texi ?
It's not strictly needed, as Gnulib still works around bugs in older
systems, it's just that 'configure' now defaults to assuming the older
bugs don't exist instead of assuming that they do exist.
Ah I see now. The previous code assumed that if 'utimensat' works correctly,
as demonstrated by the test, there could still be a newer kernel that
introduces new bugs, and it tried to be cautiously compatible with that
newer broken code. All the new change does was to remove this forward-caution,
right?

If that is it, I agree, there's nothing to change in the doc.

Bruno
Paul Eggert
2016-11-04 21:39:54 UTC
Permalink
Raw Message
Post by Bruno Haible
All the new change does was to remove this forward-caution,
right?
Yes. It's also sideways caution, in the sense that neither kernel might
be "newer" than the other.

Loading...