9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Strange date/time on some created files
@ 2006-02-10 14:50 Gregory Pavelcak
  2006-02-10 16:59 ` Russ Cox
  2006-02-11  1:12 ` geoff
  0 siblings, 2 replies; 11+ messages in thread
From: Gregory Pavelcak @ 2006-02-10 14:50 UTC (permalink / raw)
  To: 9fans

I think something is broken somewhere in the dating
of newly created files.

I have an older style fileserver (fs64 from some generous
developer's webpage, though I don't recall who now.), and a
cpu/auth server. The commands shown are run from
drawterm on Mac OS X, in case that matters.

Output of date is correct. I also ran it from the file server
and cpu server directly and got the same result. I have no
idea why it thinks t2 was created at 12:33!

Greg
-=-=-=-=-=


cpu% date
Fri Feb 10 09:33:54 EST 2006
cpu% touch t1
cpu% >t2
cpu% ls -l t[12]
--rw-r--r-- M 11516 gp gp 0 Feb 10 09:34 t1
--rw-r--r-- M 11516 gp gp 0 Feb 10 12:33 t2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-10 14:50 [9fans] Strange date/time on some created files Gregory Pavelcak
@ 2006-02-10 16:59 ` Russ Cox
  2006-02-11  1:12 ` geoff
  1 sibling, 0 replies; 11+ messages in thread
From: Russ Cox @ 2006-02-10 16:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> cpu% date
> Fri Feb 10 09:33:54 EST 2006
> cpu% touch t1
> cpu% >t2
> cpu% ls -l t[12]
> --rw-r--r-- M 11516 gp gp 0 Feb 10 09:34 t1
> --rw-r--r-- M 11516 gp gp 0 Feb 10 12:33 t2

type "date" on your file server.  (or 9fs boot; ls -l /n/boot)
i bet it's off by three hours.

russ


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-10 14:50 [9fans] Strange date/time on some created files Gregory Pavelcak
  2006-02-10 16:59 ` Russ Cox
@ 2006-02-11  1:12 ` geoff
  2006-02-11 15:28   ` Gregory Pavelcak
  1 sibling, 1 reply; 11+ messages in thread
From: geoff @ 2006-02-11  1:12 UTC (permalink / raw)
  To: 9fans

That would be my web page (for fs64), but fs64 is a ken fs, so you
couldn't have run the commands you showed on it.  I'm puzzled.

It does sound like a time-zone problem.  If it's really an fs64 file
server, what does "date" print, as Russ suggested, and what is
conf.minuteswest set to (usually in /sys/src/fs/<fileserver>/9*.c)?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-11  1:12 ` geoff
@ 2006-02-11 15:28   ` Gregory Pavelcak
  2006-02-11 15:51     ` Russ Cox
  0 siblings, 1 reply; 11+ messages in thread
From: Gregory Pavelcak @ 2006-02-11 15:28 UTC (permalink / raw)
  To: 9fans

> That would be my web page (for fs64), but fs64 is a ken fs, so you
> couldn't have run the commands you showed on it.  I'm puzzled.

Right. The commands for my little test were run from drawterm.

> 
> It does sound like a time-zone problem.  If it's really an fs64 file
> server, what does "date" print, as Russ suggested, and what is
> conf.minuteswest set to (usually in /sys/src/fs/<fileserver>/9*.c)?

This morning, the output of 'date' from drawterm:

Sat Feb 11 10:00:01 EST 2006

then, after the walk downstairs to the server

Sat Feb 11 10:01:18 2006 + 0

I never set the time zone in the sources, so it reads
	conf.minuteswest = 8*60;

I recall having
some date problems when I built the fileserver, so I set
the time in the machine's bios to 8 hrs ahead of me
(I actually rebooted and double checked that),
and I'm pretty sure that, at some point I even
set the date on the file server using a seconds value.
I have the timezone set correctly on the
cpu server, so perhaps the combination of these things is
producing the strange result. Anyway, I botched it somehow.

Russ's other suggestion, 9fs boot; ls -l /n/boot, I'm
assuming I can just run at drawterm. I'm not sure what
to look for here. It produced this:

