Module Name:    src
Committed By:   mlelstv
Date:           Tue May  3 14:20:24 UTC 2022

Modified Files:
        src/sys/arch/landisk/landisk: autoconf.c

Log Message:
Fix vnode locking around VOP_OPEN.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/landisk/landisk/autoconf.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/arch/landisk/landisk/autoconf.c
diff -u src/sys/arch/landisk/landisk/autoconf.c:1.9 src/sys/arch/landisk/landisk/autoconf.c:1.10
--- src/sys/arch/landisk/landisk/autoconf.c:1.9	Sat Mar 19 13:49:21 2022
+++ src/sys/arch/landisk/landisk/autoconf.c	Tue May  3 14:20:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.9 2022/03/19 13:49:21 hannken Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.10 2022/05/03 14:20:24 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.9 2022/03/19 13:49:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10 2022/05/03 14:20:24 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -122,6 +122,7 @@ match_bootdisk(device_t dv, struct btinf
 		vput(tmpvn);
 		return (0);
 	}
+	VOP_UNLOCK(tmpvn);
 	error = VOP_IOCTL(tmpvn, DIOCGDINFO, &label, FREAD, NOCRED);
 	if (error) {
 		/*
@@ -140,6 +141,7 @@ match_bootdisk(device_t dv, struct btinf
 	    	found = 1;
 
 closeout:
+	vn_lock(tmpvn, LK_EXCLUSIVE | LK_RETRY);
 	VOP_CLOSE(tmpvn, FREAD, NOCRED);
 	vput(tmpvn);
 	return (found);

Reply via email to