On Thu, Dec 16, 2021 at 10:53 PM Mariusz Tkaczyk <mariusz.tkaczyk@xxxxxxxxxxxxxxx> wrote: > > Patch 62f7b1989c0 ("md raid0/linear: Mark array as 'broken' and fail BIOs > if a member is gone") allowed to finish writes earlier (before level > dependent actions) for non-redundant arrays. > > To achieve that MD_BROKEN is added to mddev->flags if drive disappearance > is detected. This is done in is_mddev_broken() which is confusing and not > consistent with other levels where error_handler() is used. > This patch adds appropriate error_handler for raid0 and linear. > > It also adopts md_error(), we only want to call .error_handler for those > levels. mddev->pers->sync_request is additionally checked, its existence > implies a level with redundancy. > > Usage of error_handler causes that disk failure can be requested from > userspace. User can fail the array via #mdadm --set-faulty command. This > is not safe and will be fixed in mdadm. It is correctable because failed > state is not recorded in the metadata. After next assembly array will be > read-write again. For safety reason is better to keep MD_BROKEN in > runtime only. Hi Mariusz Let me call them chapter[1-4] Could you explain more about 'mdadm --set-faulty' part? I've read this patch. But I don't know the relationship between the patch and chapter4. In patch2, you write "As in previous commit, it causes that #mdadm --set-faulty is able to mark array as failed." I tried to run command `mdadm /dev/md0 -f /dev/sda`. md0 is a raid0. It can't remove sda from md0. Best Regards Xiao