Module Name:    src
Committed By:   dennis
Date:           Fri Jan 16 20:10:25 UTC 2015

Modified Files:
        src/sys/kern: vfs_cache.c

Log Message:
Add a membar_datadep_consumer() before dereferencing the pointer
to a cache entry in cache_lookup_entry().  The entries are being
added to the list it is looking at without mutually-exclusive locking,
so this is necessary to keep some Alphas from seeing stale data
when the pointer is newly-updated.

XXX this is doing lockless adds to a list maintained with LIST_* macros.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/kern/vfs_cache.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.104 src/sys/kern/vfs_cache.c:1.105
--- src/sys/kern/vfs_cache.c:1.104	Sun Jan  4 19:31:00 2015
+++ src/sys/kern/vfs_cache.c	Fri Jan 16 20:10:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.104 2015/01/04 19:31:00 pooka Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.105 2015/01/16 20:10:25 dennis Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.104 2015/01/04 19:31:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.105 2015/01/16 20:10:25 dennis Exp $");
 
 #include "opt_ddb.h"
 #include "opt_revcache.h"
@@ -397,7 +397,7 @@ cache_lookup_entry(const struct vnode *d
 	ncpp = &nchashtbl[NCHASH2(hash, dvp)];
 
 	LIST_FOREACH(ncp, ncpp, nc_hash) {
-		/* XXX Needs barrier for Alpha here */
+		membar_datadep_consumer();	/* for Alpha... */
 		if (ncp->nc_dvp != dvp ||
 		    ncp->nc_nlen != namelen ||
 		    memcmp(ncp->nc_name, name, (u_int)ncp->nc_nlen))

Reply via email to