summaryrefslogtreecommitdiff
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2016-06-02 09:19:52 +0300
committerShaohua Li <shli@fb.com>2016-06-13 21:54:13 +0300
commit83f1261f5e5516d7cf58a04b97e4e63e747a9157 (patch)
tree69dd751c19fc2d340305178d82d1a4a2d0d4d5aa /drivers/md/raid10.c
parent414e6b9a7032a6c2f5ddf018fdb199190b075170 (diff)
downloadlinux-83f1261f5e5516d7cf58a04b97e4e63e747a9157.tar.xz
md/raid10: fix refounct imbalance when resyncing an array with a replacement device.
If you have a raid10 with a replacement device that is resyncing - e.g. after a crash before the replacement was complete - the write to the replacement will increment nr_pending on the wrong device, which will lead to strangeness. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index ae4dce1cbc42..6044864feb7b 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3229,7 +3229,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
bio->bi_error = -EIO;
sector = r10_bio->devs[i].addr;
- atomic_inc(&conf->mirrors[d].rdev->nr_pending);
+ atomic_inc(&conf->mirrors[d].replacement->nr_pending);
bio->bi_next = biolist;
biolist = bio;
bio->bi_private = r10_bio;