d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:55 /n/boot/386
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:55 /n/boot/68000
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:55 /n/boot/68020
--r--r--r-- M 93 sys    sys 13006 Jul 13  2005 /n/boot/LICENSE
--rw-rw-r-- M 93 sys    sys 14333 Jun 28  2003 /n/boot/LICENSE.afpl
--rw-rw-r-- M 93 sys    sys 15081 Jun 25  2003 /n/boot/LICENSE.gpl
--r--r--r-- M 93 sys    sys    63 Apr 14  2002 /n/boot/NOTICE
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:56 /n/boot/acme
d-rwxrwxr-x M 93 adm    adm     0 Dec  7 11:46 /n/boot/adm
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:56 /n/boot/alpha
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:44 /n/boot/amd64
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:56 /n/boot/arm
d-rwxrwxrwx M 93 sys    sys     0 Dec  6 07:56 /n/boot/cron
d-r-xr-xr-x M 93 bootes adm     0 Dec  6 07:50 /n/boot/dist
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:56 /n/boot/env
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 07:56 /n/boot/fd
d-rwxrwxr-x M 93 sys    sys     0 Feb  5 14:51 /n/boot/lib
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:04 /n/boot/lp
d-rwxrwxr-x M 93 upas   upas    0 Dec  6 08:04 /n/boot/mail
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:05 /n/boot/mips
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:05 /n/boot/mnt
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:05 /n/boot/n
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:05 /n/boot/power
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:05 /n/boot/rc
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:05 /n/boot/sparc
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:44 /n/boot/sparc64
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 08:14 /n/boot/sys
d-r-xr-xr-x M 93 sys    sys     0 Dec  8 11:15 /n/boot/tmp
d-rwxrwxr-x M 93 sys    sys     0 Dec  6 10:46 /n/boot/usr


I don't know at this point. I have a bit of a virus, so I'm
even more confused than usual.

Thanks though.

Greg



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-11 15:28   ` Gregory Pavelcak
@ 2006-02-11 15:51     ` Russ Cox
  2006-02-12  2:14       ` geoff
  0 siblings, 1 reply; 11+ messages in thread
From: Russ Cox @ 2006-02-11 15:51 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Sat Feb 11 10:00:01 EST 2006
>
> then, after the walk downstairs to the server
>
> Sat Feb 11 10:01:18 2006 + 0

That sure looks like New York time.

> I never set the time zone in the sources, so it reads
>         conf.minuteswest = 8*60;

That sure looks like California time.  If your file server
is really in 8*60, then it thinks it's 10am in California,
which explains why the files say 1pm in New York.

> I recall having
> some date problems when I built the fileserver, so I set
> the time in the machine's bios to 8 hrs ahead of me
> (I actually rebooted and double checked that),

The machine's bios should be set to GMT, which is only
five hours ahead of you.

Set the bios to GMT and then it doesn't matter
what you've got minuteswest set to, except for what
time zone the file server prints its dates in and when
it thinks 5am is to run the dump.

> Russ's other suggestion, 9fs boot; ls -l /n/boot, I'm
> assuming I can just run at drawterm. I'm not sure what
> to look for here. It produced this:

Sorry, once upon a time you could stat the root of a file server
to find out what it thought the current time was.  I should have
tried it first, though.  I meant ls -ld, but even that doesn't work,
because it stats the mount point and not the root of the mounted
file server.  I don't think it's possible to stat the root of a mounted file
server anymore.

Russ


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-11 15:51     ` Russ Cox
@ 2006-02-12  2:14       ` geoff
  2006-02-12  2:26         ` Russ Cox
  0 siblings, 1 reply; 11+ messages in thread
From: geoff @ 2006-02-12  2:14 UTC (permalink / raw)
  To: 9fans

At least in Ken fs, you want the access time of the root (to get the
current fs time):

; date; ls -ldu /n/boot /
Sat Feb 11 17:45:13 PST 2006
d-r-xr-xr-x /      0 bootes bootes 0 Feb 11 17:45 /
d-rwxrwxr-x M 251502 adm    sys    0 Feb 11 17:45 /n/boot

It's done here, 9p1.c:1300,1301:

	if(d->qid.path == QPROOT)	/* stat of root gives time */
		d->atime = time();

and here, 9p2.c:1431,1432:

		if(d->qid.path == QPROOT)	/* stat of root gives time */
			d->atime = time();

I haven't looked to see if fossil does it.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-12  2:14       ` geoff
@ 2006-02-12  2:26         ` Russ Cox
  2006-02-12  3:10           ` Bruce Ellis
  0 siblings, 1 reply; 11+ messages in thread
From: Russ Cox @ 2006-02-12  2:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> At least in Ken fs, you want the access time of the root (to get the
> current fs time):
>
> ; date; ls -ldu /n/boot /
> Sat Feb 11 17:45:13 PST 2006
> d-r-xr-xr-x /      0 bootes bootes 0 Feb 11 17:45 /
> d-rwxrwxr-x M 251502 adm    sys    0 Feb 11 17:45 /n/boot

ls -ld /n /n/boot and you will see they have the same mount number.

