The branch main has been updated by des:

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

commit 4b9620433855b75989164c1a8a8a2e1a9b5fbff2
Author:     Dag-Erling Smørgrav <[email protected]>
AuthorDate: 2026-01-22 18:16:37 +0000
Commit:     Dag-Erling Smørgrav <[email protected]>
CommitDate: 2026-01-22 18:16:45 +0000

    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
---
 sbin/mdmfs/mdmfs.c | 12 ++----------
 1 file 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);
        }
 

Reply via email to