Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Apr 2026 08:59:32 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c514f8dbeab8 - stable/14 - tunefs: Don't combine GEOM journaling with SU
Message-ID:  <69d0d2f4.36b45.78d3eafc@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/14 has been updated by des:

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

commit c514f8dbeab813c996d426de2aedceb669c4fa2a
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-03-21 07:21:33 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-04 08:59:25 +0000

    tunefs: Don't combine GEOM journaling with SU
    
    GEOM journaling shouldn't be used at the same time as soft updates, so
    don't enable one if the other is already in use.
    
    MFC after:      1 week
    PR:             293896
    Reviewed by:    mckusick
    Differential Revision:  https://reviews.freebsd.org/D56002
    
    (cherry picked from commit b1f72dd2a9a5e69a310b9e76b55f16cff433b8da)
---
 sbin/tunefs/tunefs.8 |  8 ++++++--
 sbin/tunefs/tunefs.c | 17 +++++++++++++----
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/sbin/tunefs/tunefs.8 b/sbin/tunefs/tunefs.8
index 19059e335834..9624bab89ea3 100644
--- a/sbin/tunefs/tunefs.8
+++ b/sbin/tunefs/tunefs.8
@@ -27,7 +27,7 @@
 .\"
 .\"     @(#)tunefs.8	8.2 (Berkeley) 12/11/93
 .\"
-.Dd November 17, 2023
+.Dd March 20, 2026
 .Dt TUNEFS 8
 .Os
 .Sh NAME
@@ -94,6 +94,8 @@ this parameter should be set higher.
 Specify the expected average file size.
 .It Fl j Cm enable | disable
 Turn on/off soft updates journaling.
+Enabling soft updates journaling implies enabling soft updates and is
+incompatible with GEOM journaling.
 .Pp
 Enabling journaling reduces the time spent by
 .Xr fsck_ffs 8
@@ -130,7 +132,8 @@ is running.
 Running a full fsck on a UFS filesystem is the equivalent of
 running a scrub on a ZFS filesystem.
 .It Fl J Cm enable | disable
-Turn on/off gjournal flag.
+Turn on/off GEOM journaling.
+GEOM journaling is incompatible with soft updates.
 .It Fl k Ar held-for-metadata-blocks
 Set the amount of space to be held for metadata blocks.
 When set, the file system preference routines will try to save
@@ -173,6 +176,7 @@ been deleted to get under the higher threshold.
 Turn on/off the administrative NFSv4 ACL enable flag.
 .It Fl n Cm enable | disable
 Turn on/off soft updates.
+Soft updates are incompatible with GEOM journaling.
 .It Fl o Cm space | time
 The file system can either try to minimize the time spent
 allocating blocks, or it can attempt to minimize the space
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index 9b38e23effd0..6b399f032c9c 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -370,6 +370,9 @@ main(int argc, char *argv[])
 			if ((sblock.fs_flags & (FS_DOSOFTDEP | FS_SUJ)) ==
 			    (FS_DOSOFTDEP | FS_SUJ)) {
 				warnx("%s remains unchanged as enabled", name);
+			} else if (sblock.fs_flags & FS_GJOURNAL) {
+				warnx("%s cannot be enabled while GEOM "
+				    "journaling is enabled", name);
 			} else if (sblock.fs_clean == 0) {
 				warnx("%s cannot be enabled until fsck is run",
 				    name);
@@ -398,6 +401,9 @@ main(int argc, char *argv[])
 		if (strcmp(Jvalue, "enable") == 0) {
 			if (sblock.fs_flags & FS_GJOURNAL) {
 				warnx("%s remains unchanged as enabled", name);
+			} if (sblock.fs_flags & FS_DOSOFTDEP) {
+				warnx("%s cannot be enabled while soft "
+				    "updates are enabled", name);
 			} else {
 				sblock.fs_flags |= FS_GJOURNAL;
 				warnx("%s set", name);
@@ -415,9 +421,9 @@ main(int argc, char *argv[])
 	}
 	if (kflag) {
 		name = "space to hold for metadata blocks";
-		if (sblock.fs_metaspace == kvalue)
+		if (sblock.fs_metaspace == kvalue) {
 			warnx("%s remains unchanged as %d", name, kvalue);
-		else {
+		} else {
 			kvalue = blknum(&sblock, kvalue);
 			if (kvalue > sblock.fs_fpg / 2) {
 				kvalue = blknum(&sblock, sblock.fs_fpg / 2);
@@ -489,9 +495,12 @@ main(int argc, char *argv[])
 	if (nflag) {
  		name = "soft updates";
  		if (strcmp(nvalue, "enable") == 0) {
-			if (sblock.fs_flags & FS_DOSOFTDEP)
+			if (sblock.fs_flags & FS_DOSOFTDEP) {
 				warnx("%s remains unchanged as enabled", name);
-			else if (sblock.fs_clean == 0) {
+			} else if (sblock.fs_flags & FS_GJOURNAL) {
+				warnx("%s cannot be enabled while GEOM "
+				    "journaling is enabled", name);
+			} else if (sblock.fs_clean == 0) {
 				warnx("%s cannot be enabled until fsck is run",
 				    name);
 			} else {


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69d0d2f4.36b45.78d3eafc>