diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2015-02-23 19:50:47 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-02-26 09:24:47 +0100 |
commit | a13ccb04af4aa6632c11d59ddf6555aa80ffb139 (patch) | |
tree | 826e0c56038f7f785bd7f976dfd1a6acb5905e25 | |
parent | s390/jump label: improve and fix sanity check (diff) | |
download | linux-a13ccb04af4aa6632c11d59ddf6555aa80ffb139.tar.xz linux-a13ccb04af4aa6632c11d59ddf6555aa80ffb139.zip |
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>
-rw-r--r-- | drivers/s390/block/scm_blk_cluster.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/block/scm_blk_cluster.c b/drivers/s390/block/scm_blk_cluster.c index 09db45296eed..7497ddde2dd6 100644 --- a/drivers/s390/block/scm_blk_cluster.c +++ b/drivers/s390/block/scm_blk_cluster.c @@ -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)) { |