Subject: Re: namei caching of newly created files?
To: None <ups@tree.com>
From: Havard Eidnes <he@uninett.no>
List: tech-kern
Date: 01/20/2005 19:35:38
> OK, does this look any better?

Regrettably, this second try caused pool corruption, and the
reason was caught with a DIAGNOSTIC kernel -- cache_enter really
only accepts names up to NCHNAMLEN from <sys/namei.h>.

Revised patch which appears more stable is:

Index: ufs_vnops.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/ufs/ufs/ufs_vnops.c,v
retrieving revision 1.123
diff -u -r1.123 ufs_vnops.c
--- ufs_vnops.c	21 Sep 2004 03:10:36 -0000	1.123
+++ ufs_vnops.c	20 Jan 2005 18:30:58 -0000
@@ -2114,6 +2114,8 @@
 	pool_put(&ufs_direct_pool, newdir);
 	if (error)
 		goto bad;
+	if (cnp->cn_namelen <=3D NCHNAMLEN)
+		cache_enter(dvp, tvp, cnp);
 	if ((cnp->cn_flags & SAVESTART) =3D=3D 0)
 		PNBUF_PUT(cnp->cn_pnbuf);
 	vput(dvp);

Regards,

- H=E5vard