Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: fix inverted return from xfs_btree_sblock_verify_crc

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>

authored by

Eric Sandeen and committed by
Darrick J. Wong
7d048df4 a579121f

+1 -1
+1 -1
fs/xfs/libxfs/xfs_btree.c
··· 330 330 331 331 if (xfs_sb_version_hascrc(&mp->m_sb)) { 332 332 if (!xfs_log_check_lsn(mp, be64_to_cpu(block->bb_u.s.bb_lsn))) 333 - return __this_address; 333 + return false; 334 334 return xfs_buf_verify_cksum(bp, XFS_BTREE_SBLOCK_CRC_OFF); 335 335 } 336 336