[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

inconsistence in subsecond timestamp resolution handling



Hi all,

I tried to understand, why iceape FTBFS on GNU/kFreeBSD.

It seems to be due to inconsistence in subsecond timestamp resolution handling. You can try to execute

  touch k0;  echo > k1; touch k2; echo > k3; touch k4;  echo > k5
  ls --full-time k? | cut -c25-


The results are rather surprising for me, i.e:

 2008-07-10 00:55:01.020578000 +0200 k0
 2008-07-10 00:55:01.000000000 +0200 k1
 2008-07-10 00:55:01.022910000 +0200 k2
 2008-07-10 00:55:01.000000000 +0200 k3
 2008-07-10 00:55:01.023841000 +0200 k4
 2008-07-10 00:55:01.000000000 +0200 k5

The problem seems to be in cooperating between vfs.timestamp_precision and utimes/futimes syscalls.

Passed NULL means NOW, but it is not truncated
according to vfs.timestamp_precision.

IMHO, the fix should be:

--- sys/kern/vfs_syscalls.c
+++ sys/kern/vfs_syscalls.c
@@ -2819,8 +2819,7 @@
        int error;

        if (usrtvp == NULL) {
-               microtime(&tv[0]);
-               TIMEVAL_TO_TIMESPEC(&tv[0], &tsp[0]);
+               vfs_timestamp(&tsp[0]);
                tsp[1] = tsp[0];
        } else {
                if (tvpseg == UIO_SYSSPACE) {



Any comments, thoughts ?

Can someone test whether the similar results are also on plain FreeBSD
and other BSDs ?


Aurelien, please could you on buildds perform

  sysctl -a vfs.timestamp_precision=2

and requeue gnustep-gui on kfreebsd-amd64 and iceape on both.

Petr


Reply to: