From nobody Sat Jul 22 00:22:44 2023 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 4R76ZX4DHlz4p3Np; Sat, 22 Jul 2023 00:22:44 +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 4R76ZX3prSz3pnH; Sat, 22 Jul 2023 00:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689985364; 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=RD5kcqUm5P8FfJklEYjHIukDlicyH1Z87osc/Dd0u/A=; b=Yf+pSEzKYUshyMTJDrKnJaDov6/fqlgOAfIdlazRWr20fSwUNMu++WwxWPx9nrFoq1enYH BnYyrrbSjNu9niuscB4eoTT1xZZBrqkJ7kAdUnMXuc5JuPz7AT6lJw9wqHgPx/MkltfkX2 Jf/7RwQ95fafLuwGDXC2MR/DDqyjLmBixmR0YD0acfs1p+bV070V0D8x49kgxP7jOnK4R1 jGubYxJXmQnj08wYQYx2kyFCbgmDCmxs4CXMieCK2kL5J4PV1fBn/uwVrLg5c+ipxVSO+R sdZRPXi9iVwck/RNgo76cR6lI8tLhBX31KRCXcWQr1riJnM0j1shhr9/RHXi0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689985364; 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=RD5kcqUm5P8FfJklEYjHIukDlicyH1Z87osc/Dd0u/A=; b=REWgrgTIs53OD/ARo7EVABBgoIqEHrv0sJnBJuGuMQhS0m1b2vZu0gmwYijrboSW4Yz/j8 OyvbrKWTUSgQ53thTC5NbsL35s9Ul9YeUu/N0htV34UqBfiPxeCqIqKUUIuRe9S8wkRf/4 3otd4ggCaqL9DmsWheKxvdeTXGKDcWOrjzpzDRYXrVDKXahg74yTyc1CcxTMx6lnWx5iTE d48yq3P5k0UNllWbmZkflc1IApYZyaUd2E9KmLu+pVq8am/FHqTOYoQ0ZrHJkdW8Xe6Swe 81CPf2/him99mHHcqKnWx2oaVqjj67ZVYFsp4u8C9HXBwfvTvpsREhfv2O30Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689985364; a=rsa-sha256; cv=none; b=d+Derfa6rAocSnDpedESv8qBMQxJyxAA8yoLpnbEV8B6E/r338CP8VYvPzOlterznCoyy1 JwqfXsCwJLWC5ntAeQq2n3uh7yyqOrNRQSQl3EtijxVgdLhoSXkpKGwVWiNNoipuF8PZHt Iht+JDmhwM6E++inDyTJtR4+wGReaWtQ6Og2DCb+BHDtdF/SJ/9DT7LqifU71v3Dnd+/WF cZNqd/CuTRFKFbGLLSMso4DGyEtu+IfUQwvMkoPV4pL6O+LcMJcEg3qKqGY3n1Ttai7Jx1 BNBSbBx7YfjQEGFaPb3QsMYiMsPlPDG9JOPvLOGszHF9jyV7OdaC65+4stXDTQ== 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 4R76ZX2t0dzY6D; Sat, 22 Jul 2023 00:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M0MioH086386; Sat, 22 Jul 2023 00:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M0MiJS086385; Sat, 22 Jul 2023 00:22:44 GMT (envelope-from git) Date: Sat, 22 Jul 2023 00:22:44 GMT Message-Id: <202307220022.36M0MiJS086385@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: 17207eae668b - stable/13 - Write out corrected superblock when creating a UFS/FFS snapshot. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 17207eae668b80561c98fe18a9a5e18409d47c58 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=17207eae668b80561c98fe18a9a5e18409d47c58 commit 17207eae668b80561c98fe18a9a5e18409d47c58 Author: Kirk McKusick AuthorDate: 2023-06-13 07:21:43 +0000 Commit: Kirk McKusick CommitDate: 2023-07-22 00:22:10 +0000 Write out corrected superblock when creating a UFS/FFS snapshot. PR: 271352 Tested-by: Peter Holm Sponsored-by: The FreeBSD Foundation (cherry picked from commit f1549d7d522995bf5d821ae08cc2f500ba545285) --- sys/ufs/ffs/ffs_snapshot.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 709038db071f..a23f0ad502a9 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -207,7 +207,7 @@ ffs_snapshot(struct mount *mp, char *snapfile) long snaplistsize = 0; int32_t *lp; void *space; - struct fs *copy_fs = NULL, *fs; + struct fs *copy_fs = NULL, *fs, *bpfs; struct thread *td = curthread; struct inode *ip, *xp; struct buf *bp, *nbp, *ibp; @@ -828,8 +828,10 @@ resumefs: } else { loc = blkoff(fs, fs->fs_sblockloc); copy_fs->fs_fmod = 0; - copy_fs->fs_ckhash = ffs_calc_sbhash(copy_fs); - bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize); + bpfs = (struct fs *)&nbp->b_data[loc]; + bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (u_int)fs->fs_sbsize); + ffs_oldfscompat_write(bpfs, ump); + bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } /*