The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=887c753c9f451322cae3efbf9b63f53f3d9011c8

commit 887c753c9f451322cae3efbf9b63f53f3d9011c8
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2021-06-07 18:25:26 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2021-06-07 20:45:50 +0000

    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
    MFC after:      6 days
    Pointy hat:     markj
---
 sys/kern/kern_conf.c | 11 +++++++----
 1 file 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;
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to