This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Fri Apr 19 06:27:19 2024 Received: from nic.funet.fi (nic.funet.fi [128.214.248.6]) by herbie.ucs.indiana.edu (8.7.5/8.6.12) with ESMTP id IAA16841 for ; Thu, 26 Sep 1996 08:18:41 -0500 (EST) Received: from vger.rutgers.edu ([128.6.190.2]) by nic.funet.fi with ESMTP id <74216-13344>; Thu, 26 Sep 1996 15:14:38 +0300 Received: by vger.rutgers.edu id <22260-18788>; Thu, 26 Sep 1996 07:49:39 -0400 Date: Wed, 25 Sep 1996 11:09:02 -0700 From: Gordon Chaffee Message-Id: <199609251809.LAA22753@odie.CS.Berkeley.EDU> To: linux-kernel@vger.rutgers.edu Subject: Filesystems patch for Daylight Savings Time Sender: owner-linux-kernel@vger.rutgers.edu Precedence: bulk Some time ago, there was a report of a bug when writing the times to files on FAT filesystems when daylight savings time is in effect. The problem is that conversions from local time to GMT time and vice versa do not take into account daylight savings time. This problem seems to affect the hpfs, vfat, msdos, smbfs, and ncpfs filesystems. I believe it also affects affs, but I did not create a patch for it. I looked into daylight savings time, and all daylight savings times that I could find references to had offsets of one hour. If there are any cases where daylight savings time has an offset different than an hour, please let me know. Here is a patch again linux-2.0.0 to fix this problem. It should apply to just about any kernel since I don't believe the affected routines have been changed it quite awhile. Gordon Chaffee chaffee@plateau.cs.berkeley.edu --- linux/fs/hpfs/hpfs_fs.c.orig Tue Feb 20 00:28:13 1996 +++ linux/fs/hpfs/hpfs_fs.c Wed Sep 25 10:52:07 1996 @@ -321,7 +321,7 @@ static inline time_t local_to_gmt(time_t t) { extern struct timezone sys_tz; - return t + sys_tz.tz_minuteswest * 60; + return t + sys_tz.tz_minuteswest * 60 - (sys_tz.tz_dsttime ? 3600 : 0); } /* super block ops */ --- linux/fs/smbfs/proc.c.orig Thu Jun 6 15:56:30 1996 +++ linux/fs/smbfs/proc.c Wed Sep 25 10:52:46 1996 @@ -169,13 +169,15 @@ static int utc2local(int time) { - return time - sys_tz.tz_minuteswest*60; + return time - sys_tz.tz_minuteswest*60 + + (sys_tz.tz_dsttime ? 3600 : 0); } static int local2utc(int time) { - return time + sys_tz.tz_minuteswest*60; + return time + sys_tz.tz_minuteswest*60 - + (sys_tz.tz_dsttime ? 3600 : 0); } /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */ --- linux/fs/fat/misc.c.orig Fri May 17 11:44:39 1996 +++ linux/fs/fat/misc.c Wed Sep 25 10:53:27 1996 @@ -244,6 +244,9 @@ month < 2 ? 1 : 0)+3653); /* days since 1.1.70 plus 80's leap day */ secs += sys_tz.tz_minuteswest*60; + if (sys_tz.tz_dsttime) { + secs -= 3600; + } return secs; } --- linux/fs/ncpfs/dir.c.orig Tue Jun 4 16:12:18 1996 +++ linux/fs/ncpfs/dir.c Wed Sep 25 10:53:57 1996 @@ -1173,13 +1173,15 @@ static int utc2local(int time) { - return time - sys_tz.tz_minuteswest*60; + return time - sys_tz.tz_minuteswest*60 + + (sys_tz.tz_dsttime ? 3600 : 0); } static int local2utc(int time) { - return time + sys_tz.tz_minuteswest*60; + return time + sys_tz.tz_minuteswest*60 - + (sys_tz.tz_dsttime ? 3600 : 0); } /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */