Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/specfs specfs(9): XXX comment: what if read downg...



details:   https://anonhg.NetBSD.org/src/rev/d24d8150bf6e
branches:  trunk
changeset: 370184:d24d8150bf6e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Sep 21 10:59:10 2022 +0000

description:
specfs(9): XXX comment: what if read downgrades lock?

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 21aaf3a75c66 -r d24d8150bf6e sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Wed Sep 21 10:51:14 2022 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Wed Sep 21 10:59:10 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.214 2022/08/12 21:25:39 riastradh Exp $       */
+/*     $NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.214 2022/08/12 21:25:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1100,7 +1100,8 @@
                        goto out;
                error = cdev_read(dev, uio, ap->a_ioflag);
                spec_io_exit(vp, sn);
-out:           vn_lock(vp, LK_SHARED | LK_RETRY);
+out:           /* XXX What if the caller held an exclusive lock?  */
+               vn_lock(vp, LK_SHARED | LK_RETRY);
                return (error);
 
        case VBLK:



Home | Main Index | Thread Index | Old Index