Use the sbput() function to write alternate superblocks so that

they get a checkhash.

PR:           246983
Sponsored by: Netflix
This commit is contained in:
Kirk McKusick 2020-08-15 21:40:36 +00:00
parent b2d52e5c43
commit f644caad88
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364262

View File

@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <fstab.h>
#include <grp.h>
#include <inttypes.h>
#include <libufs.h>
#include <mntopts.h>
#include <paths.h>
#include <stdint.h>
@ -604,10 +605,8 @@ checkfilesys(char *filesys)
/*
* Write out the duplicate super blocks
*/
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
blwrite(fswritefd, (char *)&sblock,
fsbtodb(&sblock, cgsblock(&sblock, cylno)),
SBLOCKSIZE);
if (sbput(fswritefd, &sblock, sblock.fs_ncg) == 0)
fsmodified = 1;
}
if (rerun)
resolved = 0;