Commit a13ccb04 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

s390/scm_block: fix off by one during cluster reservation

We increase the msb_count after we're finished building the request.
That way we can always access the current request via
scmrq->request[msb_count] . But once the request is started we need
to make sure that the array index stays below msb_count.
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 72dace96
......@@ -92,7 +92,7 @@ bool scm_reserve_cluster(struct scm_request *scmrq)
add = 0;
continue;
}
for (pos = 0; pos <= iter->aob->request.msb_count; pos++) {
for (pos = 0; pos < iter->aob->request.msb_count; pos++) {
if (clusters_intersect(req, iter->request[pos]) &&
(rq_data_dir(req) == WRITE ||
rq_data_dir(iter->request[pos]) == WRITE)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment