xfs: fix inverted return from xfs_btree_sblock_verify_crc
authorEric Sandeen <sandeen@redhat.com>
Fri, 30 Nov 2018 15:55:57 +0000 (07:55 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 4 Dec 2018 16:50:49 +0000 (08:50 -0800)
xfs_btree_sblock_verify_crc is a bool so should not be returning
a failaddr_t; worse, if xfs_log_check_lsn fails it returns
__this_address which looks like a boolean true (i.e. success)
to the caller.

(interestingly xfs_btree_lblock_verify_crc doesn't have the issue)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_btree.c

index 34c6d7bd4d180c736d8da7e6c33a413ee177ac5f..bbdae2b4559fc91d0e7f650fcfe6ed81868b5512 100644 (file)
@@ -330,7 +330,7 @@ xfs_btree_sblock_verify_crc(
 
        if (xfs_sb_version_hascrc(&mp->m_sb)) {
                if (!xfs_log_check_lsn(mp, be64_to_cpu(block->bb_u.s.bb_lsn)))
-                       return __this_address;
+                       return false;
                return xfs_buf_verify_cksum(bp, XFS_BTREE_SBLOCK_CRC_OFF);
        }