git: 42c82aad327d - main - Improve chance of finding an alternate superblock in sbsearch(3).

From: Kirk McKusick <mckusick_at_FreeBSD.org>
Date: Thu, 23 Mar 2023 20:05:24 UTC
The branch main has been updated by mckusick:

URL: https://cgit.FreeBSD.org/src/commit/?id=42c82aad327d28cddba70ccd86986a5e5910ca0d

commit 42c82aad327d28cddba70ccd86986a5e5910ca0d
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2023-03-23 20:03:20 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2023-03-23 20:04:52 +0000

    Improve chance of finding an alternate superblock in sbsearch(3).
    
    When requesting a superblock read for the sole purpose of getting
    the parameters needed to find if backup parameters have been stored,
    specify UFS_NOCSUM as only the base superblock is needed. This
    change reduces the number of checks that the superblock must pass.
    
    MFC after:    1 week
---
 sys/ufs/ffs/ffs_subr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c
index 1d4d98fcb67d..ba1d8c5c13c9 100644
--- a/sys/ufs/ffs/ffs_subr.c
+++ b/sys/ufs/ffs/ffs_subr.c
@@ -682,7 +682,7 @@ ffs_sbsearch(void *devfd, struct fs **fsp, int reqflags,
 	 */
 	if (msg)
 		printf("Attempted recovery for standard superblock: failed\n");
-	flags = UFS_FSRONLY | UFS_NOHASHFAIL | UFS_NOMSG;
+	flags = UFS_FSRONLY | UFS_NOHASHFAIL | UFS_NOCSUM | UFS_NOMSG;
 	if (ffs_sbget(devfd, &protofs, UFS_STDSB, flags, filltype,
 	    readfunc) == 0) {
 		if (msg)