lkml.org 
[lkml]   [2019]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] rbd: Avoid calling BUG() when object_map is not empty
Date
In __rbd_object_map_load, if object_map contains data, return
error -EINVAL upstream, instead of crashing, via BUG. The patch
fixes this issue.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
drivers/block/rbd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 2b184563cd32..6e9a11f32a94 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1892,7 +1892,8 @@ static int __rbd_object_map_load(struct rbd_device *rbd_dev)
int num_pages;
int ret;

- rbd_assert(!rbd_dev->object_map && !rbd_dev->object_map_size);
+ if (rbd_dev->object_map || rbd_dev->object_map_size)
+ return -EINVAL;

num_objects = ceph_get_num_objects(&rbd_dev->layout,
rbd_dev->mapping.size);
--
2.20.1
\
 
 \ /
  Last update: 2019-12-15 17:36    [W:0.025 / U:22.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site