Now del_gendisk is called in a queue work which has a small window that mdadm --stop command exits but the device node still exists. It causes trouble in regression tests. This patch set tries to resolve this problem. Xiao Ni (3): md: Don't clear MD_CLOSING until mddev is freed md: replace MD_DELETED with MD_CLOSING md: call del_gendisk in sync way drivers/md/md.c | 38 +++++++++++++++++++------------------- drivers/md/md.h | 2 -- 2 files changed, 19 insertions(+), 21 deletions(-) -- 2.32.0 (Apple Git-132)