# Re: \[PATCH 01/15\] md: remove the code to flush an old instance in md\_open

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2021-03-31 06:53:46 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/03/6401743
- Thread: https://ratatoskr.run/linux-block/2021/03/6401712/t.md

```text
On Wed, Mar 31, 2021 at 11:29:39AM +0800, heming.zhao@suse.com 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.
```
