aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-01-22 18:16:37 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-01-22 18:16:45 +0000
commit4b9620433855b75989164c1a8a8a2e1a9b5fbff2 (patch)
tree457abae839d1b78964aa0a61fcb5f2f646945f90
parent14dce731d70686e08ed689729f53c6a5e2225498 (diff)
mdmfs: Fix soft updates logic
Now that newfs(8) has a command-line argument to disable soft updates, use that instead of running tunefs(8) after the fact to turn them off. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: mckusick, imp Differential Revision: https://reviews.freebsd.org/D54783
-rw-r--r--sbin/mdmfs/mdmfs.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c
index 69149b3fb465..cd0bf7c96143 100644
--- a/sbin/mdmfs/mdmfs.c
+++ b/sbin/mdmfs/mdmfs.c
@@ -104,7 +104,7 @@ main(int argc, char **argv)
bool detach, softdep, autounit, newfs;
const char *mtpoint, *size_arg, *skel, *unitstr;
char *p;
- int ch, idx, rv;
+ int ch, idx;
void *set;
unsigned long ul;
@@ -343,8 +343,7 @@ main(int argc, char **argv)
if (!have_mdtype)
mdtype = MD_SWAP;
- if (softdep)
- argappend(&newfs_arg, "-U");
+ argappend(&newfs_arg, softdep ? "-U" : "-u");
if (mdtype != MD_VNODE && !newfs)
errx(1, "-P requires a vnode-backed disk");
@@ -357,13 +356,6 @@ main(int argc, char **argv)
do_mdconfig_attach(mdconfig_arg, mdtype);
if (newfs)
do_newfs(newfs_arg);
- if (!softdep) {
- rv = run(NULL, "%s %s /dev/%s%d", _PATH_TUNEFS,
- "-n disable", mdname, unit);
- if (rv)
- errx(1, "tunefs exited %s %d", run_exitstr(rv),
- run_exitnumber(rv));
- }
do_mount_md(mount_arg, mtpoint);
}