From nobody@FreeBSD.org  Tue Mar 29 15:57:31 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9C25F16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Mar 2005 15:57:31 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4C76A43D39
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Mar 2005 15:57:31 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j2TFvVLK060400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Mar 2005 15:57:31 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j2TFvUwN060399;
	Tue, 29 Mar 2005 15:57:30 GMT
	(envelope-from nobody)
Message-Id: <200503291557.j2TFvUwN060399@www.freebsd.org>
Date: Tue, 29 Mar 2005 15:57:30 GMT
From: Bob Johnson <bob89@eng.ufl.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FBSD NFS client doesn't detect file updates on Novell NFS server
X-Send-Pr-Version: www-2.3

>Number:         79336
>Category:       kern
>Synopsis:       [nfs] NFS client doesn't detect file updates on Novell NFS server
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 29 16:00:06 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Mar 12 15:31:13 GMT 2007
>Originator:     Bob Johnson
>Release:        4.7, 5.3, 5.4-Pre
>Organization:
University of Florida
>Environment:
FreeBSD scanner.engnet.ufl.edu 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #5: Wed Mar  2 00:25:02 EST 2005     b@scanner.engnet.ufl.edu:/usr/obj/usr/src/sys/B28  i386

also 4.7 and 5.3 systems
>Description:
FreeBSD NFS client doesn't always detect that a file has changed on a Novell 6.5 NFS server.  Problem does not exist with Novell 5.1.  Novell has discussion of issue in a TID at http://support.novell.com/cgi-bin/search/searchtid.cgi?/10097113.htm and is still considering fixing it at their end.  If I correctly understand their analysis, they believe that the "normal" method of detecting a file update is to look at the directory modification time and invalidate the entire directory cache if it has changed, so their server does not update individual file timestamps, while FreeBSD bases cache updates on file timestamp changes and thus doesn't see that the file has changed.

Notes:
1) This problem did not exist in the Novell 5.1 NFS server implementation.
2) Novell advertises that their NFS server works with FreeBSD 4.7.
3) Novell's TID linked above asserts that this is a bug in FreeBSD (but they are considering modifying their server to accomodate it).
>How-To-Repeat:
1) Find a Novell 6.5 NFS server and mount volume with FreeBSD client:
# mount_nfs novell.my.net:/shared /mnt

2) Create file:
# echo "This is a test" > /mnt/test.txt

3) View contents of the file from FreeBSD, 
# cat /mnt/test.txt
This is a test

4) From a Netware client, copy the file from the Novell server to the
local client, edit the file, and copy it back to the server.  This
sequence is important, as editing the file in place on the server does
not seem to produce the problem.  Unfortunately, this copy-update-copy
sequence is a common method of allowing users to update their information
on, for example, a web server using a local HTML editor.

5) View contents of file from FreeBSD again:
# cat /mnt/test.txt
This is a test

6) Force FreeBSD to update file timestamp and look at it again:
# touch /mnt/test.txt
# cat /mnt/test.txt
This is a different test


>Fix:
Novell may decide to fix this in their server.

FreeBSD 5.3 NWFS and SMB clients also do not work with Novell servers (at least not ours), so they are not usable workarounds.
>Release-Note:
>Audit-Trail:

From: Bob Johnson <bob89@eng.ufl.edu>
To: freebsd-gnats-submit@FreeBSD.org, bob89@eng.ufl.edu
Cc:  
Subject: Re: kern/79336: [nfs] NFS client doesn't detect file updates on Novell NFS server
Date: Fri, 8 Apr 2005 00:16:14 -0400

 Novell has informed us that they believe their server complies with the NFS 
 RFCs and they will not fix this problem.
 
 I have done a packet trace and confirmed their description: when a file is 
 replaced by a new copy of the file on a Novell NFS server, the file 
 timestamps sent to the NFS client do not change.  According to Novell, the 
 NFS client is expected to detect that the mtime of the parent directory has 
 changed, and do new LOOKUPs to get the timestamps for the file itself.  The 
 FreeBSD client instead does an ACCESS query on the file, which shows the 
 timestamps unchanged.  The FreeBSD server thus uses its cached copy rather 
 than fetching the new file contents from the server.  I do not agree with 
 Novell's contention that their server complies with the NFS RFCs, but that 
 doesn't solve the problem.
 
 touch-ing the file on the BSD server seems to force the timestamps to be 
 updated, thus forcing the file contents on the client to update and may be 
 the basis of a usable workaround in some situations.
 
 Deleting the file from the Novell NFS server before copying the new version to 
 the server does not cause this problem, and should be a workaround for some 
 situations.  Similarly, editing the file in place on the NFS server does not 
 seem to cause the problem.
 
 It does not appear to be possible to disable the cache on the FreeBSD client.
 
 
Responsible-Changed-From-To: freebsd-bugs->cel 
Responsible-Changed-By: cel 
Responsible-Changed-When: Fri May 12 21:08:38 UTC 2006 
Responsible-Changed-Why:  
I'm going to look at this, but I think Novell's engineering is dead 
wrong here.  There is no way *any* NFS client can detect changes in 
a file's data if the server doesn't update mtime on the file when 
the data changes. 

I know some folks at Novell/SuSE and maybe they can connect me to 
the right engineers to help out. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=79336 
Responsible-Changed-From-To: cel->freebsd-bugs 
Responsible-Changed-By: cel 
Responsible-Changed-When: Mon Mar 12 15:30:59 UTC 2007 
Responsible-Changed-Why:  
Back to the public pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79336 
>Unformatted:
