OSDN Git Service

xfs: actually check xfs_btree_check_block return in xfs_btree_islastblock
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 6 Nov 2019 16:47:09 +0000 (08:47 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 11 Nov 2019 20:42:52 +0000 (12:42 -0800)
commit27d9ee577dccec94fb0fc1a14728de64db342f86
tree44111aca40050ec36ddc897f00f78dcd68181f5a
parent23220fe260c4b307da1c1fa82a944c50bf0742e4
xfs: actually check xfs_btree_check_block return in xfs_btree_islastblock

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>
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_btree.h