On Fri, Jun 16, 2023 at 10:24:04PM -0700, Song Liu wrote: > This means export_rdev() calls blkdev_put with a different holder than the > one used by blkdev_get_by_dev(). This is because mddev->major_version == -2 > is not a good check for external metadata. Fix this by using > mddev->external instead. > > Also, do not clear mddev->external in md_clean(), as the flag might be used > later in export_rdev(). Looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>