From: Vince Busam <vbusam@google.com>
To: nfs@lists.sourceforge.net
Subject: mtime not updated in client cache?
Date: Mon, 28 Nov 2005 16:09:40 -0800 [thread overview]
Message-ID: <438B9C44.4030305@google.com> (raw)
The following code snippet run on a 2.6.13.4 (+CITI patch) client shows that mtime doesn't
get updated unless fclose() is called before stat, or O_DIRECT is used. In 2.4, the stat
would return an updated mtime. Is this a bug, or expected cache behavior?
Thanks,
Vince
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
int main(int argc, char **argv) {
time_t tm;
struct stat statinfo;
FILE *fp = fopen("testfile", "w");
sleep(2);
tm = time(NULL);
fwrite("X", 1, 1, fp);
fflush(fp);
stat("testfile", &statinfo);
if (statinfo.st_mtime < tm) {
printf("Bug: write time = %u, mtime = %u\n", tm, statinfo.st_mtime);
}
fclose(fp);
return 0;
}
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next reply other threads:[~2005-11-29 0:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 0:09 Vince Busam [this message]
2005-11-29 0:45 ` mtime not updated in client cache? Trond Myklebust
2005-12-01 1:06 ` Vince Busam
2005-12-01 1:15 ` Trond Myklebust
2005-12-08 1:22 ` Vince Busam
2005-12-08 3:38 ` Trond Myklebust
2005-12-09 14:06 ` Peter Staubach
2005-12-09 14:16 ` Trond Myklebust
2005-12-09 14:24 ` Peter Staubach
2005-12-09 15:19 ` Trond Myklebust
2005-12-13 1:51 ` Vince Busam
-- strict thread matches above, loose matches on Subject: below --
2005-12-09 15:56 Lever, Charles
2005-12-09 16:10 ` Trond Myklebust
2005-12-09 16:40 ` Peter Staubach
2005-12-09 19:07 Lever, Charles
2005-12-09 19:20 ` Peter Staubach
2005-12-09 19:55 ` Roger Heflin
2005-12-09 21:05 ` Peter Staubach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=438B9C44.4030305@google.com \
--to=vbusam@google.com \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.