提交 a13ccb04 编写于 作者: S Sebastian Ott 提交者: 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: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册