svn commit: r364262 - head/sbin/fsck_ffs

Kirk McKusick mckusick at FreeBSD.org
Sat Aug 15 21:40:37 UTC 2020


Author: mckusick
Date: Sat Aug 15 21:40:36 2020
New Revision: 364262
URL: https://svnweb.freebsd.org/changeset/base/364262

Log:
  Use the sbput() function to write alternate superblocks so that
  they get a checkhash.
  
  PR:           246983
  Sponsored by: Netflix

Modified:
  head/sbin/fsck_ffs/main.c

Modified: head/sbin/fsck_ffs/main.c
==============================================================================
--- head/sbin/fsck_ffs/main.c	Sat Aug 15 19:45:50 2020	(r364261)
+++ head/sbin/fsck_ffs/main.c	Sat Aug 15 21:40:36 2020	(r364262)
@@ -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;


More information about the svn-src-head mailing list