From: Darrick J. Wong Date: Mon, 17 Aug 2020 21:20:17 +0000 (-0400) Subject: xfs_db: fix nlink usage in check X-Git-Tag: v5.8.0-rc1~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4751e054edbe94c89dfb853b022fc9fa00e61036;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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) {