summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2018-01-20 12:30:10 +0300
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 11:12:39 +0300
commit06fbb6993504974db6334a80b6796d6522ad45eb (patch)
treebfabad5eea35dbf7056a92f506b0a63084e5e728 /drivers/block
parentdf6ba7015dd3a64a2e74353d1e7d19871af86f38 (diff)
downloadlinux-06fbb6993504974db6334a80b6796d6522ad45eb.tar.xz
rbd: don't (ab)use obj_req->pages for stat requests
obj_req->pages is for provided data buffers. stat requests are internal and should be NODATA. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8b9047369ab9..aa3f6a6de12c 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2645,11 +2645,9 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
struct rbd_device *rbd_dev = obj_request->img_request->rbd_dev;
struct rbd_obj_request *stat_request;
struct page **pages;
- u32 page_count;
- size_t size;
int ret;
- stat_request = rbd_obj_request_create(OBJ_REQUEST_PAGES);
+ stat_request = rbd_obj_request_create(OBJ_REQUEST_NODATA);
if (!stat_request)
return -ENOMEM;
@@ -2670,22 +2668,19 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
* le32 tv_nsec;
* } mtime;
*/
- size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32);
- page_count = (u32)calc_pages_for(0, size);
- pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
+ pages = ceph_alloc_page_vector(1, GFP_NOIO);
if (IS_ERR(pages)) {
ret = PTR_ERR(pages);
goto fail_stat_request;
}
osd_req_op_init(stat_request->osd_req, 0, CEPH_OSD_OP_STAT, 0);
- osd_req_op_raw_data_in_pages(stat_request->osd_req, 0, pages, size, 0,
- false, false);
+ osd_req_op_raw_data_in_pages(stat_request->osd_req, 0, pages,
+ 8 + sizeof(struct ceph_timespec),
+ 0, false, true);
rbd_obj_request_get(obj_request);
stat_request->obj_request = obj_request;
- stat_request->pages = pages;
- stat_request->page_count = page_count;
stat_request->callback = rbd_img_obj_exists_callback;
rbd_obj_request_submit(stat_request);