diff options
author | NeilBrown <neilb@suse.com> | 2017-04-05 14:05:51 +1000 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-04-11 10:15:08 -0700 |
commit | 545250f2480911f053b092d4229d9f83a9dff222 (patch) | |
tree | d3851a668cead58445e1dab3cb45d08b954831a5 /drivers/md/md-cluster.c | |
parent | fc9977dd069e4f82fcacb262652117c488647319 (diff) |
md/raid10: simplify handle_read_error()
handle_read_error() duplicates a lot of the work that raid10_read_request()
does, so it makes sense to just use that function.
handle_read_error() relies on the same r10bio being re-used so that,
in the case of a read-only array, setting IO_BLOCKED in r1bio->devs[].bio
ensures read_balance() won't re-use that device.
So when called from raid10_make_request() we clear that array, but not
when called from handle_read_error().
Two parts of handle_read_error() that need to be preserved are the warning
message it prints, so they are conditionally added to
raid10_read_request(). If the failing rdev can be found, messages
are printed. Otherwise they aren't.
Not that as rdev_dec_pending() has already been called on the failing
rdev, we need to use rcu_read_lock() to get a new reference from
the conf. We only use this to get the name of the failing block device.
With this change, we no longer need inc_pending().
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md-cluster.c')
0 files changed, 0 insertions, 0 deletions