aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2025-11-05 00:28:02 +0000
committerKyle Evans <kevans@FreeBSD.org>2025-11-05 00:28:02 +0000
commit90314c04f10f583c37c59ec51fd628e3deaf3622 (patch)
treebe2b9a83d22acca1f1bf64bcf6bdcf805a5f59eb
parent96c1d8db39dfeea78ea3f27d67649252a39bbf2e (diff)
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
-rw-r--r--share/man/man9/make_dev.912
1 files 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.