When array parameters are changed old array 'A' is going to be removed and new array 'B' is going to be serviced. If array B is raid0 array (takeovered), array 'A' will never be deleted and mdmon is not going to exit. Scenario: 1. managemon creates array 'B' and inserts it to begin of active arrays list 2. managemon sets field B->replaces = A 3. monitor: finds that array 'B' is raid 0 array and removes it from list information about removing array 'A' from list is lost and array 'A' stays in list forever To resolve this situation wait with removing array 'B' until array 'A' is not removed. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@xxxxxxxxx> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- monitor.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/monitor.c b/monitor.c index 6385555..ff2da9a 100644 --- a/monitor.c +++ b/monitor.c @@ -509,10 +509,14 @@ static int wait_and_act(struct supertype *container, int nowait) for (ap = aap ; *ap ;) { a = *ap; + /* once an array has been deactivated we want to * ask the manager to discard it. + * but to do this we have to wait until replaced + * array is removed */ - if (!a->container || (a->info.array.level == 0)) { + if ((!a->container || (a->info.array.level == 0)) && + !a->replaces) { if (discard_this) { ap = &(*ap)->next; continue; -- 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