On Sat, Jun 14, 2025 at 4:18 PM Yu Kuai <yukuai1@xxxxxxxxxxxxxxx> wrote: > > Hi, > > 在 2025/06/11 15:31, Xiao Ni 写道: > > 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. > > > > v1: replace MD_DELETED with MD_CLOSING > > v2: keep MD_CLOSING > > v3: call den_gendisk in mddev_unlock, and remove ->to_remove in stop path > > and adjust the order of patches > > v4: only remove the codes in stop path. > > v5: remove sysfs_remove in md_kobj_release and change EBUSY with ENODEV > > v6: don't initialize ret and add reviewed-by tag > > > > Xiao Ni (3): > > md: call del_gendisk in control path > > md: Don't clear MD_CLOSING until mddev is freed > > md: remove/add redundancy group only in level change > > > > drivers/md/md.c | 49 ++++++++++++++++++++++++++----------------------- > > drivers/md/md.h | 26 ++++++++++++++++++++++++-- > > 2 files changed, 50 insertions(+), 25 deletions(-) > > > > Just running mdadm tests with loop dev in my VM, and found this set can > cause many tests to fail, the first is 02r5grow: > > ++ /usr/sbin/mdadm -A /dev/md0 /dev/loop1 /dev/loop2 /dev/loop3 > ++ rv=1 > ++ case $* in > ++ cat /var/tmp/stderr > mdadm: Unable to initialize sysfs > ++ return 1 > ++ check state UUU > ++ case $1 in > ++ grep -sq 'blocks.*\[UUU\]$' /proc/mdstat > ++ die 'state UUU not found!' > ++ echo -e '\n\tERROR: state UUU not found! \n' > > ERROR: state UUU not found! > > ++ save_log fail > > I do not look into details yet. > Thanks > Hi Kuai You need to use the latest upstream mdadm code https://github.com/md-raid-utilities/mdadm/ Regards Xiao