Subject: Bug in MSDOSFS - deupdat()
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Mike Hartman <mikeh@hds.com>
List: netbsd-bugs
Date: 08/26/1994 15:28:29
Bug report for MSDOSFS, NetBSD current distribution.
File: msdosfs_denode.c
Function: deupdat()
Description: The modification time that gets set in the directory entry
comes from the kernel 'time' timeval, instead of the time that
was passed as an argument. deupdat() is normally called with
the kernel 'time' timeval, the exception is in
msdosfs_setattr().
Additionally, the second argument to deupdat() should be type
"struct timeval *" not "struct timespec *".
Sample fix follows.
--
Michael Hartman |
Software Engineer | Internet: mikeh@hds.com
Human Designed Systems, Inc. |
421 Feheley Drive | phone: (610) 277-8300
King of Prussia, PA 19406 (USA) | FAX: (610) 275-5739
----------------------------------------------------------------
P.S. - I have other bugs to report in MSDOSFS. If my bug reports should have
a different format, please let me know.
Sample fix:
*** msdosfs_denode.c Fri Aug 19 09:32:50 1994
--- msdosfs_denode.c Fri Aug 26 15:13:14 1994
***************
*** 300,310 ****
}
int
deupdat(dep, tp, waitfor)
struct denode *dep;
! struct timespec *tp;
int waitfor;
{
int error;
daddr_t bn;
int diro;
--- 300,310 ----
}
int
deupdat(dep, tp, waitfor)
struct denode *dep;
! struct timeval *tp;
int waitfor;
{
int error;
daddr_t bn;
int diro;
***************
*** 339,349 ****
return error;
/*
* Put the passed in time into the directory entry.
*/
! TIMEVAL_TO_TIMESPEC(&time, &ts);
unix2dostime(&ts, &dep->de_Date, &dep->de_Time);
dep->de_flag &= ~DE_UPDATE;
/*
* Copy the directory entry out of the denode into the cluster it
--- 339,349 ----
return error;
/*
* Put the passed in time into the directory entry.
*/
! TIMEVAL_TO_TIMESPEC(tp, &ts);
unix2dostime(&ts, &dep->de_Date, &dep->de_Time);
dep->de_flag &= ~DE_UPDATE;
/*
* Copy the directory entry out of the denode into the cluster it
------------------------------------------------------------------------------