Skip to content
Commit d1901ef0 authored by Tomáš Hodek's avatar Tomáš Hodek Committed by NeilBrown
Browse files

md/raid1: fix read balance when a drive is write-mostly.



When a drive is marked write-mostly it should only be the
target of reads if there is no other option.

This behaviour was broken by

commit 9dedf603
    md/raid1: read balance chooses idlest disk for SSD

which causes a write-mostly device to be *preferred* is some cases.

Restore correct behaviour by checking and setting
best_dist_disk and best_pending_disk rather than best_disk.

We only need to test one of these as they are both changed
from -1 or >=0 at the same time.

As we leave min_pending and best_dist unchanged, any non-write-mostly
device will appear better than the write-mostly device.

Reported-by: default avatarTomáš Hodek <tomas.hodek@volny.cz>
Reported-by: default avatarDark Penguin <darkpenguin@yandex.ru>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Link: http://marc.info/?l=linux-raid&m=135982797322422
Fixes: 9dedf603
Cc: stable@vger.kernel.org (3.6+)
parent c517d838
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment