aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 503e64f51fe1..69eab66b6c67 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -214,6 +214,7 @@ struct rbd_img_request {
214 spinlock_t completion_lock;/* protects next_completion */ 214 spinlock_t completion_lock;/* protects next_completion */
215 u32 next_completion; 215 u32 next_completion;
216 rbd_img_callback_t callback; 216 rbd_img_callback_t callback;
217 int result; /* first nonzero obj_request result */
217 218
218 u32 obj_request_count; 219 u32 obj_request_count;
219 struct list_head obj_requests; /* rbd_obj_request structs */ 220 struct list_head obj_requests; /* rbd_obj_request structs */
@@ -1488,6 +1489,7 @@ static struct rbd_img_request *rbd_img_request_create(
1488 spin_lock_init(&img_request->completion_lock); 1489 spin_lock_init(&img_request->completion_lock);
1489 img_request->next_completion = 0; 1490 img_request->next_completion = 0;
1490 img_request->callback = NULL; 1491 img_request->callback = NULL;
1492 img_request->result = 0;
1491 img_request->obj_request_count = 0; 1493 img_request->obj_request_count = 0;
1492 INIT_LIST_HEAD(&img_request->obj_requests); 1494 INIT_LIST_HEAD(&img_request->obj_requests);
1493 kref_init(&img_request->kref); 1495 kref_init(&img_request->kref);
@@ -1552,13 +1554,16 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
1552 if (!obj_request_done_test(obj_request)) 1554 if (!obj_request_done_test(obj_request))
1553 break; 1555 break;
1554 1556
1555 rbd_assert(obj_request->xferred <= (u64) UINT_MAX); 1557 rbd_assert(obj_request->xferred <= (u64)UINT_MAX);
1556 xferred = (unsigned int) obj_request->xferred; 1558 xferred = (unsigned int)obj_request->xferred;
1557 result = (int) obj_request->result; 1559 result = obj_request->result;
1558 if (result) 1560 if (result) {
1559 rbd_warn(NULL, "obj_request %s result %d xferred %u\n", 1561 rbd_warn(NULL, "obj_request %s result %d xferred %u\n",
1560 img_request->write_request ? "write" : "read", 1562 img_request->write_request ? "write" : "read",
1561 result, xferred); 1563 result, xferred);
1564 if (!img_request->result)
1565 img_request->result = result;
1566 }
1562 1567
1563 more = blk_end_request(img_request->rq, result, xferred); 1568 more = blk_end_request(img_request->rq, result, xferred);
1564 which++; 1569 which++;