aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_diag.c')
-rw-r--r--drivers/s390/block/dasd_diag.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index b9a7f7733446..644086ba2ede 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -202,6 +202,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
202 rc = -EIO; 202 rc = -EIO;
203 break; 203 break;
204 } 204 }
205 cqr->intrc = rc;
205 return rc; 206 return rc;
206} 207}
207 208
@@ -505,8 +506,9 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev,
505 return ERR_PTR(-EINVAL); 506 return ERR_PTR(-EINVAL);
506 blksize = block->bp_block; 507 blksize = block->bp_block;
507 /* Calculate record id of first and last block. */ 508 /* Calculate record id of first and last block. */
508 first_rec = req->sector >> block->s2b_shift; 509 first_rec = blk_rq_pos(req) >> block->s2b_shift;
509 last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift; 510 last_rec =
511 (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift;
510 /* Check struct bio and count the number of blocks for the request. */ 512 /* Check struct bio and count the number of blocks for the request. */
511 count = 0; 513 count = 0;
512 rq_for_each_segment(bv, req, iter) { 514 rq_for_each_segment(bv, req, iter) {