Skip to content
Commit 816b0acf authored by Wei Fang's avatar Wei Fang Committed by Shaohua Li
Browse files

md:raid1: fix a dead loop when read from a WriteMostly disk



If first_bad == this_sector when we get the WriteMostly disk
in read_balance(), valid disk will be returned with zero
max_sectors. It'll lead to a dead loop in make_request(), and
OOM will happen because of endless allocation of struct bio.

Since we can't get data from this disk in this case, so
continue for another disk.

Signed-off-by: default avatarWei Fang <fangwei1@huawei.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent c05c2ec9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment