aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-09-26 08:07:04 -0400
committerJens Axboe <axboe@kernel.dk>2012-10-30 03:39:18 -0400
commitccae7868b0c5697508a541c531cf96b361d62c1c (patch)
tree3263991e9b8f237808315d4c84cfe04bd2851475
parenta2a3c74f243d5d1793f89ccdceaa6918851f7fce (diff)
drbd: log request sector offset and size for IO errors
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/drbd/drbd_req.c19
-rw-r--r--include/linux/drbd.h2
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index d9e5962a9a8c..135ea76ed502 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -387,6 +387,20 @@ out_conflict:
387 return 1; 387 return 1;
388} 388}
389 389
390static void drbd_report_io_error(struct drbd_conf *mdev, struct drbd_request *req)
391{
392 char b[BDEVNAME_SIZE];
393
394 if (__ratelimit(&drbd_ratelimit_state))
395 return;
396
397 dev_warn(DEV, "local %s IO error sector %llu+%u on %s\n",
398 (req->rq_state & RQ_WRITE) ? "WRITE" : "READ",
399 (unsigned long long)req->sector,
400 req->size >> 9,
401 bdevname(mdev->ldev->backing_bdev, b));
402}
403
390/* obviously this could be coded as many single functions 404/* obviously this could be coded as many single functions
391 * instead of one huge switch, 405 * instead of one huge switch,
392 * or by putting the code directly in the respective locations 406 * or by putting the code directly in the respective locations
@@ -455,6 +469,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
455 req->rq_state |= RQ_LOCAL_COMPLETED; 469 req->rq_state |= RQ_LOCAL_COMPLETED;
456 req->rq_state &= ~RQ_LOCAL_PENDING; 470 req->rq_state &= ~RQ_LOCAL_PENDING;
457 471
472 drbd_report_io_error(mdev, req);
458 __drbd_chk_io_error(mdev, DRBD_WRITE_ERROR); 473 __drbd_chk_io_error(mdev, DRBD_WRITE_ERROR);
459 _req_may_be_done_not_susp(req, m); 474 _req_may_be_done_not_susp(req, m);
460 break; 475 break;
@@ -477,6 +492,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
477 break; 492 break;
478 } 493 }
479 494
495 drbd_report_io_error(mdev, req);
480 __drbd_chk_io_error(mdev, DRBD_READ_ERROR); 496 __drbd_chk_io_error(mdev, DRBD_READ_ERROR);
481 497
482 goto_queue_for_net_read: 498 goto_queue_for_net_read:
@@ -900,7 +916,8 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, uns
900 916
901 if (!(local || remote) && !is_susp(mdev->state)) { 917 if (!(local || remote) && !is_susp(mdev->state)) {
902 if (__ratelimit(&drbd_ratelimit_state)) 918 if (__ratelimit(&drbd_ratelimit_state))
903 dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); 919 dev_err(DEV, "IO ERROR: neither local nor remote data, sector %llu+%u\n",
920 (unsigned long long)req->sector, req->size >> 9);
904 goto fail_free_complete; 921 goto fail_free_complete;
905 } 922 }
906 923
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 4a7eccbd1292..94f58a102bbb 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -53,7 +53,7 @@
53 53
54 54
55extern const char *drbd_buildtag(void); 55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.13" 56#define REL_VERSION "8.3.14"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 97 59#define PRO_VERSION_MAX 97