Commit d435c9a7 authored by Ilya Dryomov's avatar Ilya Dryomov

rbd: restore zeroing past the overlap when reading from parent

The parent image is read only up to the overlap point, the rest of
the buffer should be zeroed.  This snuck in because as it turns out
the overlap test case has not been triggering this code path for
a while now.

Fixes: a9b67e69 ("rbd: replace obj_req->tried_parent with obj_req->read_state")
Signed-off-by: default avatarIlya Dryomov <>
Reviewed-by: default avatarJason Dillaman <>
parent e8c99200
......@@ -3038,6 +3038,17 @@ static bool rbd_obj_advance_read(struct rbd_obj_request *obj_req, int *result)
return true;
* The parent image is read only up to the overlap -- zero-fill
* from the overlap to the end of the request.
if (!*result) {
u32 obj_overlap = rbd_obj_img_extents_bytes(obj_req);
if (obj_overlap < obj_req->ex.oe_len)
rbd_obj_zero_range(obj_req, obj_overlap,
obj_req->ex.oe_len - obj_overlap);
return true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment