From nobody Wed Aug 17 22:49:25 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 4M7NVs2ljCz4ZV2P; Wed, 17 Aug 2022 22:49:25 +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 4M7NVs2C1sz3VTN; Wed, 17 Aug 2022 22:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660776565; 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=0AV5lFniltP8PGQg6uZre2Qj124qTsjQ+Ul9qEegUIM=; b=rrkq+rs+gy0WntM55XEePGFMld16mjFT1W2/Q6nZTYRI9otJ1zhRLISHIOaJVO83ul5TbP ipSimp88X0k6Iz/gKj9OSngaNJXj+E20QSkkgBOP7Yo3qaMkmafdqDSKOhncW1o85ix3jF nKDocQw/v0GbRSRULw9eQN85oPZGUffoVto9/bJ4ln2ZxbsfQDDOq+LGBuTUwk9ujuP95B L7qKfiGVV7CilXNstpRiguA876Wueb/e64S7K3pgv+Vfs4UMlnP3cgszQnPwOVCLskq6+4 uEkX2zsZNWkwrlv0NAN7TAwQeL/gg8diA8YUBG40eUhearm2RyLGyuW8c9mUkA== 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 4M7NVs1DKrz16Sk; Wed, 17 Aug 2022 22:49:25 +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 27HMnPY1041375; Wed, 17 Aug 2022 22:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27HMnPQ2041374; Wed, 17 Aug 2022 22:49:25 GMT (envelope-from git) Date: Wed, 17 Aug 2022 22:49:25 GMT Message-Id: <202208172249.27HMnPQ2041374@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: cf1a6ffceec4 - stable/13 - Allow forced r/w mount of UFS/FFS filesystem with a bad check hash. 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: cf1a6ffceec484f33807bab4bdb85d60b73ecff3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660776565; 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=0AV5lFniltP8PGQg6uZre2Qj124qTsjQ+Ul9qEegUIM=; b=tZIZBdlHB+QuhFEz/6PqP2Wsv3oPnOI+H4kAxK6oU4aDzGydXydKPZgxn6WhDVWxFu9yc9 H8D8s3YwKpsxIoOQH2jpQRICT4EiLx/Dpfys7zQ5sMMLNuvPmrS6yVqZ/Er7svdajcj650 LgpadGUIBbuCu8s/XHOEi14O6lQq4wgDNVJ/qOi/o9UdQwi0cGrBgMJ3kIfuf8c97HJlgi gH4DzSK+0Lr/HHhDGKW7laujdcah9zJkhjG9t+O6Bi7udq+a+B01IH3i3mb9TVqxbDksqp CJ69BifT85ApAHM+sZblQ1iZ2kgmrMf1HJqJ3y6UH9J00pJC6WUElz07xD5opg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660776565; a=rsa-sha256; cv=none; b=SVYQ+U/3CYyfyDh14APAmBSQhxzBPaDxGKD3rGDABE2jldAJj9H1p7K9FtN3i4YPI4VlLf R6KcGHQH89U+ZrzFTkAq89fvOhx5MwdJr/p2eDiiAR3suF2PSiPPbjzmdSy1B+HMxUjTyE qy/Fbq/yrwFo+6sXafKHaBNRq7rP8mGA/oqBESZlZq5xDp/bUc/6zPVKwMR6Qi66W9rGoV 77r5txamNSHbkmCyk+zvLsli1oF4FOqQ/WpeJKOGtAcFOD5W4ktYDtiQn3PhwLw6N8F7EB IOD/O2VDXMMBdYoDO0NeBWhrexf236alPEHyX4BwTgcQiSPfjf1uTC9Q/Vye4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=cf1a6ffceec484f33807bab4bdb85d60b73ecff3 commit cf1a6ffceec484f33807bab4bdb85d60b73ecff3 Author: Kirk McKusick AuthorDate: 2021-11-16 00:03:08 +0000 Commit: Kirk McKusick CommitDate: 2022-08-17 22:49:09 +0000 Allow forced r/w mount of UFS/FFS filesystem with a bad check hash. Normally a UFS/FFS filesystem with a bad check hash can only be mounted read only. With this commit the mount(8) -f (force) option can be used to force a read-write mount of a UFS/FFS filesystem with a bad check hash. Conveniently the filesystem will proceed to update its on-disk superblock with a corrected check hash. (cherry picked from commit 9e9dcac95ad0a6c49a01619f82290fbf512fe25b) --- sys/ufs/ffs/ffs_vfsops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 5592f5e59c0d..5daf8e0e607e 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -986,7 +986,7 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) } /* fetch the superblock and summary information */ loc = STDSB; - if ((mp->mnt_flag & MNT_ROOTFS) != 0) + if ((mp->mnt_flag & (MNT_ROOTFS | MNT_FORCE)) != 0) loc = STDSB_NOHASHFAIL; if ((error = ffs_sbget(devvp, &fs, loc, M_UFSMNT, ffs_use_bread)) != 0) goto out;