Source-Changes-HG archive

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

[src/trunk]: src/tests/rump/rumpvfs Lock vnode for VOP_LOOKUP().



details:   https://anonhg.NetBSD.org/src/rev/22a19dda1ac5
branches:  trunk
changeset: 365914:22a19dda1ac5
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue May 03 07:36:20 2022 +0000

description:
Lock vnode for VOP_LOOKUP().

diffstat:

 tests/rump/rumpvfs/t_p2kifs.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 8bb461e81867 -r 22a19dda1ac5 tests/rump/rumpvfs/t_p2kifs.c
--- a/tests/rump/rumpvfs/t_p2kifs.c     Tue May 03 07:35:43 2022 +0000
+++ b/tests/rump/rumpvfs/t_p2kifs.c     Tue May 03 07:36:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_p2kifs.c,v 1.6 2017/01/13 21:30:43 christos Exp $    */
+/*     $NetBSD: t_p2kifs.c,v 1.7 2022/05/03 07:36:20 hannken Exp $     */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -70,6 +70,9 @@
        /* need stable lwp for componentname */
        RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
 
+       /* obey vnode locking rules */
+       RZ(RUMP_VOP_LOCK(rumpns_rootvnode, RUMP_LK_EXCLUSIVE));
+
        /* try it once with the right path */
        cn = rump_pub_makecn(RUMP_NAMEI_LOOKUP, 0, pathstr, strlen(pathstr),
            rump_pub_cred_create(0, 0, 0, NULL), rump_pub_lwproc_curlwp());
@@ -81,6 +84,8 @@
            rump_pub_cred_create(0, 0, 0, NULL), rump_pub_lwproc_curlwp());
        strcpy(pathstr, "/muuta");
        RZ(RUMP_VOP_LOOKUP(rumpns_rootvnode, &vp, cn));
+
+       RZ(RUMP_VOP_UNLOCK(rumpns_rootvnode));
        rump_pub_freecn(cn, RUMPCN_FREECRED);
 }
 



Home | Main Index | Thread Index | Old Index