summaryrefslogtreecommitdiff
path: root/drivers/md/dm-cache-target.c
diff options
context:
space:
mode:
authorLi Nan <linan122@huawei.com>2023-05-27 17:20:07 +0800
committerSong Liu <song@kernel.org>2023-06-13 15:25:42 -0700
commit6090368abcb40554c660c8c3140ce19ff0f8f66f (patch)
tree0c3be213dfd4a06fab5cf2e4e88ca3feee9112d4 /drivers/md/dm-cache-target.c
parent59f8f0b54c8ffb4521f6bbd1cb6f4dfa5022e75e (diff)
md/raid10: prioritize adding disk to 'removed' mirror
When add a new disk to raid10, it will traverse conf->mirror from start and find one of the following mirror to add: 1. mirror->rdev is set to WantReplacement and it have no replacement, set new disk to mirror->replacement. 2. no mirror->rdev, set new disk to mirror->rdev. There is a array as below (sda is set to WantReplacement): Number Major Minor RaidDevice State 0 8 0 0 active sync set-A /dev/sda - 0 0 1 removed 2 8 32 2 active sync set-A /dev/sdc 3 8 48 3 active sync set-B /dev/sdd Use 'mdadm --add' to add a new disk to this array, the new disk will become sda's replacement instead of add to removed position, which is confusing for users. Meanwhile, after new disk recovery success, sda will be set to Faulty. Prioritize adding disk to 'removed' mirror is a better choice. In the above scenario, the behavior is the same as before, except sda will not be deleted. Before other disks are added, continued use sda is more reliable. Signed-off-by: Li Nan <linan122@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230527092007.3008856-1-linan666@huaweicloud.com
Diffstat (limited to 'drivers/md/dm-cache-target.c')
0 files changed, 0 insertions, 0 deletions