From ed32e214c4414ba5031c4350b02ae610fd989083 Mon Sep 17 00:00:00 2001 From: Stefan Weinhuber Date: Tue, 14 Apr 2009 15:36:24 +0200 Subject: [PATCH] --- yaml --- r: 143393 b: refs/heads/master c: 52db45c3c55a0fca53077dfd7b123e30cd210aad h: refs/heads/master i: 143391: f73f03c5b280fab0fea79555c081a791f8790c30 v: v3 --- [refs] | 2 +- trunk/drivers/s390/block/dasd_eckd.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 5abcbe765a23..271a7f171fbb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f3445a1a656bc26b07946cc6d20de1ef07c8d116 +refs/heads/master: 52db45c3c55a0fca53077dfd7b123e30cd210aad diff --git a/trunk/drivers/s390/block/dasd_eckd.c b/trunk/drivers/s390/block/dasd_eckd.c index 21254793c604..cb52da033f06 100644 --- a/trunk/drivers/s390/block/dasd_eckd.c +++ b/trunk/drivers/s390/block/dasd_eckd.c @@ -2019,15 +2019,23 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_track( ccw++; recid += count; new_track = 0; + /* first idaw for a ccw may start anywhere */ + if (!idaw_dst) + idaw_dst = dst; } - /* If we start a new idaw, everything is fine and the - * start of the new idaw is the start of this segment. + /* If we start a new idaw, we must make sure that it + * starts on an IDA_BLOCK_SIZE boundary. * If we continue an idaw, we must make sure that the * current segment begins where the so far accumulated * idaw ends */ - if (!idaw_dst) - idaw_dst = dst; + if (!idaw_dst) { + if (__pa(dst) & (IDA_BLOCK_SIZE-1)) { + dasd_sfree_request(cqr, startdev); + return ERR_PTR(-ERANGE); + } else + idaw_dst = dst; + } if ((idaw_dst + idaw_len) != dst) { dasd_sfree_request(cqr, startdev); return ERR_PTR(-ERANGE);