9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Linux 9p timestamps
@ 2006-07-30  5:53 csant
  2006-07-30 15:18 ` [9fans] " Eric Van Hensbergen
  0 siblings, 1 reply; 14+ messages in thread
From: csant @ 2006-07-30  5:53 UTC (permalink / raw)
  To: 9fans

Hola,

mounting a Plan 9 machine with
	# mount -t 9p -o proto=tcp 10.0.0.5 /mnt/9/
on a Linux box with a vanilla kernel 2.6.17.7

On the Plan 9 machine:
	% ls -l tmp/file
	--rw-rw-r-- M 8 csant csant 1188 Jul 30 07:06 tmp/file
and on the Linux machine:
	$ ls -l /mnt/9/usr/csant/tmp/file
	-rw-rw-r--  1 root root 1188 2006-07-30 13:06 /mnt/9/usr/csant/tmp/file

Note that on both machines `date` gives the same, correct time. Why does  
the 9p mount give me a different time?
/c


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

* [9fans] Re: Linux 9p timestamps
  2006-07-30  5:53 [9fans] Linux 9p timestamps csant
@ 2006-07-30 15:18 ` Eric Van Hensbergen
  2006-07-30 19:48   ` C H Forsyth
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Van Hensbergen @ 2006-07-30 15:18 UTC (permalink / raw)
  To: csant; +Cc: V9FS Developers, 9fans

On 7/30/06, csant <csant@csant.info> wrote:
> Hola,
>
> mounting a Plan 9 machine with
>         # mount -t 9p -o proto=tcp 10.0.0.5 /mnt/9/
> on a Linux box with a vanilla kernel 2.6.17.7
>
> On the Plan 9 machine:
>         % ls -l tmp/file
>         --rw-rw-r-- M 8 csant csant 1188 Jul 30 07:06 tmp/file
> and on the Linux machine:
>         $ ls -l /mnt/9/usr/csant/tmp/file
>         -rw-rw-r--  1 root root 1188 2006-07-30 13:06 /mnt/9/usr/csant/tmp/file
>
> Note that on both machines `date` gives the same, correct time. Why does
> the 9p mount give me a different time?
>

Bizarre, never noticed that before -- there is no such anomoly with
the UNIX based server (npfs anyways).   Looking at the stat(5) man
page, looks like 9p is supposed to deliver mtime and atime in terms of
GMT. It would then be the responsibility of the client to adjust for
his/her local time zone.  I don't believe we are doing that at the
moment.  I'll add it to the bug list.  Thanks.

          -eric


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-30 15:18 ` [9fans] " Eric Van Hensbergen
@ 2006-07-30 19:48   ` C H Forsyth
  2006-07-30 22:17     ` erik quanstrom
  0 siblings, 1 reply; 14+ messages in thread
From: C H Forsyth @ 2006-07-30 19:48 UTC (permalink / raw)
  To: 9fans

>It would then be the responsibility of the client to adjust for
>his/her local time zone.

isn't the value of ctime and mtime always in gmt, even on linux?
on unix it was only the programs calling ctime (or relatives)
that finally adjusted for local time, typically before displaying it.
i don't see how the client kernel would or should get involved.


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-30 19:48   ` C H Forsyth
@ 2006-07-30 22:17     ` erik quanstrom
  2006-07-31  3:20       ` Eric Van Hensbergen
  0 siblings, 1 reply; 14+ messages in thread
From: erik quanstrom @ 2006-07-30 22:17 UTC (permalink / raw)
  To: 9fans

yes.  unix and plan 9 both use seconds since epoch to
represent the date and both use an epoch defined in the
GMT timezone.

there shouldn't be any conversion required as the timezone+dst
offset needs to be added only for display.

- erik

On Sun Jul 30 14:51:52 CDT 2006, forsyth@vitanuova.com wrote:
> >It would then be the responsibility of the client to adjust for
> >his/her local time zone.
>
> isn't the value of ctime and mtime always in gmt, even on linux?
> on unix it was only the programs calling ctime (or relatives)
> that finally adjusted for local time, typically before displaying it.
> i don't see how the client kernel would or should get involved.


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-30 22:17     ` erik quanstrom
@ 2006-07-31  3:20       ` Eric Van Hensbergen
  2006-07-31  7:27         ` Steve Simon
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Van Hensbergen @ 2006-07-31  3:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 7/30/06, erik quanstrom <quanstro@quanstro.net> wrote:
> yes.  unix and plan 9 both use seconds since epoch to
> represent the date and both use an epoch defined in the
> GMT timezone.
>
> there shouldn't be any conversion required as the timezone+dst
> offset needs to be added only for display.
>
> - erik
>
> On Sun Jul 30 14:51:52 CDT 2006, forsyth@vitanuova.com wrote:
> > >It would then be the responsibility of the client to adjust for
> > >his/her local time zone.
> >
> > isn't the value of ctime and mtime always in gmt, even on linux?
> > on unix it was only the programs calling ctime (or relatives)
> > that finally adjusted for local time, typically before displaying it.
> > i don't see how the client kernel would or should get involved.
>

