git: d78723738bbc - stable/13 - When doing a read-only mount of a UFS filesystem using gjournal(8), suppress error message about a missing gjournal provider.

From: Kirk McKusick <mckusick_at_FreeBSD.org>
Date: Tue, 18 Jan 2022 23:16:05 UTC
The branch stable/13 has been updated by mckusick:

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

commit d78723738bbc73bf0bf01ba8ff06113590935248
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2022-01-02 22:04:06 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2022-01-18 23:13:42 +0000

    When doing a read-only mount of a UFS filesystem using gjournal(8),
    suppress error message about a missing gjournal provider.
    
    Submitted by: Andreas Longwitz
    Sponsored by: Netflix
    
    (cherry picked from commit 1fbcaa13b033230c52487a270803bd0f7723e107)
---
 sys/ufs/ffs/ffs_vfsops.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 507f0b148fc5..90cf92305022 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1043,9 +1043,10 @@ ffs_mountfs(odevvp, mp, td)
 			mp->mnt_flag |= MNT_GJOURNAL;
 			MNT_IUNLOCK(mp);
 		} else {
-			printf("WARNING: %s: GJOURNAL flag on fs "
-			    "but no gjournal provider below\n",
-			    mp->mnt_stat.f_mntonname);
+			if ((mp->mnt_flag & MNT_RDONLY) == 0)
+				printf("WARNING: %s: GJOURNAL flag on fs "
+				    "but no gjournal provider below\n",
+				    mp->mnt_stat.f_mntonname);
 			free(mp->mnt_gjprovider, M_UFSMNT);
 			mp->mnt_gjprovider = NULL;
 		}