Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jun 2021 20:47:13 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 887c753c9f45 - main - Fix handling of D_GIANTOK
Message-ID:  <202106072047.157KlDgD034943@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

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

commit 887c753c9f451322cae3efbf9b63f53f3d9011c8
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-06-07 18:25:26 +0000
Commit:     Mark Johnston <markj@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106072047.157KlDgD034943>