Skip to content

Commit

Permalink
block/dasd: detailed I/O errors
Browse files Browse the repository at this point in the history
The DASD driver is using FASTFAIL as an equivalent to the
transport errors in SCSI. And the 'steal lock' function maps
roughly to a reservation error. So we should be returning the
appropriate error codes when completing a request.

Acked-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Hannes Reinecke authored and Martin Schwidefsky committed Jul 1, 2013
1 parent f6f8034 commit d1ffc1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2315,6 +2315,9 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
case -EBADE:
error_type = "critical nexus";
break;
case -ETIMEDOUT:
error_type = "timeout";
break;
case -EIO:
default:
error_type = "I/O";
Expand Down
16 changes: 13 additions & 3 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,7 @@ static int _dasd_sleep_on(struct dasd_ccw_req *maincqr, int interruptible)
test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) &&
(!dasd_eer_enabled(device))) {
cqr->status = DASD_CQR_FAILED;
cqr->intrc = -EAGAIN;
cqr->intrc = -ENOLINK;
continue;
}
/* Don't try to start requests if device is stopped */
Expand Down Expand Up @@ -2590,8 +2590,17 @@ static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr)
req = (struct request *) cqr->callback_data;
dasd_profile_end(cqr->block, cqr, req);
status = cqr->block->base->discipline->free_cp(cqr, req);
if (status <= 0)
error = status ? status : -EIO;
if (status < 0)
error = status;
else if (status == 0) {
if (cqr->intrc == -EPERM)
error = -EBADE;
else if (cqr->intrc == -ENOLINK ||
cqr->intrc == -ETIMEDOUT)
error = cqr->intrc;
else
error = -EIO;
}
__blk_end_request_all(req, error);
}

Expand Down Expand Up @@ -2692,6 +2701,7 @@ static void __dasd_block_start_head(struct dasd_block *block)
test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) &&
(!dasd_eer_enabled(block->base))) {
cqr->status = DASD_CQR_FAILED;
cqr->intrc = -ENOLINK;
dasd_schedule_block_bh(block);
continue;
}
Expand Down

0 comments on commit d1ffc1f

Please sign in to comment.