Message ID | 20190809140739.GA3552@mwanda (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Btrfs: Fix an assert statement in __btrfs_map_block() | expand |
On 9.08.19 г. 17:07 ч., Dan Carpenter wrote: > 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> Reviewed-by: Nikolay Borisov <nborisov@suse.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; >
On Fri, Aug 09, 2019 at 05:07:39PM +0300, Dan Carpenter wrote: > 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> Queued for 5.3, thanks.
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;
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(-)