From 43ebc9105e9dafe5145b3e801c05da4736bf6e02 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Tue, 3 Sep 2019 16:49:01 -0300 Subject: mdadm: Introduce new array state 'broken' for raid0/linear Currently if a md raid0/linear array gets one or more members removed while being mounted, kernel keeps showing state 'clean' in the 'array_state' sysfs attribute. Despite udev signaling the member device is gone, 'mdadm' cannot issue the STOP_ARRAY ioctl successfully, given the array is mounted. Nothing else hints that something is wrong (except that the removed devices don't show properly in the output of mdadm 'detail' command). There is no other property to be checked, and if user is not performing reads/writes to the array, even kernel log is quiet and doesn't give a clue about the missing member. This patch is the mdadm counterpart of kernel new array state 'broken'. The 'broken' state mimics the state 'clean' in every aspect, being useful only to distinguish if an array has some member missing. All necessary paths in mdadm were changed to deal with 'broken' state, and in case the tool runs in a kernel that is not updated, it'll work normally, i.e., it doesn't require the 'broken' state in order to work. Also, this patch changes the way the array state is showed in the 'detail' command (for raid0/linear only) - now it takes the 'array_state' sysfs attribute into account instead of only rely in the MD_SB_CLEAN flag. Cc: Jes Sorensen Cc: NeilBrown Cc: Song Liu Signed-off-by: Guilherme G. Piccoli Signed-off-by: Jes Sorensen --- mdmon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mdmon.h') diff --git a/mdmon.h b/mdmon.h index 818367cb..b3d72ac3 100644 --- a/mdmon.h +++ b/mdmon.h @@ -21,7 +21,7 @@ extern const char Name[]; enum array_state { clear, inactive, suspended, readonly, read_auto, - clean, active, write_pending, active_idle, bad_word}; + clean, active, write_pending, active_idle, broken, bad_word}; enum sync_action { idle, reshape, resync, recover, check, repair, bad_action }; -- cgit v1.2.3