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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to