rbd: zero return code in rbd_dev_image_id()
Subsystems (2)
PATCH 1/1 rbd: zero return code in rbd_dev_image_id()
There is a call in rbd_dev_image_id() to rbd_req_sync_exec() to get the image id for an image. Despite the "get_id" class method only returning 0 on success, I am getting back a positive value (I think the number of bytes returned with the call).
That may or may not be how rbd_req_sync_exec() is supposed to behave, but zeroing the return value if successful makes it moot and makes this path through the code work as desired.
Do the same in rbd_dev_v2_object_prefix().
Signed-off-by Alex Elder <[email protected]>
--- drivers/block/rbd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/block/rbd.c +2 -0
@@ -2207,6 +2207,7 @@ static int rbd_dev_v2_object_prefix(strudout ("%s: rbd_req_sync_exec returned %d\n" , __func__, ret);if (ret <0 ) goto out; + ret =0 ;/* rbd_req_sync_exec() can return positive */ p = reply_buf; rbd_dev->header.object_prefix = ceph_extract_encoded_string(&p,
@@ -2900,6 +2901,7 @@ static int rbd_dev_image_id(struct rbd_ddout ("%s: rbd_req_sync_exec returned %d\n" , __func__, ret);if (ret <0 ) goto out; + ret =0 ;/* rbd_req_sync_exec() can return positive */ p = response; rbd_dev->image_id = ceph_extract_encoded_string(&p,