> It's done here, 9p1.c:1300,1301:
>
>         if(d->qid.path == QPROOT)       /* stat of root gives time */
>                 d->atime = time();
>
> and here, 9p2.c:1431,1432:
>
>                 if(d->qid.path == QPROOT)       /* stat of root gives time */
>                         d->atime = time();
>
> I haven't looked to see if fossil does it.

It does, if only because accessing the root updates atime anyway.

But that's not what I was getting at.  If you dial the file server
yourself and read/write 9P messages, yes, you can get at the
stat info for a file server root.  But via the usual system calls,
the stat info for any mounted file server root is invisible.  You
always see the mount point, never the mounted root.

Russ


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-12  2:26         ` Russ Cox
@ 2006-02-12  3:10           ` Bruce Ellis
  2006-02-12  3:36             ` geoff
  0 siblings, 1 reply; 11+ messages in thread
From: Bruce Ellis @ 2006-02-12  3:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

it would work if stat on PATH/. returned the server's idea.
this is only feasible for a REPLACE, i think union directroies
should return the 'M'.

brucee

On 2/12/06, Russ Cox <rsc@swtch.com> wrote:
> > At least in Ken fs, you want the access time of the root (to get the
> > current fs time):
> >
> > ; date; ls -ldu /n/boot /
> > Sat Feb 11 17:45:13 PST 2006
> > d-r-xr-xr-x /      0 bootes bootes 0 Feb 11 17:45 /
> > d-rwxrwxr-x M 251502 adm    sys    0 Feb 11 17:45 /n/boot
>
> ls -ld /n /n/boot and you will see they have the same mount number.
>
> > It's done here, 9p1.c:1300,1301:
> >
> >         if(d->qid.path == QPROOT)       /* stat of root gives time */
> >                 d->atime = time();
> >
> > and here, 9p2.c:1431,1432:
> >
> >                 if(d->qid.path == QPROOT)       /* stat of root gives time */
> >                         d->atime = time();
> >
> > I haven't looked to see if fossil does it.
>
> It does, if only because accessing the root updates atime anyway.
>
> But that's not what I was getting at.  If you dial the file server
> yourself and read/write 9P messages, yes, you can get at the
> stat info for a file server root.  But via the usual system calls,
> the stat info for any mounted file server root is invisible.  You
> always see the mount point, never the mounted root.
>
> Russ
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-12  3:10           ` Bruce Ellis
@ 2006-02-12  3:36             ` geoff
  2006-02-12  3:53               ` Bruce Ellis
  0 siblings, 1 reply; 11+ messages in thread
From: geoff @ 2006-02-12  3:36 UTC (permalink / raw)
  To: 9fans

cleanname() gets in the way of straightforward attempts to use
`path/.', alas.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-12  3:36             ` geoff
@ 2006-02-12  3:53               ` Bruce Ellis
  2006-02-12 11:06                 ` Russ Cox
  0 siblings, 1 reply; 11+ messages in thread
From: Bruce Ellis @ 2006-02-12  3:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

ouch, didn't think of that so what do you do? a dirread
and check the Qids that way?

brucee

On 2/12/06, geoff@collyer.net <geoff@collyer.net> wrote:
> cleanname() gets in the way of straightforward attempts to use
> `path/.', alas.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Strange date/time on some created files
  2006-02-12  3:53               ` Bruce Ellis
@ 2006-02-12 11:06                 ` Russ Cox
  0 siblings, 0 replies; 11+ messages in thread
From: Russ Cox @ 2006-02-12 11:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

cleanname is used mainly by user-space programs.
the kernel only uses it to handle names of the form
/clean/name/.. -- names ending in a single "/..".  for the
most part the kernel just keeps its names clean to
begin with.

dot is a local fiction provided by the kernel.
file servers never see dot, nor do they show it in listings.

as for stat, i looked at the kernel code, and it looks like
stat should be returning the mounted root info, not the
mount points.  and sure enough, it does!  i'm not sure
what i was seeing before that confused me.  sorry for
confusing all of you.  even union mounts appear to stat
the top guy in the union.

russ


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-02-12 11:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-10 14:50 [9fans] Strange date/time on some created files Gregory Pavelcak
2006-02-10 16:59 ` Russ Cox
2006-02-11  1:12 ` geoff
2006-02-11 15:28   ` Gregory Pavelcak
2006-02-11 15:51     ` Russ Cox
2006-02-12  2:14       ` geoff
2006-02-12  2:26         ` Russ Cox
2006-02-12  3:10           ` Bruce Ellis
2006-02-12  3:36             ` geoff
2006-02-12  3:53               ` Bruce Ellis
2006-02-12 11:06                 ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).