futimens, utimensat: work around ntfs-3g bug
With ntfs-3g, use of a single UTIME_OMIT failed to make any change
to the remaining two timestamps. Furthermore, the previous fix
for ctime happens to be specific to xfs, rather than global to
the kernel. Therefore, to be valid, a cache would have to be
per-device, which gets too expensive, especially considering that
the cost of a preparatory stat pulls the file into kernel cache
to speed up the resulting utimensat. So, blindly massage UTIME_OMIT
on Linux, even on working filesystems like ext4.
The bugs in xfs and ntfs-3g were reported to the kernel folks,
and fixes written, but it will be several years before gnulib
can assume that file systems in use have picked up the fixes.
* lib/utimensat.c (rpl_utimensat): Drop attempts to cache whether
a ctime bug is present, and expand workaround to cover ntfs-3g.
* lib/utimens.c (fdutimens, lutimens): Likewise.
(utimensat_ctime_really, detect_ctime_bug): Drop cache mechanism.
(validate_timespec): Adjust return value.
* m4/futimens.m4 (gl_FUNC_FUTIMENS): Update comment.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
Reported by ctrn3e8 <ctrn3e8@gmail.com>.
Signed-off-by: Eric Blake <ebb9@byu.net>