aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2020-08-15 21:40:36 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2020-08-15 21:40:36 +0000
commitf644caad88237bb645bd7c61ec1c28582978f435 (patch)
tree7670db3c645423bc4964d65d73345389655b21f8 /sbin/fsck_ffs
parentb2d52e5c430464056a4b4363ce3012ce846c1392 (diff)
downloadsrc-f644caad88237bb645bd7c61ec1c28582978f435.tar.gz
src-f644caad88237bb645bd7c61ec1c28582978f435.zip
Use the sbput() function to write alternate superblocks so that
they get a checkhash. PR: 246983 Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=364262
Diffstat (limited to 'sbin/fsck_ffs')
-rw-r--r--sbin/fsck_ffs/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index 6284ce1e5130..f5d53a14e0ff 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -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;