git: 343b9e6219e1 - stable/13 - Fix fsck_ffs -R finds unfixed duplicate block errors when rerunning.

Kirk McKusick mckusick at FreeBSD.org
Fri Apr 2 21:52:19 UTC 2021


The branch stable/13 has been updated by mckusick:

URL: https://cgit.FreeBSD.org/src/commit/?id=343b9e6219e1579efe8980612655ec52d61b0d57

commit 343b9e6219e1579efe8980612655ec52d61b0d57
Author:     Kirk McKusick <mckusick at FreeBSD.org>
AuthorDate: 2021-03-25 00:23:33 +0000
Commit:     Kirk McKusick <mckusick at FreeBSD.org>
CommitDate: 2021-04-02 21:55:58 +0000

    Fix fsck_ffs -R finds unfixed duplicate block errors when rerunning.
    
    (cherry picked from commit 7848b25edd2a513f115de6d91f0a5a8d8fa1aa58)
---
 sbin/fsck_ffs/inode.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 60019425c825..020a69dd72f8 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -600,6 +600,9 @@ setinodebuf(int cg, ino_t inosused)
 	nextino = inum;
 	lastinum = inum;
 	readcount = 0;
+	/* Flush old contents in case they have been updated */
+	flush(fswritefd, &inobuf);
+	inobuf.b_bno = 0;
 	if (inobuf.b_un.b_buf == NULL) {
 		inobufsize = blkroundup(&sblock,
 		    MAX(INOBUFSIZE, sblock.fs_bsize));


More information about the dev-commits-src-all mailing list