Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev Pull up following revision(s) (requested by riast...



details:   https://anonhg.NetBSD.org/src/rev/ae00e9ca3db3
branches:  netbsd-9
changeset: 1027655:ae00e9ca3db3
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Dec 14 19:05:11 2021 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #1393):

        sys/dev/cgd.c: revision 1.141

cgd(4): Wait for worker threads to complete before destroying mutex.

Fixes PR kern/56546 (probably!).

diffstat:

 sys/dev/cgd.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 4213c55dce5f -r ae00e9ca3db3 sys/dev/cgd.c
--- a/sys/dev/cgd.c     Wed Dec 08 15:51:53 2021 +0000
+++ b/sys/dev/cgd.c     Tue Dec 14 19:05:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.116.10.3 2020/04/06 14:57:42 martin Exp $ */
+/* $NetBSD: cgd.c,v 1.116.10.4 2021/12/14 19:05:11 martin Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.116.10.3 2020/04/06 14:57:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.116.10.4 2021/12/14 19:05:11 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -516,14 +516,20 @@
 static void
 cgd_destroy_worker(struct cgd_worker *cw)
 {
+
+       /*
+        * Wait for all worker threads to complete before destroying
+        * the rest of the cgd_worker.
+        */
+       if (cw->cw_wq)
+               workqueue_destroy(cw->cw_wq);
+
        mutex_destroy(&cw->cw_lock);
 
        if (cw->cw_cpool) {
                pool_destroy(cw->cw_cpool);
                kmem_free(cw->cw_cpool, sizeof(struct pool));
        }
-       if (cw->cw_wq)
-               workqueue_destroy(cw->cw_wq);
 
        kmem_free(cw, sizeof(struct cgd_worker));
 }



Home | Main Index | Thread Index | Old Index