If we can't read actual disk state, it shoud be initiated to 0. Overwise it may be out of date value resulting false action later in code (e.g. set disk to improper state). Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@xxxxxxxxx> --- monitor.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index b7287d8..ed3ce49 100644 --- a/monitor.c +++ b/monitor.c @@ -232,6 +232,8 @@ static int read_and_act(struct active_array *a) if (mdi->state_fd >= 0) { mdi->recovery_start = read_resync_start(mdi->recovery_fd); mdi->curr_state = read_dev_state(mdi->state_fd); + } else { + mdi->curr_state = 0; } } -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html