aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-06-07 18:25:26 +0000
committerMark Johnston <markj@FreeBSD.org>2021-06-14 20:25:15 +0000
commit129fb0fb02828adf71d457bb20aab48b7d88b287 (patch)
tree1b62bd4d8696260b4c43ad5333accbf3509f7669 /sys
parent368b1cd57190757c5fbadd83ce002f7943a3e7ec (diff)
downloadsrc-129fb0fb02828adf71d457bb20aab48b7d88b287.tar.gz
src-129fb0fb02828adf71d457bb20aab48b7d88b287.zip
Fix handling of D_GIANTOK
It was meant to suppress only the printf(), not the subsequent injection of Giant-protected thunks for various file operations. Fixes: fbeb4ccac9 Reported by: pho Tested by: pho Pointy hat: markj (cherry picked from commit 887c753c9f451322cae3efbf9b63f53f3d9011c8)
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_conf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 42435c0b8740..cb575114571a 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -665,10 +665,13 @@ prep_cdevsw(struct cdevsw *devsw, int flags)
devsw->d_kqfilter = dead_kqfilter;
}
- if ((devsw->d_flags & (D_NEEDGIANT | D_GIANTOK)) == D_NEEDGIANT) {
- printf("WARNING: Device \"%s\" is Giant locked and may be "
- "deleted before FreeBSD 14.0.\n",
- devsw->d_name == NULL ? "???" : devsw->d_name);
+ if ((devsw->d_flags & D_NEEDGIANT) != 0) {
+ if ((devsw->d_flags & D_GIANTOK) == 0) {
+ printf(
+ "WARNING: Device \"%s\" is Giant locked and may be "
+ "deleted before FreeBSD 14.0.\n",
+ devsw->d_name == NULL ? "???" : devsw->d_name);
+ }
if (devsw->d_gianttrick == NULL) {
memcpy(dsw2, devsw, sizeof *dsw2);
devsw->d_gianttrick = dsw2;