From nobody  Sun Mar  1 10:02:02 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id KAA10519;
          Sun, 1 Mar 1998 10:02:02 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199803011802.KAA10519@hub.freebsd.org>
Date: Sun, 1 Mar 1998 10:02:02 -0800 (PST)
From: remy@synx.com
To: freebsd-gnats-submit@freebsd.org
Subject: NFS server Side say NFSERR_BAD_COOKIE (rm -r fails)
X-Send-Pr-Version: www-1.0

>Number:         5888
>Category:       kern
>Synopsis:       NFS server Side say NFSERR_BAD_COOKIE (rm -r fails)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    steve
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar  1 10:29:39 PST 1998
>Closed-Date:    Sun Mar 1 10:40:53 PST 1998
>Last-Modified:  Sun Mar  1 10:41:38 PST 1998
>Originator:     Remy NONNENMACHER
>Release:        3.0-971225-SNAP
>Organization:
Synchronix
>Environment:
FreeBSD fs2.synx.com 3.0-971225-SNAP FreeBSD 3.0-971225-SNAP #4: Wed Feb 18 11:25:23 GMT 1998     root@fs2.synx.com:/usr/src/sys/compile/FS2  i386

>Description:
Client is a Solaris 2.5.1 client machine running NFS V3. Server is the FreeBSD.
The exported directory is a plain one (no cross-mount).
When the client do a rm -r of the directory, it gets a 'directory not empty' error.
I tcpdumped the flow and found the following operations :
Client : Stat directory
Server : stat is .... COOKIE=XXX
Client : (stat files in directory and remove files)
Server : (OK a each operation)
Client : rmdir COOKIE=XXX
Server : Error : Invalid COOKIE (NFSERR_BAD_COOKIE)

Files in directory are not removed and client get the 'dir not empty' error.
It seems that the problem doesn't appear on all directories but for ones
with many files.

PS: I'm not able to say if it's a Client or Server error. It may comes from the
way the cookie is generated (directory has changed) or a Solaris misuses of a cookie value.

>How-To-Repeat:
I can reproduce the problem and trace it on a specific directory. Don't know the
exact conditions. I can investigate if it may help.
>Fix:
By commented out the COOKIE test (sys/nfs/nfs_serv.c, v 1.52 1997/10/28 15:59:05 bde Exp)
line 2578 and 2833 and all went OK.
(I guessed the VOP_GETATTR was sufficient for consistency. (guessed only)).



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Mar 1 10:40:53 PST 1998 
State-Changed-Why:  
Duplicate of kern/5890. 


Responsible-Changed-From-To: freebsd-bugs->steve 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sun Mar 1 10:40:53 PST 1998 
Responsible-Changed-Why:  

>Unformatted:
