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
This commit is contained in:
Kirk McKusick 2023-03-23 13:03:20 -07:00
parent c16c4ea6d3
commit 42c82aad32

View file

@ -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)