git: d3c523b6f5aa - stable/14 - makedev(9): drop an additional note about cdevpriv dtors
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 20 Jan 2026 04:09:41 UTC
The branch stable/14 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=d3c523b6f5aa644e85d7c2c1177953f5d73e8529
commit d3c523b6f5aa644e85d7c2c1177953f5d73e8529
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-11-05 00:28:02 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-01-20 04:07:00 +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
(cherry picked from commit 90314c04f10f583c37c59ec51fd628e3deaf3622)
---
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 052f9a0cfd87..c8f495c2777b 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.