aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2024-05-15 05:38:35 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2024-05-16 23:43:01 +0000
commit6b2af2d88ffdcae1f50c6e821ce83eb5f5f97fef (patch)
tree34f6b3e04533a83be1750da36a0b4537072fc019
parent8930e7d8ea4dc0ec34c6d2f7db5a7c7746997b8f (diff)
Enable soft updates by default for UFS2 filesystems.
Differential Revision: https://reviews.freebsd.org/D45201 (cherry picked from commit 61dece6d27fb2436928ca93d65667b358e05aa7b) (cherry picked from commit 7465f9fc06467e57d3bbf2430031fe51d8182c30) Approved by: re (Colin Percival)
-rw-r--r--sbin/newfs/newfs.86
-rw-r--r--sbin/newfs/newfs.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index e1496af814ca..0dc93cb8b78d 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -27,7 +27,7 @@
.\"
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
.\"
-.Dd October 21, 2022
+.Dd May 18, 2024
.Dt NEWFS 8
.Os
.Sh NAME
@@ -100,6 +100,10 @@ The default format is UFS2.
For backward compatibility.
.It Fl U
Enable soft updates on the new file system.
+Soft updates are enabled by default for UFS2 format file systems.
+Use
+.Xr tunefs 8
+to disable soft updates if they are not wanted.
.It Fl a Ar maxcontig
Specify the maximum number of contiguous blocks that will be
laid out before forcing a rotational delay.
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index afb71f9f25b4..c96e414b85dd 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -395,6 +395,9 @@ main(int argc, char *argv[])
fprintf(stderr, "because minfree is less than %d%%\n", MINFREE);
opt = FS_OPTSPACE;
}
+ /* Use soft updates by default for UFS2 and above */
+ if (Oflag > 1)
+ Uflag = 1;
realsectorsize = sectorsize;
if (sectorsize != DEV_BSIZE) { /* XXX */
int secperblk = sectorsize / DEV_BSIZE;