Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42dd037c authored by Ilya Dryomov's avatar Ilya Dryomov Committed by Yan, Zheng
Browse files

rbd: fix error paths in rbd_img_request_fill()

Doing rbd_obj_request_put() in rbd_img_request_fill() error paths is
not only insufficient, but also triggers an rbd_assert() in
rbd_obj_request_destroy():

    Assertion failure in rbd_obj_request_destroy() at line 1867:

    rbd_assert(obj_request->img_request == NULL);

rbd_img_obj_request_add() adds obj_requests to the img_request, the
opposite is rbd_img_obj_request_del().  Use it.

Fixes: http://tracker.ceph.com/issues/7327



Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
parent 62054da6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2252,7 +2252,7 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,

out_unwind:
	for_each_obj_request_safe(img_request, obj_request, next_obj_request)
		rbd_obj_request_put(obj_request);
		rbd_img_obj_request_del(img_request, obj_request);

	return -ENOMEM;
}