git: 90314c04f10f - main - makedev(9): drop an additional note about cdevpriv dtors
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 05 Nov 2025 00:28:13 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=90314c04f10f583c37c59ec51fd628e3deaf3622
commit 90314c04f10f583c37c59ec51fd628e3deaf3622
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-11-05 00:28:02 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2025-11-05 00:28:02 +0000
makedev(9): drop an additional note about cdevpriv dtors
These were previously somewhat safe to call destroy_dev(9), but will now
also cause a deadlock in the same fashion that d_close doing so would
previously. Amend the note to point it out, in case it's useful for
someone.
Reviewed by: imp, kib, markj
Differential Revision: https://reviews.freebsd.org/D53439
---
share/man/man9/make_dev.9 | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/share/man/man9/make_dev.9 b/share/man/man9/make_dev.9
index de56f350faa5..9f2c36fb39a4 100644
--- a/share/man/man9/make_dev.9
+++ b/share/man/man9/make_dev.9
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 19, 2025
+.Dd November 4, 2025
.Dt MAKE_DEV 9
.Os
.Sh NAME
@@ -387,14 +387,18 @@ function is the same as:
destroy_dev_sched_cb(cdev, NULL, NULL);
.Ed
.Pp
-The
+Neither the
.Fn d_close
-driver method cannot call
+driver method, nor a
+.Xr devfs_cdevpriv 9
+.Fa dtr
+method can
.Fn destroy_dev
directly.
Doing so causes deadlock when
.Fn destroy_dev
-waits for all threads to leave the driver methods.
+waits for all threads to leave the driver methods and finish executing any
+per-open destructors.
Also, because
.Fn destroy_dev
sleeps, no non-sleepable locks may be held over the call.