Date: Sat, 15 Aug 2020 21:40:37 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364262 - head/sbin/fsck_ffs Message-ID: <202008152140.07FLebuI002267@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008152140.07FLebuI002267>