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
This commit is contained in:
Dag-Erling Smørgrav
2026-01-22 19:16:37 +01:00
parent 14dce731d7
commit 4b96204338
+2 -10
View File
@@ -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);
}