From nobody Mon Jan 10 00:18:42 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 8EAD2193CE91; Mon, 10 Jan 2022 00:18:42 +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 4JXDvQ2258z53Gn; Mon, 10 Jan 2022 00:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 251BD1BA10; Mon, 10 Jan 2022 00:18:42 +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 20A0IgVm032832; Mon, 10 Jan 2022 00:18:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20A0IgMJ032831; Mon, 10 Jan 2022 00:18:42 GMT (envelope-from git) Date: Mon, 10 Jan 2022 00:18:42 GMT Message-Id: <202201100018.20A0IgMJ032831@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: 7ef56fb04984 - main - Avoid unnecessary setting of UFS flag requesting fsck(8) be run. 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: 7ef56fb0498461edf4bf4c482fd8bc6fa126e0e9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641773922; 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=L2Xu4l+TfBtlL5NbIXKxBIoSxkb87IsFYo62kJQA128=; b=foaXY2pm7/kzjOtxnwQHcYLHKLCmQBbHh+ibfnwGdl6YgtOpma20G+x72zlB0SYNp6pvIm bP36uqyCHoggUbpKAZbr459WxMAwWnqpU3H8rj7j6eM33DpQkVogXefvIjgtWgzmGFWh6f P3G71L45yEIOHfj59Te+HBcuIssK5kOfiF/yubb6es6RwfknANXZrdxAMnzJI8KDOpjE3y TUf+3aC0/NZc8SnkEcs/fiRi71LxUM39N1pChb0V53nl+D3NOfpsVOcqZCnkZ0JdsHCOXg dD+rZSHMIsLrsRxg6TzracNwbeuoSq7xYlABikJ3JMag0fDpdByC3KqyLZio5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641773922; a=rsa-sha256; cv=none; b=EhIxbQ+pTu8D1E8EWN9+YXrSwM4qHYhbqc5TY3QEgPWQB3nAuXsa0/PwYZfLR/Xy0Rjzqr VECPe9R++p210l0+Q4VLtYY/vHbpuH+kPGL1QM83tTZGVjANdL3uvvSSwPexRCMVV3oItR dhY1wZNJRYfLrzTYtvHhj0iqiUYGhXERJ8DFVxugW6AYJlOoDedvyXLMIIwXnnq5GLxuI5 10Alk9z2iQ7P/A8n7i1U3RdAWsOA8ZofaoWi6jRqq8z6Q/6LcsTwKdXFy+UaFYP2R3vC8N TOdWz2zfd3G6R+xAAmpFNvWwMucrGkdZifWxlLXyysvx3Upa48B28rFxXurBgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=7ef56fb0498461edf4bf4c482fd8bc6fa126e0e9 commit 7ef56fb0498461edf4bf4c482fd8bc6fa126e0e9 Author: Kirk McKusick AuthorDate: 2022-01-10 00:17:13 +0000 Commit: Kirk McKusick CommitDate: 2022-01-10 00:18:28 +0000 Avoid unnecessary setting of UFS flag requesting fsck(8) be run. When the kernel is requested to mount a filesystem with a bad superblock check hash, it would set the flag in the superblock requesting that the fsck(8) program be run. The flag is only written to disk as part of a superblock update. Since the superblock always has its check hash updated when it is written to disk, the problem for which the flag has been set will no longer exist. Hence, it is counter-productive to set the flag as it will just cause an unnecessary run of fsck if it ever gets written. Sponsored by: Netflix --- sys/ufs/ffs/ffs_subr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index a3b7035e6a96..45fc3aa2cb25 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -277,11 +277,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, if (fs->fs_ckhash != (ckhash = ffs_calc_sbhash(fs))) { if (chkhash == STDSB_NOMSG) return (EINTEGRITY); - if (chkhash == STDSB_NOHASHFAIL_NOMSG) { - fs->fs_flags |= FS_NEEDSFSCK; - fs->fs_fmod = 1; + if (chkhash == STDSB_NOHASHFAIL_NOMSG) return (0); - } #ifdef _KERNEL res = uprintf("Superblock check-hash failed: recorded " "check-hash 0x%x != computed check-hash 0x%x%s\n", @@ -303,8 +300,6 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, if (chkhash == STDSB) return (EINTEGRITY); /* chkhash == STDSB_NOHASHFAIL */ - fs->fs_flags |= FS_NEEDSFSCK; - fs->fs_fmod = 1; return (0); } /* Have to set for old filesystems that predate this field */