Subject: kern/26154: NFS server doesn't update mtime when file is modified
To: None <gnats-bugs@gnats.NetBSD.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
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
>Closed-Date:
>Last-Modified:
>Originator:     Manuel Bouyer
>Release:        NetBSD 2.0_BETA, sources as of Jul, 3
>Organization:
>Environment:
	
	
System: NetBSD chassiron.antioche.eu.org 2.0_BETA NetBSD 2.0_BETA (CHASSIRON) #0: Sat Jul 3 19:31:18 CEST 2004 bouyer@pop.lip6.fr:/local/pop1/bouyer/tmp/sparc/obj/local/pop1/bouyer/netbsd-2-0/src/sys/arch/sparc/compile/CHASSIRON sparc
Architecture: sparc
Machine: sparc
>Description:
	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>

main()
{
        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);
                sleep(10);
        }
}

>How-To-Repeat:
	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.
>Fix:
	unknown
>Release-Note:
>Audit-Trail:
>Unformatted: