Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/ad-namecache]: src/sys/kern Add a missing membar to previous.



details:   https://anonhg.NetBSD.org/src/rev/5fc647a61e48
branches:  ad-namecache
changeset: 744156:5fc647a61e48
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Jan 25 18:42:24 2020 +0000

description:
Add a missing membar to previous.

diffstat:

 sys/kern/vfs_cwd.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 0b3a08b1152e -r 5fc647a61e48 sys/kern/vfs_cwd.c
--- a/sys/kern/vfs_cwd.c        Sat Jan 25 15:54:03 2020 +0000
+++ b/sys/kern/vfs_cwd.c        Sat Jan 25 18:42:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_cwd.c,v 1.4.62.1 2020/01/25 15:54:03 ad Exp $      */
+/*     $NetBSD: vfs_cwd.c,v 1.4.62.2 2020/01/25 18:42:24 ad Exp $      */
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_cwd.c,v 1.4.62.1 2020/01/25 15:54:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cwd.c,v 1.4.62.2 2020/01/25 18:42:24 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -183,8 +183,10 @@
                 * changes while the caller is pondering the cwdinfo.
                 */
                kpreempt_disable();
-               if (__predict_true(mutex_owner(&cwdi->cwdi_lock) == NULL))
+               if (__predict_true(mutex_owner(&cwdi->cwdi_lock) == NULL)) {
+                       membar_consumer();
                        return cwdi;
+               }
                kpreempt_enable();
                mutex_enter(&cwdi->cwdi_lock);
        } else {



Home | Main Index | Thread Index | Old Index