From nobody Tue Jun 13 07:22:44 2023 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 4QgKl84cVZz4cg7F; Tue, 13 Jun 2023 07: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 4QgKl840DZz43P4; Tue, 13 Jun 2023 07: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=1686640964; 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=OfcktNOpMgEm/0ZHXpowIJI2ZLPzIjCVavkf7I5dbCU=; b=f4LXwQPQMcJ5eCJeqTPEnyldmRfBXvrWM71x4fxx4vvGXQ9dz4y3oBmcSMVqga1WGOkrw+ Ia+YLYISH0B04KgMZVdnl70W+vnbzd9MLnogJmxgjIAaWUprsXYwlFJCZe9R9zSwfEWgvI 6IPZsoo8wr+569vPguQQlxPUbJbMu3GmE6N6euWQuu8tbbIgNTClvY55u4GkapioZlyd7E FPZ+4n/rS3bp2pqvyUZRbuJ/AVXl8I9PtAw8z1ojWXtoxO8OFS0H3tHcYzbd+PlDtfWstL Qq2zrTaqeOuu9IaZuavXwK0kFKYXD6RHbztJickVGzbOxQVECpUw1Q4MxRUzvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686640964; 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=OfcktNOpMgEm/0ZHXpowIJI2ZLPzIjCVavkf7I5dbCU=; b=LtBBVJwZAYSzsyS6mjlUCsECgEpq+NwI2Mk+BQ+yG2nQMmI6Lh/miG+yf2PX63kZMNRMcU uqOLCeJTaS4zBAYy2uXjnt783b+iyjwiOvFNp5GH+k5oNBnGB+QrTXLKX25nUACCdVWihJ c5rdSXu9lBKwmtkmnUem7TjrVaRgbW/yP6ZzBD3nhsix9ftf7CVZKFiWvEYkQ5ql8unVAs NuKxeZVxxzL8G12G0ABkP0SLZ/qHVB/EJV9iwcTYUZq+kBD6/fnq2ecrdqbguohTa1+2K8 wdGcU5w1Mi326Pj+TZ8spM6XbPPD8wYjoQo8TskKO2bmPSgZuUzbTp4f25kxnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686640964; a=rsa-sha256; cv=none; b=lkvhhkPZwIKzY+MT5ah4MRa02Y4AECuh+t9Bh0Kb7TNosB9Dx4ksYJNlNPqbQIG0dep9Ka U70cblWjPEOVYVKWuwFnSLQsf3gEZYBJe+p6+JCyPVtoPqHjPil/hZEg4R+pmvAo8LfrNb UhbMuVjiblqqt1wyDVMVGGyd7kK1jwQGA7zrUsIkW1Vvl8gNNGpLTsfKbR+tfUU7TqCGEN 3+yPn/l9hy3C6m6ZE/tLl4wWF9Aud1i5IhokLjFYlKzJsd9o9qz/ru2vb/+Nuq7w/Usj42 LIj2v4/ExIG2nny6XfhSImkEdr4OqWwre/22q7TlSd1D5/MZ/z39Pkx8Ns4Gew== 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 4QgKl8346kz1ClM; Tue, 13 Jun 2023 07:22:44 +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 35D7MiNL030235; Tue, 13 Jun 2023 07:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35D7MiKS030234; Tue, 13 Jun 2023 07:22:44 GMT (envelope-from git) Date: Tue, 13 Jun 2023 07:22:44 GMT Message-Id: <202306130722.35D7MiKS030234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: f1549d7d5229 - main - Write out corrected superblock when creating a UFS/FFS snapshot. 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/main X-Git-Reftype: branch X-Git-Commit: f1549d7d522995bf5d821ae08cc2f500ba545285 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=f1549d7d522995bf5d821ae08cc2f500ba545285 commit f1549d7d522995bf5d821ae08cc2f500ba545285 Author: Kirk McKusick AuthorDate: 2023-06-13 07:21:43 +0000 Commit: Kirk McKusick CommitDate: 2023-06-13 07:22:13 +0000 Write out corrected superblock when creating a UFS/FFS snapshot. When taking a snapshot on a UFS version 1 filesystem we need to call ffs_oldfscompat_write() to unwind any in-memory changes that were made to the superblock before writing it. The cause of this bug was that the trimmed down maximum file size was not being reverted. PR: 271352 Tested-by: Peter Holm MFC-after: 1 week Sponsored-by: The FreeBSD Foundation --- 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 8c3fcdbf72b9..fa744f0fab79 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); } /*