okay - I'll bite -- so what's csant's problem then?

          -eric


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31  3:20       ` Eric Van Hensbergen
@ 2006-07-31  7:27         ` Steve Simon
  2006-07-31 18:50           ` erik quanstrom
  0 siblings, 1 reply; 14+ messages in thread
From: Steve Simon @ 2006-07-31  7:27 UTC (permalink / raw)
  To: 9fans

> okay - I'll bite -- so what's csant's problem then?

Timezone tables being trash at one end or the other?

How about 10 lines of C to print stat()'s mtime of the
shared file in decimal from both plan9's point of view
and Unix's?

-Steve


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31  7:27         ` Steve Simon
@ 2006-07-31 18:50           ` erik quanstrom
  2006-07-31 19:27             ` Lluís Batlle
  0 siblings, 1 reply; 14+ messages in thread
From: erik quanstrom @ 2006-07-31 18:50 UTC (permalink / raw)
  To: 9fans

how about
	timezone=GMT date 	# plan 9
and
	date --utc		# linux

if these, differ, you need to take a look at timezones.
then
	syscall -s fstat 0 buf 1024 	< $file	# plan 9
and
	stat $file				# unix
if these differ, maybe v9fs is doing some extra conversion?

- erik

On Mon Jul 31 02:28:46 CDT 2006, steve@quintile.net wrote:
> > okay - I'll bite -- so what's csant's problem then?
>
> Timezone tables being trash at one end or the other?
>
> How about 10 lines of C to print stat()'s mtime of the
> shared file in decimal from both plan9's point of view
> and Unix's?
>
> -Steve


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 18:50           ` erik quanstrom
@ 2006-07-31 19:27             ` Lluís Batlle
  2006-07-31 20:24               ` csant
  2006-07-31 22:12               ` Anthony Sorace
  0 siblings, 2 replies; 14+ messages in thread
From: Lluís Batlle @ 2006-07-31 19:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I don't know if you take that into account, but I think GMT and UTC
are different zones.

GMT is UTC+1 at summer.

