Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2005 11:37:02 +1100
From:      Antony Mawer <fbsd-questions@mawer.org>
To:        Gilbert Cao <hika@bsdmon.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: One hour offset with smbfs
Message-ID:  <43B5D2AE.2050603@mawer.org>
In-Reply-To: <20051230231627.GA15040@bsdmon.com>
References:  <20051230231627.GA15040@bsdmon.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 31/12/2005 10:16 AM, Gilbert Cao wrote:
> I just ran into a small problem with modification time with smbfs :
> My smb client machine is a FreeBSD 6.0 with GMT+1.
> My smb server machine is a FreeBSD 5.4 with also GMT+1.
> 
> I have noticed a one hour offset between a file's modification time when
> I `ls -l file` from the smb client machine and the same file's
> modification time when I `ls -l file` from the smb server machine.
> That file stands in a smb shared directory, on the smb server.
> 
> More, I have noticed this, only for a datetime like 1st April, 2005.
> For a datetime like 1st December 2005, the problem does not occur.
> 
> For example,
> from the smb client side, I see a modification time of
> 2005-04-01 00:00:00, and
> from the smb server side, I see a modification time of
> 2005-03-31 23:00:00.
> 
> When I do a `touch -t 200504010000.00 file` from the smb server side,
> I see 2005-04-01 01:00:00, from the smb client side.
> When I do a `touch -t 200504010000.00 file` from the smb client side,
> I see 2005-03-31 23:00:00, from the smb server side.
> 
> It seems that it is only a matter with summer time.
> 
> Anyone know if something can be done about this ?
> I guess the problem is on the smbfs client side ...

This appears to be a problem with smbfs when dealing with timestamps in 
daylight savings time (or summer time, as you refer to it). I looked 
into it briefly, and from what I read it seems the kernel is divorced of 
knowing anything about daylight savings time (only a boolean value 
indicating whether or not it is currently daylight savings or not is 
maintained).

This means when times from the SMB server are translated, the kernel 
can't adjust the date/time stamps to compensate for the DST offset, as 
it doesn't know what the offset is... (not everwhere uses an hour 
difference for DST)

I'd love for someone to correct me and tell me that there's an easy way 
to fix this issue -- this was just my deduction after a brief look into 
the matter.

Cheers
Antony




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43B5D2AE.2050603>