linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: Fix an assert statement in __btrfs_map_block()
@ 2019-08-09 14:07 Dan Carpenter
  2019-08-09 14:36 ` Nikolay Borisov
  2019-08-22 14:14 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-08-09 14:07 UTC (permalink / raw)
  To: Chris Mason, Nikolay Borisov
  Cc: Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

The btrfs_get_chunk_map() never returns NULL, it returns error pointers.

Fixes: 89b798ad1b42 ("btrfs: Use btrfs_get_io_geometry appropriately")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 6edd1d57e530..e69d135c7d3c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5818,7 +5818,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
 		return ret;
 
 	em = btrfs_get_chunk_map(fs_info, logical, *length);
-	ASSERT(em);
+	ASSERT(!IS_ERR(em));
 	map = em->map_lookup;
 
 	*length = geom.len;
-- 
2.20.1


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

end of thread, other threads:[~2019-08-22 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 14:07 [PATCH] Btrfs: Fix an assert statement in __btrfs_map_block() Dan Carpenter
2019-08-09 14:36 ` Nikolay Borisov
2019-08-22 14:14 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).