diff options
author | Xiao Ni <xni@redhat.com> | 2019-03-08 23:52:05 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-19 13:14:11 +0100 |
commit | 3decc9df1099da2452e0be4c10ec2f4b545ab338 (patch) | |
tree | 188998252541490fa93bc4c2b5133d6f626188f5 /drivers | |
parent | a3a870c02d9bf411d67d86db7bda882a0dcc19d0 (diff) |
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: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid10.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b62e6ab66b31..67414616eb35 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4489,7 +4489,6 @@ bio_full: atomic_inc(&r10_bio->remaining); read_bio->bi_next = NULL; generic_make_request(read_bio); - sector_nr += nr_sectors; sectors_done += nr_sectors; if (sector_nr <= last) goto read_more; |