Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359679
b: refs/heads/master
c: 4dda41d
h: refs/heads/master
i:
  359677: 132c73f
  359675: 812297a
  359671: ad31ed4
  359663: c1ace9b
  359647: 3ddf936
  359615: 79f36e3
  359551: 3d99242
  359423: afe6e6d
v: v3
  • Loading branch information
Alex Elder committed Feb 25, 2013
1 parent e857911 commit ed40ea8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 92a49fb0f79f3300e6e50ddf56238e70678e4202
refs/heads/master: 4dda41d3d76747414586a4bad5615b550e0986b1
19 changes: 16 additions & 3 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,7 @@ static int rbd_img_request_fill_bio(struct rbd_img_request *img_request,
image_offset = img_request->offset;
rbd_assert(image_offset == bio_list->bi_sector << SECTOR_SHIFT);
resid = img_request->length;
rbd_assert(resid > 0);
while (resid) {
const char *object_name;
unsigned int clone_size;
Expand Down Expand Up @@ -1627,8 +1628,10 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
bool more = true;

img_request = obj_request->img_request;

rbd_assert(img_request != NULL);
rbd_assert(img_request->rq != NULL);
rbd_assert(img_request->obj_request_count > 0);
rbd_assert(which != BAD_WHICH);
rbd_assert(which < img_request->obj_request_count);
rbd_assert(which >= img_request->next_completion);
Expand Down Expand Up @@ -1918,6 +1921,19 @@ static void rbd_request_fn(struct request_queue *q)
/* Ignore any non-FS requests that filter through. */

if (rq->cmd_type != REQ_TYPE_FS) {
dout("%s: non-fs request type %d\n", __func__,
(int) rq->cmd_type);
__blk_end_request_all(rq, 0);
continue;
}

/* Ignore/skip any zero-length requests */

offset = (u64) blk_rq_pos(rq) << SECTOR_SHIFT;
length = (u64) blk_rq_bytes(rq);

if (!length) {
dout("%s: zero-length request\n", __func__);
__blk_end_request_all(rq, 0);
continue;
}
Expand Down Expand Up @@ -1947,9 +1963,6 @@ static void rbd_request_fn(struct request_queue *q)
goto end_request;
}

offset = (u64) blk_rq_pos(rq) << SECTOR_SHIFT;
length = (u64) blk_rq_bytes(rq);

result = -EINVAL;
if (WARN_ON(offset && length > U64_MAX - offset + 1))
goto end_request; /* Shouldn't happen */
Expand Down

0 comments on commit ed40ea8

Please sign in to comment.