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

Re: inconsistence in subsecond timestamp resolution handling



Petr Salinger a écrit :
> Hi all,
Hi!


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

Nice work ;-)

> 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 ?

At a first glance, it looks correct. Is the code still the same in the
FreeBSD 8.x branch?

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

I have just tried on plain FreeBSD, but I haven't found a way to print
the time with full resolution with the default userspace tools. I guess
the best is to write a small C code, but I don't have time currently.

I should have more time next week to give a closer a look, and to try on
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.
> 

Both have been built correctly. I'll keep this setting on the buildds
until we fix the real bug.

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net


Reply to: