From 4751e054edbe94c89dfb853b022fc9fa00e61036 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 17 Aug 2020 17:20:17 -0400 Subject: [PATCH] xfs_db: fix nlink usage in check process_inode uses a local convenience variable to abstract the differences between the ondisk nlink fields in a v1 inode and a v2 inode. Use this variable for checking and reporting errors. Fixes: 6526f30e4801 ("xfs_db: stop misusing an onstack inode") Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Signed-off-by: Eric Sandeen --- db/check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/check.c b/db/check.c index c2233a0d1..ef0e82d4e 100644 --- a/db/check.c +++ b/db/check.c @@ -2797,10 +2797,10 @@ process_inode( be64_to_cpu(dip->di_nblocks), ino); error++; } - if (dip->di_nlink != 0) { + if (nlink != 0) { if (v) dbprintf(_("bad nlink %d for free inode %lld\n"), - be32_to_cpu(dip->di_nlink), ino); + nlink, ino); error++; } if (dip->di_mode != 0) { -- 2.47.3