git: 94c236b7d806 - stable/14 - newfs: Don't combine GEOM journaling with SU
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 04 Apr 2026 08:59:31 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=94c236b7d806d676d485d0c55a1924af417e70d1
commit 94c236b7d806d676d485d0c55a1924af417e70d1
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-03-21 07:21:28 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-04 08:59:25 +0000
newfs: Don't combine GEOM journaling with SU
GEOM journaling shouldn't be used at the same time as soft updates, so
don't enable soft updates if GEOM journaling has been requested, and
error out if both are explicitly requested.
MFC after: 1 week
PR: 293896
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D55999
(cherry picked from commit e30fcdaae2e68458da83d5420e6034c5f384e5f2)
---
sbin/newfs/newfs.8 | 14 ++++++++++----
sbin/newfs/newfs.c | 4 +++-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index 7336dbbc6e23..e091d7a53806 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -27,7 +27,7 @@
.\"
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
.\"
-.Dd January 7, 2026
+.Dd March 20, 2026
.Dt NEWFS 8
.Os
.Sh NAME
@@ -86,6 +86,8 @@ Enable journaling on the new file system via gjournal.
See
.Xr gjournal 8
for details.
+This is incompatible with soft updates
+.Pq Fl U .
.It Fl L Ar volname
Add a volume label to the new file system.
Legal characters are alphanumerics, dashes, and underscores.
@@ -100,12 +102,14 @@ The default format is UFS2.
For backward compatibility.
.It Fl U
Enable soft updates on the new file system.
+This is incompatible with GEOM journaling
+.Pq Fl J .
If neither
.Fl U
nor
.Fl u
is specified, soft updates are enabled by default for UFS2 format file
-systems and disabled otherwise.
+systems unless GEOM journaling was requested and disabled otherwise.
.It Fl u
Do not enable soft updates on the new file system.
If neither
@@ -178,8 +182,10 @@ One inode is required for each distinct file, so this value effectively
specifies the average file size on the file system.
.It Fl j
Enable soft updates journaling on the new file system.
-This implies
-.Fl U .
+This implies soft updates
+.Pq Fl U
+and is incompatible with GEOM journaling
+.Pq Fl J .
This flag is implemented by running the
.Xr tunefs 8
utility found in the user's
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 754606707178..108a66b11581 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -400,7 +400,9 @@ main(int argc, char *argv[])
}
/* Use soft updates by default for UFS2 and above */
if (Uflag < 0)
- Uflag = Oflag > 1;
+ Uflag = Oflag > 1 && !Jflag;
+ if (Uflag && Jflag)
+ errx(1, "Cannot enable both soft updates and GEOM journaling");
realsectorsize = sectorsize;
if (sectorsize != DEV_BSIZE) { /* XXX */
int secperblk = sectorsize / DEV_BSIZE;