From bp@butya.kz Thu Jul 15 05:04:55 1999
Return-Path: <bp@butya.kz>
Received: from lion.butya.kz (butya-gw.butya.kz [194.87.112.252])
	by hub.freebsd.org (Postfix) with ESMTP id BEEC814C36
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 15 Jul 1999 05:04:40 -0700 (PDT)
	(envelope-from bp@butya.kz)
Received: from bp by lion.butya.kz with local (Exim 2.12 #1)
	id 114kFb-0008z4-00
	for FreeBSD-gnats-submit@freebsd.org; Thu, 15 Jul 1999 19:04:31 +0700
Message-Id: <E114kFb-0008z4-00@lion.butya.kz>
Date: Thu, 15 Jul 1999 19:04:31 +0700
From: bp@butya.kz
Reply-To: bp@butya.kz
To: FreeBSD-gnats-submit@freebsd.org
Subject: NFS readdirplus call is broken (with patch)
X-Send-Pr-Version: 3.2

>Number:         12651
>Category:       kern
>Synopsis:       NFS readdirplus call is broken (with patch)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 15 05:10:01 PDT 1999
>Closed-Date:    Thu Jul 29 21:53:47 PDT 1999
>Last-Modified:  Thu Jul 29 21:55:39 PDT 1999
>Originator:     Boris Popov
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
>Environment:

	FreeBSD-stable, FreeBSD-current

>Description:

	Hash value calculation in componentname.cn_hash structure
has been changed and this change isn't reflected in NFS 
nfs_readdirplusrpc() function.

>How-To-Repeat:

	Code works but not in the way that it was designed.

>Fix:

--- org/nfs_vnops.c	Thu Jul 15 12:35:14 1999
+++ nfs_vnops.c	Thu Jul 15 18:56:42 1999
@@ -2357,7 +2357,7 @@
 				cnp->cn_hash = 0;
 				for (cp = cnp->cn_nameptr, i = 1; i <= len;
 				    i++, cp++)
-				    cnp->cn_hash += (unsigned char)*cp * i;
+				    cnp->cn_hash += (unsigned char)*cp;
 			        cache_enter(ndp->ni_dvp, ndp->ni_vp, cnp);
 			    }
 			} else {

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wpaul 
State-Changed-When: Thu Jul 29 21:53:47 PDT 1999 
State-Changed-Why:  

Patch applied to both the -current and -stable branches. Also note that 
other bugs in nfs_readdirplusrpc() and nfsrv_readdirplus() were recently 
fixed. 

-Bill 
>Unformatted:
