mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] NFS no longer updates file modification times appropriately
@ 2004-06-03 20:28 Joe Korty
  2004-06-03 21:11 ` Trond Myklebust
  0 siblings, 1 reply; 15+ messages in thread
From: Joe Korty @ 2004-06-03 20:28 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-kernel

Trond,
 Paraphrased from one of my inhouse customers: "The timestamp of an
NFS-mounted file does not change when written to, when the below test is
run on a 2.6.6-rc1 to 2.6.7-rc2 kernel.  The timestamp is appropriately
updated when the test is run on a 2.6.5 kernel.  This is with NFSv3.
The type of system serving up the files does not seem to be a factor."

I was not able to narrow the problem/featureset change down to a cset.

Attached is the test program my customer used.

Regards,
Joe

#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>

#define PATH "./my_file"

int
main()
{
	int status;
	int count = 0;
	int fd;
	struct stat wuz;
	struct stat iz;

	(void) unlink(PATH);

	fd = open (PATH, O_RDWR+O_CREAT+O_SYNC, 0666);
	if (fd < 0) {
		fprintf (stderr, "open(%s) fails, errno = %d\n", PATH, errno);
		return 1;
	}

	status = fstat (fd, &wuz);
	if (status) {
		fprintf (stderr, "fstat(%s) fails, errno = %d\n", PATH, errno);
		return 1;
	}

	for (;;) {
		status = write (fd, &status, sizeof(status));
		if (status != sizeof(status)) {
			fprintf (stderr, "write(%s) fails, errno = %d\n", PATH, errno);
			return 1;
		}
		status = fstat (fd, &iz);
		if (status) {
			fprintf (stderr, "fstat(%s) fails, errno = %d\n", PATH, errno);
			return 1;
		}
		if (iz.st_mtime != wuz.st_mtime) break;
		count++;
		if (count % 1000 == 0) {
			printf ("count = %d\n", count);
		}
	}

	printf ("File modification time changed after %d iterations\n", count);
}

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-06-07 17:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-03 20:28 [BUG] NFS no longer updates file modification times appropriately Joe Korty
2004-06-03 21:11 ` Trond Myklebust
2004-06-04  3:25   ` Ingo Oeser
2004-06-06 19:17     ` Trond Myklebust
2004-06-04 13:23   ` Joe Korty
2004-06-04 23:08     ` Trond Myklebust
2004-06-04 23:24       ` Stephen Hemminger
2004-06-04 23:37         ` Trond Myklebust
2004-06-07 15:21   ` Joe Korty
2004-06-07 15:51     ` Trond Myklebust
2004-06-07 16:13       ` Joe Korty
2004-06-07 16:20         ` Trond Myklebust
2004-06-07 16:39           ` Joe Korty
2004-06-07 16:53             ` Trond Myklebust
2004-06-07 17:01               ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®