kern/76126: FreeBSD 4.11 client will send a NFS request to rename a file to itself to the NFS server, no error returned

Michael Conlen meconlen at obfuscated.net
Tue Jan 11 22:30:37 PST 2005


>Number:         76126
>Category:       kern
>Synopsis:       FreeBSD 4.11 client will send a NFS request to rename a file to itself to the NFS server, no error returned
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 12 06:30:37 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Michael Conlen
>Release:        FreeBSD 4.11-STABLE client FreeBSD 5.3-p3 Server
>Organization:
Obfuscated Networking
>Environment:
FreeBSD web10.tarhost.com 4.11-STABLE FreeBSD 4.11-STABLE #2: Mon Jan  3 19:30:17 EST 2005     root at web10.tarhost.com:/usr/obj/usr/src/sys/WWW  i386

>Description:
A FreeBSD 4.11 client keeps sending requests to move a file to the same file name. The server complains but there's no error on the client to say hey! bad software! bad!
>How-To-Repeat:
on an NFS mounted filesystem 

$ echo foo > foo
$ mv foo foo
$ echo $?
0
$
>Fix:
The following patch should work

$ diff -u `pwd`/nfs_vnops.c.orig `pwd`/nfs_vnops.c
--- /usr/src/sys/nfs/nfs_vnops.c.orig   Wed Jan 12 00:15:42 2005
+++ /usr/src/sys/nfs/nfs_vnops.c        Wed Jan 12 01:00:41 2005
@@ -1647,6 +1647,12 @@
                goto out;
        }
 
+       if (fvp == tvf) {
+               printf("nfs_rename: fvp == tvp (can't happen)\n");
+               error = 0;
+               goto out;
+       }
+
        /*
         * We have to flush B_DELWRI data prior to renaming
         * the file.  If we don't, the delayed-write buffers
      
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list