]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: fix nlink usage in check
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 17 Aug 2020 21:20:17 +0000 (17:20 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 17 Aug 2020 21:20:17 +0000 (17:20 -0400)
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/check.c

index c2233a0d1ba7c5b55e1985d276dab273d9dd1fd8..ef0e82d4efa1437cb1ec71f3071ef40e73961ee1 100644 (file)
@@ -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) {