From nobody Sun Dec 11 00:38:11 2022 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 4NV5TH6MTMz4jgVx; Sun, 11 Dec 2022 00:38:11 +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 4NV5TH5v0Rz4Gs6; Sun, 11 Dec 2022 00:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670719091; 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=2ZZnX9WTpl1FLufl0et5iTD1AXhtVXZGPb7LrHAwmNE=; b=RRvenHHa9dLquo1DlJxm4DnXg+MZNIlBjPA74lizrRTSyOfsD0f/y1/2asJClcEJGh1g+/ Bhg3bCmtqtYYoD2NPzNN8DtUQPKBOzKx/yJBmqS4mfYFVSBOMdhBJSdDzOD1MhPu00B1fm caGPePHwvu11QYq6bFIgKCev7nb7tRwMXdR7KoDt45ulCFgUDgWm+NCK5R6KEFZ6JtTkr1 MuWyhppMCaPUfwAMLOLJ6CI6n1PbJNVS/4J5WuH8aYz2I12Vr+1KKMHrZFpnYEYxf0Yp/n iKwCgILCBwsJ008I56A/fKcGcBpKGl9+izVLeA7QnDJeE+r+pwfbnv3vVktL5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670719091; 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=2ZZnX9WTpl1FLufl0et5iTD1AXhtVXZGPb7LrHAwmNE=; b=EOUc+Plzyo8IPg3bchZ+utJu9EKZg5peGCXYIiIa34qjP2CVjuIcSBoVmJjjUp94A6X1aS ykwsDOqgPNrDtCuTnsAdvxaPpUhvh1UUmfBZ2jUo7qX5IsLvH2ChJKBvq089amPzYpBS3A FaTKi4dfV86oRQfDNmTxZT0skquUBwYFXAQ3nDFHFznhvsZX2vPsudOcc+gIx6wAOC/8o2 chJViH958k/VtkjslhCtUJWgMhU+j2RdzqhScgGX4QPsURAbeiA9dKPP8836GHXmB7O1XL pSXd0KrJbrTq2loqZt0MaZRf/QH1THSI2UReeTnuqH0mJc6xe5EDgOrlTi14sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670719091; a=rsa-sha256; cv=none; b=sJ5y1wqx8rBCAjrEpDOa5A3+4HN6FG0JG98nMe5wcuY+KtJkmCR8wQ7SjcUt1LwqNiiChP 36PUGRl6luCytd5OWWDjhIE/YSDTVJ596yOEmxjgMxB0rsgjmDN7TmL+2Q1Ywgn5dSFFDu wMCADLIdB5E2G1j8hY5Z67X5pMhS72pbdcq1J70rTVr1tNgRCdzK1SYfOaj+27IXwf4ibW nhWOLhrCIfui9HtLAhUr3CLb5VthcbRVjLmnVYVMrsA92hIaaLvM5XsEnPUYPg5Ti2VLyI 555mfwtQP7iLOUHVl95NlcAPRJggG/UzPQ3RhoiQZBjVmrWQbasrHQoOIq35CA== 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 4NV5TH4zyNzbV4; Sun, 11 Dec 2022 00:38:11 +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 2BB0cBkT003766; Sun, 11 Dec 2022 00:38:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BB0cBL4003765; Sun, 11 Dec 2022 00:38:11 GMT (envelope-from git) Date: Sun, 11 Dec 2022 00:38:11 GMT Message-Id: <202212110038.2BB0cBL4003765@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: 4ca4e92c5af3 - stable/13 - Drop checks with last alternate superblock in fsck_ffs(8). 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: 4ca4e92c5af39ede270df6eb57b3fa0b14f4dbc9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=4ca4e92c5af39ede270df6eb57b3fa0b14f4dbc9 commit 4ca4e92c5af39ede270df6eb57b3fa0b14f4dbc9 Author: Kirk McKusick AuthorDate: 2022-08-04 23:06:43 +0000 Commit: Kirk McKusick CommitDate: 2022-12-11 00:37:17 +0000 Drop checks with last alternate superblock in fsck_ffs(8). (cherry picked from commit 23c8b19c1d13b8fbd10c5941de0f2618f59db1c9) Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/setup.c | 64 ++------------------------------------------------- 1 file changed, 2 insertions(+), 62 deletions(-) diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 05c044395436..56b3c8aff853 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$"); struct inoinfo **inphead, **inpsort; /* info about all inodes */ -struct bufarea asblk; -#define altsblock (*asblk.b_un.b_fs) #define POWEROF2(num) (((num) & ((num) - 1)) == 0) static int calcsb(char *dev, int devfd, struct fs *fs); @@ -163,10 +161,6 @@ setup(char *dev) pfatal("from before 2002 with the command ``fsck -c 2''\n"); exit(EEXIT); } - if ((asblk.b_flags & B_DIRTY) != 0 && !bflag) { - memmove(&altsblock, &sblock, (size_t)sblock.fs_sbsize); - flush(fswritefd, &asblk); - } if (preen == 0 && yflag == 0 && sblock.fs_magic == FS_UFS2_MAGIC && fswritefd != -1 && chkrecovery(fsreadfd) == 0 && reply("SAVE DATA TO FIND ALTERNATE SUPERBLOCKS") != 0) @@ -252,7 +246,7 @@ int readsb(int listerr) { off_t super; - int bad, ret; + int ret; struct fs *fs; super = bflag ? bflag * dev_bsize : @@ -291,58 +285,6 @@ readsb(int listerr) dev_bsize = sblock.fs_fsize / fsbtodb(&sblock, 1); sblk.b_bno = sblock.fs_sblockactualloc / dev_bsize; sblk.b_size = SBLOCKSIZE; - /* - * Compare all fields that should not differ in alternate super block. - * When an alternate super-block is specified this check is skipped. - */ - if (bflag) - goto out; - getblk(&asblk, cgsblock(&sblock, sblock.fs_ncg - 1), sblock.fs_sbsize); - if (asblk.b_errs) - return (0); - bad = 0; -#define CHK(x, y) \ - if (altsblock.x != sblock.x) { \ - bad++; \ - if (listerr && debug) \ - printf("SUPER BLOCK VS ALTERNATE MISMATCH %s: " y " vs " y "\n", \ - #x, (intmax_t)sblock.x, (intmax_t)altsblock.x); \ - } - CHK(fs_sblkno, "%jd"); - CHK(fs_cblkno, "%jd"); - CHK(fs_iblkno, "%jd"); - CHK(fs_dblkno, "%jd"); - CHK(fs_ncg, "%jd"); - CHK(fs_bsize, "%jd"); - CHK(fs_fsize, "%jd"); - CHK(fs_frag, "%jd"); - CHK(fs_bmask, "%#jx"); - CHK(fs_fmask, "%#jx"); - CHK(fs_bshift, "%jd"); - CHK(fs_fshift, "%jd"); - CHK(fs_fragshift, "%jd"); - CHK(fs_fsbtodb, "%jd"); - CHK(fs_sbsize, "%jd"); - CHK(fs_nindir, "%jd"); - CHK(fs_inopb, "%jd"); - CHK(fs_cssize, "%jd"); - CHK(fs_ipg, "%jd"); - CHK(fs_fpg, "%jd"); - CHK(fs_magic, "%#jx"); -#undef CHK - if (bad) { - if (listerr == 0) - return (0); - if (preen) - printf("%s: ", cdevname); - printf( - "VALUES IN SUPER BLOCK LSB=%jd DISAGREE WITH THOSE IN\n" - "LAST ALTERNATE LSB=%jd\n", - sblk.b_bno, asblk.b_bno); - if (reply("IGNORE ALTERNATE SUPER BLOCK") == 0) - return (0); - } -out: /* * If not yet done, update UFS1 superblock with new wider fields. */ @@ -371,10 +313,8 @@ sblock_init(void) fsmodified = 0; lfdir = 0; initbarea(&sblk, BT_SUPERBLK); - initbarea(&asblk, BT_SUPERBLK); sblk.b_un.b_buf = Malloc(SBLOCKSIZE); - asblk.b_un.b_buf = Malloc(SBLOCKSIZE); - if (sblk.b_un.b_buf == NULL || asblk.b_un.b_buf == NULL) + if (sblk.b_un.b_buf == NULL) errx(EEXIT, "cannot allocate space for superblock"); dev_bsize = secsize = DEV_BSIZE; }