From nobody Sat Jan 31 17:50:25 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f3L4x65YBz6QbcG for ; Sat, 31 Jan 2026 17:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f3L4x3R4Fz3t03 for ; Sat, 31 Jan 2026 17:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769881825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9v0mF4rdmMTfYo8Vphj1oIDMwxELwEDcQMbOtb+duCE=; b=aOjKUiNgOHkWxS6tBIggj6pQQ2ud6hPGsODWhEHqoMfC0t8MYeK8oKgquy/MyfUUfJs9/S L4MQDn1CuPIJJuw7pewpUGJkxNxmudAEMvfFMskQMiwzRQkJSlhImo5SFkLmXg3gOtOVwl ++XNfUGQpq3y+LKvNUGgGvhVS/BHF8u87yLiEO5C0Pu8nfLkpgmnMB/s/aI2xnHmBsFA65 44lIHWI6R+l7fWlxoRMFmd6DOB7jI7hylWpkLqNam8TKScqg7MV83YecPSVa0SdF78iC65 EktonZp+TZdBkBlyJGuTolWVdbEEA2iJNmbYoTC+W+bkPtzA92zseIZ+3ZmsWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769881825; a=rsa-sha256; cv=none; b=kSo2qcsEhRAlYPIU8Il6kPJzM0Om0Qr3YwS//2KoZmyfm+sf1WsL7ovML5RMUKeCEwjuFw 3WfTn5exCkIrlcYQnAELCmFwOUtjcWR/2mtuGkSFFbypbAmeegc5Lmor8Ua5TvxFxRGdQG nJVlwE7U7tBoLLTBB6rqjlOCBbbEk0bTHbcS9kuh0AWuA6NQ+GJk8oQTeZea6U92hmdpWl NoBsoJOWuj2ir73N+UXwnMdmPc0Xmmy3psfrEDt07wnI53b9ev+6Sh9GzCLVnPLLXy8Ty9 7NXNtLYig5Wglzt+TEWnbUSr8KEyk+3SDNAdXeHQLhuL4giX0JLZYAaOj6WWUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769881825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9v0mF4rdmMTfYo8Vphj1oIDMwxELwEDcQMbOtb+duCE=; b=PVRVCBWwQoNqH9HiO01gKlcCPGopdLN15Jh0vHKbpW3609fvCckCLcHtmqzL7YKPaUY6q9 Ji7JjXbxqlLTk+0MRx3rkn41Q/si5WfUtnyT/Q4BSla4H/viVabhq4HzW7znzUh0dzUUyZ G4kxOHqLxX4myBd0L0+ayxPTHny6CfrKvLCVj/zti+dEXqUMMYAtyVjQsaIuUIRPnm68L3 SRWSyOTJEb71w2zDJQqTutn/9cGqma5fCTylY0EiJlc0T3DdBJdpREtlIlV99nJSpWfrwo YK3ogHG1bVvV37HxpINdT1KYVYHhxLEgiAKmiDbXrafj5Nguln80hEbOlsxlKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f3L4x2nrzz14R0 for ; Sat, 31 Jan 2026 17:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ee3a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 31 Jan 2026 17:50:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: ad64308af9e3 - stable/13 - newfs: Add an option to disable soft updates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad64308af9e3b61cc83acd6645ad608e63e97406 Auto-Submitted: auto-generated Date: Sat, 31 Jan 2026 17:50:25 +0000 Message-Id: <697e40e1.1ee3a.4a4a92bf@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ad64308af9e3b61cc83acd6645ad608e63e97406 commit ad64308af9e3b61cc83acd6645ad608e63e97406 Author: Dag-Erling Smørgrav AuthorDate: 2026-01-11 02:34:00 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-01-31 17:50:18 +0000 newfs: Add an option to disable soft updates A previous commit turned soft updates on by default for UFS2 without providing a way to turn them off. This corrects that by adding a new -u flag which forces soft updates (and soft updates journaling) off. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Fixes: 61dece6d27fb ("Enable soft updates by default for UFS2 filesystems.") Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D54576 (cherry picked from commit 68562f8145e8154e7e276897a546995f0d8f3428) newfs: Add -u to getopt string Fixes: 68562f8145e8 ("newfs: Add an option to disable soft updates") (cherry picked from commit 717ae163919e48f000b94f85dc188e0d92261929) --- sbin/newfs/newfs.8 | 24 ++++++++++++++++++------ sbin/newfs/newfs.c | 11 +++++++---- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 0b9f66a7e76d..de69cc30dc16 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 18, 2024 +.Dd January 7, 2026 .Dt NEWFS 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd construct a new UFS1/UFS2 file system .Sh SYNOPSIS .Nm -.Op Fl EJNUjlnt +.Op Fl EJNUjlntu .Op Fl L Ar volname .Op Fl O Ar filesystem-type .Op Fl S Ar sector-size @@ -98,10 +98,20 @@ 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. +If neither +.Fl U +nor +.Fl u +is specified, soft updates are enabled by default for UFS2 format file +systems and disabled otherwise. +.It Fl u +Do not enable soft updates on the new file system. +If neither +.Fl U +nor +.Fl u +is specified, soft updates are enabled by default for UFS2 format file +systems and disabled otherwise. .It Fl a Ar maxcontig Specify the maximum number of contiguous blocks that will be laid out before forcing a rotational delay. @@ -166,6 +176,8 @@ 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 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 6e69a6c5437b..27b6c079bc0f 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -86,7 +86,7 @@ int Lflag; /* add a volume label */ int Nflag; /* run without writing file system */ int Oflag = 2; /* file system format (1 => UFS1, 2 => UFS2) */ int Rflag; /* regression test */ -int Uflag; /* enable soft updates for file system */ +int Uflag = -1; /* enable soft updates for file system */ int jflag; /* enable soft updates journaling for filesys */ int Xflag = 0; /* exit in middle of newfs for testing */ int Jflag; /* enable gjournal for file system */ @@ -139,7 +139,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:jk:lm:no:p:r:s:t")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:jk:lm:no:p:r:s:tu")) != -1) switch (ch) { case 'E': Eflag = 1; @@ -188,6 +188,9 @@ main(int argc, char *argv[]) case 'U': Uflag = 1; break; + case 'u': + Uflag = 0; + break; case 'X': Xflag++; break; @@ -392,8 +395,8 @@ main(int argc, char *argv[]) opt = FS_OPTSPACE; } /* Use soft updates by default for UFS2 and above */ - if (Oflag > 1) - Uflag = 1; + if (Uflag < 0) + Uflag = Oflag > 1; realsectorsize = sectorsize; if (sectorsize != DEV_BSIZE) { /* XXX */ int secperblk = sectorsize / DEV_BSIZE;