(I'm not sure if that's true or not, I got that from an Internet web
page: http://www.timeanddate.com/worldclock/ )

2006/7/31, erik quanstrom <quanstro@quanstro.net>:
> how about
>         timezone=GMT date       # plan 9
> and
>         date --utc              # linux
>
> if these, differ, you need to take a look at timezones.
> then
>         syscall -s fstat 0 buf 1024     < $file # plan 9
> and
>         stat $file                              # unix
> if these differ, maybe v9fs is doing some extra conversion?
>
> - erik
>
> On Mon Jul 31 02:28:46 CDT 2006, steve@quintile.net wrote:
> > > okay - I'll bite -- so what's csant's problem then?
> >
> > Timezone tables being trash at one end or the other?
> >
> > How about 10 lines of C to print stat()'s mtime of the
> > shared file in decimal from both plan9's point of view
> > and Unix's?
> >
> > -Steve
>


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 19:27             ` Lluís Batlle
@ 2006-07-31 20:24               ` csant
  2006-07-31 20:57                 ` Steve Simon
  2006-07-31 22:12               ` Anthony Sorace
  1 sibling, 1 reply; 14+ messages in thread
From: csant @ 2006-07-31 20:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>> how about
>>         timezone=GMT date       # plan 9
	Tue Aug 1 01:33:05 GMT 2006

>> and
>>         date --utc              # linux
	Mon Jul 31 19:33:18 UTC 2006

However, just running `date` on both machines returns the correct values.

>> if these, differ, you need to take a look at timezones.

	% cat /env/timezone
	EST -18000 EDT -14400

Is there something I need to fix?

>> then
>>         syscall -s fstat 0 buf 1024     < $file # plan 9

	[csant] (0000000000003e7f 2 00) --rw-rw-r-- (664) M 8 csant csant 213 Jul  
31 00:51 guide
	        mtime: Mon Jul 31 00:51:12 EDT 2006 (1154321472)
	        atime: Mon Jul 31 20:50:03 EDT 2006 (1154393403)

>> and
>>         stat $file                              # unix

	  File: `/mnt/9/usr/csant/guide'
	  Size: 213             Blocks: 1          IO Block: 16384  regular file
	Device: 12h/18d Inode: 16001       Links: 1
	Access: (0664/-rw-rw-r--)  Uid: (    0/    root)   Gid: (    0/    root)
	Access: 2006-08-01 02:50:03.282078625 +0200
	Modify: 2006-07-31 06:51:12.282078625 +0200
	Change: 2006-07-31 06:51:12.282078625 +0200

/c


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 20:24               ` csant
@ 2006-07-31 20:57                 ` Steve Simon
  2006-07-31 22:04                   ` csant
  0 siblings, 1 reply; 14+ messages in thread
From: Steve Simon @ 2006-07-31 20:57 UTC (permalink / raw)
  To: csant, 9fans

It depends where in the world you are (which timezone).

felix% grep 'EST -18000 EDT -14400' /adm/timezone/*
/adm/timezone/Canada_Eastern:EST -18000 EDT -14400
/adm/timezone/Jamaica:EST -18000 EDT -14400
/adm/timezone/US_East-Indiana:EST -18000 EDT -14400
/adm/timezone/US_Eastern:EST -18000 EDT -14400
/adm/timezone/US_Michigan:EST -18000 EDT -14400

Your timezone is correct for the eastern Americas,
however your domain is registered in Italy, perhaps you
are there?

If so I think you need to do somthing like:
	cp /adm/timezone/CET /adm/timezone/local
and reboot.

Your clock will then be wrong and
need to be reset, this should synchronise things,
or perhaps I have the wrong end of the stick completely.

-Steve


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 20:57                 ` Steve Simon
@ 2006-07-31 22:04                   ` csant
  2006-07-31 22:33                     ` erik quanstrom
  0 siblings, 1 reply; 14+ messages in thread
From: csant @ 2006-07-31 22:04 UTC (permalink / raw)
  To: 9fans

> It depends where in the world you are (which timezone).
>
> felix% grep 'EST -18000 EDT -14400' /adm/timezone/*
> /adm/timezone/Canada_Eastern:EST -18000 EDT -14400
> /adm/timezone/Jamaica:EST -18000 EDT -14400
> /adm/timezone/US_East-Indiana:EST -18000 EDT -14400
> /adm/timezone/US_Eastern:EST -18000 EDT -14400
> /adm/timezone/US_Michigan:EST -18000 EDT -14400
>
> Your timezone is correct for the eastern Americas,
> however your domain is registered in Italy, perhaps you
> are there?

I am in Norway - and obviously still a n00b :)

> If so I think you need to do somthing like:
> 	cp /adm/timezone/CET /adm/timezone/local
> and reboot.

Done, thanks.

> Your clock will then be wrong and
> need to be reset, this should synchronise things,
> or perhaps I have the wrong end of the stick completely.

I guess the end of the stick is right - and so was my clock as well, after
reboot. Creation time of my files is a bit off now, but that doesn't
really matter atm - but at least my Linux and my Plan 9 machines report
the same timestamp, now. Sorry for the confusion.

/c (learning new bits and pieces every day)


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

* Re: Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 19:27             ` Lluís Batlle
  2006-07-31 20:24               ` csant
@ 2006-07-31 22:12               ` Anthony Sorace
  1 sibling, 0 replies; 14+ messages in thread
From: Anthony Sorace @ 2006-07-31 22:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

// GMT is UTC+1 at summer.

you misread the note on that page. UTC and GMT are the same, modulo
leap seconds. GB is currently on British Summer Time, not GMT, and is
one hour ahead of that.


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 22:04                   ` csant
@ 2006-07-31 22:33                     ` erik quanstrom
  2006-07-31 23:06                       ` csant
  0 siblings, 1 reply; 14+ messages in thread
From: erik quanstrom @ 2006-07-31 22:33 UTC (permalink / raw)
  To: csant, 9fans

you're not the first to make this mistake.

- erik

On Mon Jul 31 17:04:52 CDT 2006, csant@csant.info wrote:
> I guess the end of the stick is right - and so was my clock as well, after
> reboot. Creation time of my files is a bit off now, but that doesn't
> really matter atm - but at least my Linux and my Plan 9 machines report
> the same timestamp, now. Sorry for the confusion.
>
> /c (learning new bits and pieces every day)


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

* Re: [9fans] Re: Linux 9p timestamps
  2006-07-31 22:33                     ` erik quanstrom
@ 2006-07-31 23:06                       ` csant
  0 siblings, 0 replies; 14+ messages in thread
From: csant @ 2006-07-31 23:06 UTC (permalink / raw)
  To: erik quanstrom, 9fans

> you're not the first to make this mistake.
Duly added a note to the Tip o' the day. I would have liked to create a
new page on the wiki to link to as an additional step to perform after
Installation, Creating a new user and Configuring the network - but how
does one create a new, non-existing page?

/c


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

end of thread, other threads:[~2006-07-31 23:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-30  5:53 [9fans] Linux 9p timestamps csant
2006-07-30 15:18 ` [9fans] " Eric Van Hensbergen
2006-07-30 19:48   ` C H Forsyth
2006-07-30 22:17     ` erik quanstrom
2006-07-31  3:20       ` Eric Van Hensbergen
2006-07-31  7:27         ` Steve Simon
2006-07-31 18:50           ` erik quanstrom
2006-07-31 19:27             ` Lluís Batlle
2006-07-31 20:24               ` csant
2006-07-31 20:57                 ` Steve Simon
2006-07-31 22:04                   ` csant
2006-07-31 22:33                     ` erik quanstrom
2006-07-31 23:06                       ` csant
2006-07-31 22:12               ` Anthony Sorace

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).