Subject: kern/26154: NFS server doesn't update mtime when file is modified
To: None <>
From: Manuel Bouyer <>
List: netbsd-bugs
Date: 07/03/2004 23:12:43
>Number:         26154
>Category:       kern
>Synopsis:       NFS server doesn't update mtime when file is modified
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 03 21:13:00 UTC 2004
>Originator:     Manuel Bouyer
>Release:        NetBSD 2.0_BETA, sources as of Jul, 3
System: NetBSD 2.0_BETA NetBSD 2.0_BETA (CHASSIRON) #0: Sat Jul 3 19:31:18 CEST 2004 sparc
Architecture: sparc
Machine: sparc
	When a file is modified from a NFS client (for example, appending
	data with echo foo >> file from shell), the mtime on the server
	isn't updated, as shown by the following test program.
	Tested from a 2.0 client; a 2.0 client with a 1.6.2 server gives
	the expected result.
	touch(1) also update the mtime as expected.

#include <sys/stat.h>

        struct stat st;

        while (1) {
                stat("/home/bouyer/Mail/Inbox.test", &st);
                printf("size %ld atime %ld mtime %ld\n", st.st_size, st.st_atime, st.st_mtime);

	Adjust the file path in the above test program.
	Run on the NFS server.
	On a client, append data to the file, for example with a
	shell redirection. Notice the 'mtime' desn't change in the output
	of the test program.
	Rewriting a mailbox with mutt makes the problem show up too.