]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: actually check xfs_btree_check_block return in xfs_btree_islastblock
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 22 Jan 2020 16:29:44 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:44 +0000 (11:29 -0500)
commit85b0f9e0dd0f280c53ab8564de1593fe672d8897
treedcc9b3da2b9adf59ebc5cfc4032de841919cc0fd
parent7bba6d84cdb958f50bcefe8368c79cbba417b22e
xfs: actually check xfs_btree_check_block return in xfs_btree_islastblock

Source kernel commit: 27d9ee577dccec94fb0fc1a14728de64db342f86

Coverity points out that xfs_btree_islastblock doesn't check the return
value of xfs_btree_check_block.  Since the question "Does the cursor
point to the last block in this level?" only makes sense if the caller
previously performed a lookup or seek operation, the block should
already have been checked.

Therefore, check the return value in an ASSERT and turn the whole thing
into a static inline predicate.

Coverity-id: 114069
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_btree.c
libxfs/xfs_btree.h