git: 827622937efa - main - Correct calculation of inode location in getnextino cache.

From: Kirk McKusick <mckusick_at_FreeBSD.org>
Date: Mon, 29 Aug 2022 06:47:25 UTC
The branch main has been updated by mckusick:

URL: https://cgit.FreeBSD.org/src/commit/?id=827622937efa741d5d84d72968cf1580a8c597d8

commit 827622937efa741d5d84d72968cf1580a8c597d8
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2022-08-29 06:44:35 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2022-08-29 06:47:17 +0000

    Correct calculation of inode location in getnextino cache.
    
    Fix for 345bfec.
    
    Reported by:  Peter Holm
    Sponsored by: The FreeBSD Foundation
---
 sbin/fsck_ffs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 1d65ec667d44..f0699aabe349 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -460,11 +460,11 @@ ginode(ino_t inumber, struct inode *ip)
 	}
 	if (sblock.fs_magic == FS_UFS1_MAGIC) {
 		ip->i_dp = (union dinode *)
-		    &ip->i_bp->b_un.b_dinode1[inumber - firstinum];
+		    &ip->i_bp->b_un.b_dinode1[inumber - ip->i_bp->b_index];
 		return;
 	}
 	ip->i_dp = (union dinode *)
-	    &ip->i_bp->b_un.b_dinode2[inumber - firstinum];
+	    &ip->i_bp->b_un.b_dinode2[inumber - ip->i_bp->b_index];
 	if (ffs_verify_dinode_ckhash(&sblock, (struct ufs2_dinode *)ip->i_dp)) {
 		pwarn("INODE CHECK-HASH FAILED");
 		prtinode(ip);