提交 4ad12621 编写于 作者: S Sage Weil

libceph: fix ceph_osdc_alloc_request error checks

ceph_osdc_alloc_request returns NULL on failure.
Signed-off-by: NSage Weil <sage@newdream.net>
上级 8c71897b
......@@ -777,9 +777,9 @@ static int rbd_do_request(struct request *rq,
ops,
false,
GFP_NOIO, pages, bio);
if (IS_ERR(req)) {
if (!req) {
up_read(&header->snap_rwsem);
ret = PTR_ERR(req);
ret = -ENOMEM;
goto done_pages;
}
......
......@@ -470,8 +470,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
snapc, ops,
use_mempool,
GFP_NOFS, NULL, NULL);
if (IS_ERR(req))
return req;
if (!req)
return NULL;
/* calculate max write size */
calc_layout(osdc, vino, layout, off, plen, req, ops);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册