Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
a13ccb04 72dace96

+1 -1
+1 -1
drivers/s390/block/scm_blk_cluster.c
··· 92 92 add = 0; 93 93 continue; 94 94 } 95 - for (pos = 0; pos <= iter->aob->request.msb_count; pos++) { 95 + for (pos = 0; pos < iter->aob->request.msb_count; pos++) { 96 96 if (clusters_intersect(req, iter->request[pos]) && 97 97 (rq_data_dir(req) == WRITE || 98 98 rq_data_dir(iter->request[pos]) == WRITE)) {