提交 bef95455 编写于 作者: J Josh Durgin 提交者: Ilya Dryomov

rbd: fix snapshot context reference count for discards

Discards take a reference to the snapshot context of an image when
they are created.  This reference needs to be cleaned up when the
request is done just as it is for regular writes.
Signed-off-by: NJosh Durgin <josh.durgin@inktank.com>
上级 3c5df893
......@@ -2170,7 +2170,8 @@ static void rbd_img_request_destroy(struct kref *kref)
rbd_dev_parent_put(img_request->rbd_dev);
}
if (img_request_write_test(img_request))
if (img_request_write_test(img_request) ||
img_request_discard_test(img_request))
ceph_put_snap_context(img_request->snapc);
kmem_cache_free(rbd_img_request_cache, img_request);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册