git: 129fb0fb0282 - stable/13 - Fix handling of D_GIANTOK

Mark Johnston markj at FreeBSD.org
Mon Jun 14 20:25:30 UTC 2021


The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=129fb0fb02828adf71d457bb20aab48b7d88b287

commit 129fb0fb02828adf71d457bb20aab48b7d88b287
Author:     Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-06-07 18:25:26 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-06-14 20:25:15 +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
    Pointy hat:     markj
    
    (cherry picked from commit 887c753c9f451322cae3efbf9b63f53f3d9011c8)
---
 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;


More information about the dev-commits-src-all mailing list