Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -92,7 +92,7 @@ bool scm_reserve_cluster(struct scm_request *scmrq)
			add = 0;
			add = 0;
			continue;
			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]) &&
			if (clusters_intersect(req, iter->request[pos]) &&
			    (rq_data_dir(req) == WRITE ||
			    (rq_data_dir(req) == WRITE ||
			     rq_data_dir(iter->request[pos]) == WRITE)) {
			     rq_data_dir(iter->request[pos]) == WRITE)) {