path: root/sbin/fsck_ffs
diff options
authorKirk McKusick <mckusick@FreeBSD.org>2018-12-15 17:32:47 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2018-12-15 17:32:47 +0000
commite155208020a68aa3ab85f5c9b113ecd909f21905 (patch)
treec5256a91ae47f4bc1df8cd5b072b79686c1b5777 /sbin/fsck_ffs
parent51e712f8654a726bd75a966c765d01964b2182ad (diff)
Fsck would find, report, and offer to fix inode check-hash failures.
If requested to fix the inode check-hash it would confirm having done it, but then fail to make the fix. The same code is used in fsdb which, unlike fsck, would actually fix the inode check-hash. The discrepancy occurred because fsck has two ways to fetch inodes. The inode by number function ginode() and the streaming inode function getnextinode() used during pass1. Fsdb uses the ginode() function which correctly does the fix, while fsck first encounters the bad inode check-hash in pass1 where it is using the getnextinode() function that failed to make the correction. This patch corrects the getnextinode() function so that fsck now correctly fixes inodes with incorrect inode check-hashs. Reported by: Gary Jennejohn <gljennjohn@gmail.com> Sponsored by: Netflix
Notes: svn path=/head/; revision=342128
Diffstat (limited to 'sbin/fsck_ffs')
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 6957a41f70c0..ecaeeea4b197 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -309,6 +309,8 @@ ginode(ino_t inumber)
if (preen || reply("FIX") != 0) {
if (preen)
printf(" (FIXED)\n");
+ ffs_update_dinode_ckhash(&sblock,
+ (struct ufs2_dinode *)dp);