NetBSD-Bugs archive

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

Re: kern/56546: cgd tests fail randomly



The following reply was made to PR kern/56546; it has been noted by GNATS.

From: Taylor R Campbell <campbell%mumble.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: gson%gson.org@localhost (Andreas Gustafsson)
Subject: Re: kern/56546: cgd tests fail randomly
Date: Mon, 13 Dec 2021 00:21:40 +0000

 This is a multi-part message in MIME format.
 --=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw
 
 Try the attached patch?
 
 --=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw
 Content-Type: text/plain; charset="ISO-8859-1"; name="cgd"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="cgd.patch"
 
 diff --git a/sys/dev/cgd.c b/sys/dev/cgd.c
 index c0befcb865f6..5dec568df1ff 100644
 --- a/sys/dev/cgd.c
 +++ b/sys/dev/cgd.c
 @@ -692,14 +692,20 @@ cgd_create_worker(void)
  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);
 =20
  	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);
 =20
  	kmem_free(cw, sizeof(struct cgd_worker));
  }
 
 --=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw--
 


Home | Main Index | Thread Index | Old Index