提交 27143c71 编写于 作者: X Xiao Ni 提交者: Greg Kroah-Hartman

It's wrong to add len to sector_nr in raid10 reshape twice

commit b761dcf1217760a42f7897c31dcb649f59b2333e upstream.

In reshape_request it already adds len to sector_nr already. It's wrong to add len to
sector_nr again after adding pages to bio. If there is bad block it can't copy one chunk
at a time, it needs to goto read_more. Now the sector_nr is wrong. It can cause data
corruption.

Cc: stable@vger.kernel.org # v3.16+
Signed-off-by: NXiao Ni <xni@redhat.com>
Signed-off-by: NSong Liu <songliubraving@fb.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d6b577c6
...@@ -4630,7 +4630,6 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, ...@@ -4630,7 +4630,6 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
atomic_inc(&r10_bio->remaining); atomic_inc(&r10_bio->remaining);
read_bio->bi_next = NULL; read_bio->bi_next = NULL;
generic_make_request(read_bio); generic_make_request(read_bio);
sector_nr += nr_sectors;
sectors_done += nr_sectors; sectors_done += nr_sectors;
if (sector_nr <= last) if (sector_nr <= last)
goto read_more; goto read_more;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册