Module Name: src
Committed By: hannken
Date: Tue May 3 07:36:20 UTC 2022
Modified Files:
src/tests/rump/rumpvfs: t_p2kifs.c
Log Message:
Lock vnode for VOP_LOOKUP().
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/rump/rumpvfs/t_p2kifs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/rump/rumpvfs/t_p2kifs.c
diff -u src/tests/rump/rumpvfs/t_p2kifs.c:1.6 src/tests/rump/rumpvfs/t_p2kifs.c:1.7
--- src/tests/rump/rumpvfs/t_p2kifs.c:1.6 Fri Jan 13 21:30:43 2017
+++ src/tests/rump/rumpvfs/t_p2kifs.c Tue May 3 07:36:20 2022
@@ -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 @@ ATF_TC_BODY(makecn, tc)
/* 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 @@ ATF_TC_BODY(makecn, tc)
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);
}