Source-Changes-HG archive

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

[src/trunk]: src/sys/kern PR kern/55237: Panic: vrelel: bad ref count (9.99.54)



details:   https://anonhg.NetBSD.org/src/rev/e8d534e47097
branches:  trunk
changeset: 933280:e8d534e47097
user:      ad <ad%NetBSD.org@localhost>
date:      Sat May 23 22:16:17 2020 +0000

description:
PR kern/55237: Panic: vrelel: bad ref count (9.99.54)

Adjust v_writecount with v_interlock held.

diffstat:

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

diffs (32 lines):

diff -r 2c2248144510 -r e8d534e47097 sys/kern/tty_ptm.c
--- a/sys/kern/tty_ptm.c        Sat May 23 21:49:43 2020 +0000
+++ b/sys/kern/tty_ptm.c        Sat May 23 22:16:17 2020 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: tty_ptm.c,v 1.41 2019/11/30 20:45:49 ad Exp $  */
+/*     $NetBSD: tty_ptm.c,v 1.42 2020/05/23 22:16:17 ad Exp $  */
 
 /*-
- * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 2004, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_ptm.c,v 1.41 2019/11/30 20:45:49 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_ptm.c,v 1.42 2020/05/23 22:16:17 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -145,7 +145,9 @@
                return error;
        }
 
+       mutex_enter(vp->v_interlock);
        vp->v_writecount++;
+       mutex_exit(vp->v_interlock);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index