On Fri, Jul 08, 2022 at 09:55:55AM -0600, Logan Gunthorpe wrote: > I agree it's a mess, probably buggy and could use a cleanup with a > free_disk method. But I'm not sure the all_mdevs lifetime issues are the > problem here. If the entry in all_mdevs outlasts the disk, then > md_alloc() will just fail earlier. Many test scripts rely on the fact > that you can stop an mddev and recreate it immediately after. We need > some way of ensuring any deleted disks are fully deleted before trying > to make a new mddev, in case the new one has the same name as one being > deleted. I think those tests are broken. But fortunately that is just an assumption in the tests, while device name reuse is a real problem. I could not reproduce your problem, but on the for-5.20/block tree I see a hang in 10ddf-geometry when running the tests. The branch here: git://git.infradead.org/users/hch/block.git md-lifetime-fixes http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/md-lifetime-fixes fixes that for me and does not introduce new regressions. Can you check if that helps your problem?