From nobody Sun Dec 11 00:38:12 2022 X-Original-To: dev-commits-src-all@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 4NV5TK13DNz4jgl3; Sun, 11 Dec 2022 00:38:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NV5TJ74CGz4H1q; Sun, 11 Dec 2022 00:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670719093; 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=RnCBhfFj+umBdAZmzgNAdpwnk1exe2uViKbevu2nyug=; b=bvKtA1pDmSm5IEksZktru0M1THE3TIRbluNH+VR0159jQWjrwyKFZyiV9Jb9IF9UjOnyMa vfnN8DBOtpg6X3hZz8MFk3zeewlzhQoJVwfTr9PCvXyMRaChs97jkmNI0xIHGqx+vQtAim Mct8dLxQIhUcUMo+qSNB3tt52pkCWDy+O7VMR/9LEvarBLoR99er3BoTzpPd80t3Tz5VKw vKlgDZZffFVC20c77LBECCElaPW4M2yu2irZ0PuCz1YYrjBs5CqXrzWFNJJZKaag/RPNad h+lUMzyyWXqKDscNQpu32+3OEuZl3otkcnOSnRCliE8D14u3fMuBVGnrBsZLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670719093; 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=RnCBhfFj+umBdAZmzgNAdpwnk1exe2uViKbevu2nyug=; b=XSVpb4SO4GwSMIiUEog3fH+C2xVC3Yb3Om8X+CgsfvFGh49wB22yAN+q1Re1y5FAYNdlQq P5WJUeIfDl8/y7uERO1qW5AaAaJKqrNQNlYuD/oUZ8VwGhMo47dCD68phHphzvMhdB7DG4 R0RpaVmlczi9yKuVlqclG2MH1+y2Ya0CiCj0V+rT3P52vb2nmSCj+Hipwm0d3qCxAvBGMw BGLaWS5NQ4670IblxIvXGZ+bZdJ8spJel84yziaYrTq35Wx1l9XFfvJraeZRXj/YlH1Ue7 NdgZu2EhBE/TqTex2aFPxrQEcgF+mZisxfXeDyao8DjibXjkTApbsLWL+8fTXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670719093; a=rsa-sha256; cv=none; b=ITxleAwN2Q8pp7J/jmfxn2mksIb0uABwY6/bjV61463/dbcl8LWkJsHk2eZVm/9mj03knm VX8cgnmnXhhyp83u7H5ikHKG3DCtuIfPQLbYitt2ZU0eAEVt6KkGIjeAHmTss6wEnN7sLN baS03jk4rBFVszaT2Gmjn7x6+kGCnj4h7EuJZ9OLbA34ubx7Z4RFj5aM+zPcYlkKwRMaZS RJ/U3PH2EaAb8t656SjapEEfrZpna2XG6CzzHbkZv2Lr5iRCf0HhANU+stwhL/BOUR1y+w DQBM4ySk4n4aqnp/5bBY++8Mv5GsofabHEMppaOJs51OiOew1pgzefTgHT9V6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NV5TJ68ctzZvr; Sun, 11 Dec 2022 00:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BB0cCDj003790; Sun, 11 Dec 2022 00:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BB0cCF1003789; Sun, 11 Dec 2022 00:38:12 GMT (envelope-from git) Date: Sun, 11 Dec 2022 00:38:12 GMT Message-Id: <202212110038.2BB0cCF1003789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 378d18d96deb - stable/13 - Update standard superblock when successful using an alternate superblock. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 378d18d96debe60bb051c5df47b195d6d450c693 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=378d18d96debe60bb051c5df47b195d6d450c693 commit 378d18d96debe60bb051c5df47b195d6d450c693 Author: Kirk McKusick AuthorDate: 2022-08-24 06:28:30 +0000 Commit: Kirk McKusick CommitDate: 2022-12-11 00:37:17 +0000 Update standard superblock when successful using an alternate superblock. (cherry picked from commit be639cc8eef01a2b8849939eb07cfde476146794) Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/fsutil.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 711c9bb63549..dfe472ab17fb 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -681,14 +681,17 @@ ckfini(int markclean) if (debug) printf("Flush the superblock\n"); flush(fswritefd, &sblk); - if (havesb && cursnapshot == 0 && sblock.fs_magic == FS_UFS2_MAGIC && - sblk.b_bno != sblock.fs_sblockloc / dev_bsize && - !preen && reply("UPDATE STANDARD SUPERBLOCK")) { - /* Change the write destination to standard superblock */ - sblock.fs_sblockactualloc = sblock.fs_sblockloc; - sblk.b_bno = sblock.fs_sblockloc / dev_bsize; - sbdirty(); - flush(fswritefd, &sblk); + if (havesb && cursnapshot == 0 && + sblk.b_bno != sblock.fs_sblockloc / dev_bsize) { + if (preen || reply("UPDATE STANDARD SUPERBLOCK")) { + /* Change write destination to standard superblock */ + sblock.fs_sblockactualloc = sblock.fs_sblockloc; + sblk.b_bno = sblock.fs_sblockloc / dev_bsize; + sbdirty(); + flush(fswritefd, &sblk); + } else { + markclean = 0; + } } if (cursnapshot == 0 && sblock.fs_clean != markclean) { if ((sblock.fs_clean = markclean) != 0) {