public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] xfs: check _btree_check_block value
@ 2017-07-18 18:24 Darrick J. Wong
  2017-07-18 18:24 ` [PATCH 2/3] xfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Darrick J. Wong @ 2017-07-18 18:24 UTC (permalink / raw)
  To: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Check the _btree_check_block return value for the firstrec and lastrec
functions, since we have the ability to signal that the repositioning
did not succeed.

Fixes-coverity-id: 114067
Fixes-coverity-id: 114068
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_btree.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 4da85ff..e0bcc4a 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -728,7 +728,8 @@ xfs_btree_firstrec(
 	 * Get the block pointer for this level.
 	 */
 	block = xfs_btree_get_block(cur, level, &bp);
-	xfs_btree_check_block(cur, block, level, bp);
+	if (xfs_btree_check_block(cur, block, level, bp))
+		return 0;
 	/*
 	 * It's empty, there is no such record.
 	 */
@@ -757,7 +758,8 @@ xfs_btree_lastrec(
 	 * Get the block pointer for this level.
 	 */
 	block = xfs_btree_get_block(cur, level, &bp);
-	xfs_btree_check_block(cur, block, level, bp);
+	if (xfs_btree_check_block(cur, block, level, bp))
+		return 0;
 	/*
 	 * It's empty, there is no such record.
 	 */


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-19 16:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 18:24 [PATCH 1/3] xfs: check _btree_check_block value Darrick J. Wong
2017-07-18 18:24 ` [PATCH 2/3] xfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write Darrick J. Wong
2017-07-19 13:20   ` Brian Foster
2017-07-19 15:39     ` Darrick J. Wong
2017-07-19 16:10       ` Brian Foster
2017-07-18 18:24 ` [PATCH 3/3] xfs: check _alloc_read_agf buffer pointer before using Darrick J. Wong
2017-07-19 13:20   ` Brian Foster
2017-07-19 15:48     ` Darrick J. Wong
2017-07-19 13:20 ` [PATCH 1/3] xfs: check _btree_check_block value Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox