mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
libceph: fix ceph_osdc_alloc_request error checks
ceph_osdc_alloc_request returns NULL on failure. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
8c71897be2
commit
4ad12621e4
2 changed files with 4 additions and 4 deletions
|
@ -777,9 +777,9 @@ static int rbd_do_request(struct request *rq,
|
||||||
ops,
|
ops,
|
||||||
false,
|
false,
|
||||||
GFP_NOIO, pages, bio);
|
GFP_NOIO, pages, bio);
|
||||||
if (IS_ERR(req)) {
|
if (!req) {
|
||||||
up_read(&header->snap_rwsem);
|
up_read(&header->snap_rwsem);
|
||||||
ret = PTR_ERR(req);
|
ret = -ENOMEM;
|
||||||
goto done_pages;
|
goto done_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -470,8 +470,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
|
||||||
snapc, ops,
|
snapc, ops,
|
||||||
use_mempool,
|
use_mempool,
|
||||||
GFP_NOFS, NULL, NULL);
|
GFP_NOFS, NULL, NULL);
|
||||||
if (IS_ERR(req))
|
if (!req)
|
||||||
return req;
|
return NULL;
|
||||||
|
|
||||||
/* calculate max write size */
|
/* calculate max write size */
|
||||||
calc_layout(osdc, vino, layout, off, plen, req, ops);
|
calc_layout(osdc, vino, layout, off, plen, req, ops);
|
||||||
|
|
Loading…
Add table
Reference in a new issue