On Wed, Mar 31, 2021 at 11:29:39AM +0800, heming.zhao@xxxxxxxx wrote: > when userspace "mdadm -Ss" finish (the ioctl STOP_ARRAY returns), > mddev->flags will be zero. and you can see my patch email (date: 2021-3-30). > At this time, userspace will execute "mdadm --monitor" to scan the > closing md device. the md_open will trigger very soon. at this time, > bdev->bd_disk->private_data is only a skeleton, your shouldn't trust & use it. Ermm, the block layer rules require the device to be fully set up when add_disk is called. So if that is not the case (and I'd like to see hints how) we need to fix this properly instead of using a hack in ->open.