[PVFS-developers] Timestamp Problem
Porter Don
PorterDE@mercury.hendrix.edu
Mon, 20 Oct 2003 16:48:47 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C39753.F0B26A10
Content-Type: text/plain
I have been seeing some problems with newly created files having a timestamp
of Dec 31 1969 until they are closed for the first time. In general this is
only a bit annoying, but it can cause problems on a particular machine that
has a process deleting files that are older than a certain number of days.
Anyway, in md_open, the timestamps seem to be cached from the request, as
opposed to using the time values from the newly created metadata file.
These values are being initialized to 0, causing the 12-31-69 timestamp.
Attached is a patch which cuts this caching out and just uses the timestamp
on the newly created metadata file until the file is closed.
Thanks,
Don
------_=_NextPart_000_01C39753.F0B26A10
Content-Type: application/octet-stream;
name="timestamp.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="timestamp.patch"
diff -ur pvfs-1.6.0/mgr/meta/md_open.c pvfs-time/mgr/meta/md_open.c=0A=
--- pvfs-1.6.0/mgr/meta/md_open.c Wed May 7 11:37:30 2003=0A=
+++ pvfs-time/mgr/meta/md_open.c Mon Oct 20 16:05:56 2003=0A=
@@ -112,10 +112,7 @@=0A=
uid =3D request->req.open.meta.u_stat.st_uid;=0A=
gid =3D request->req.open.meta.u_stat.st_gid;=0A=
orig_mode =3D request->req.open.meta.u_stat.st_mode;=0A=
- atime =3D request->req.open.meta.u_stat.atime;=0A=
- ctime =3D request->req.open.meta.u_stat.ctime;=0A=
- mtime =3D request->req.open.meta.u_stat.mtime;=0A=
-=0A=
+ =0A=
{=0A=
struct stat sb;=0A=
if (fstat(fd, &sb) < 0) {=0A=
@@ -128,9 +125,6 @@=0A=
request->req.open.meta.u_stat.st_gid =3D gid;=0A=
request->req.open.meta.u_stat.st_mode =3D=0A=
S_IFREG | ((S_IRWXO | S_IRWXG | S_IRWXU) & orig_mode);=0A=
- request->req.open.meta.u_stat.atime =3D atime;=0A=
- request->req.open.meta.u_stat.ctime =3D ctime;=0A=
- request->req.open.meta.u_stat.mtime =3D mtime;=0A=
=0A=
if (meta_write(fd, &(request->req.open.meta)) < 0)=0A=
{ =0A=
Only in pvfs-time/mgr/meta: md_open.c~=0A=
------_=_NextPart_000_01C39753.F0B26A10--