+static bool is_rdev_idle(struct md_rdev *rdev, bool init)
+{
+ unsigned long last_events = rdev->last_events;
+
+ if (!bdev_is_partition(rdev->bdev))
+ return true;
For md array, I think is_rdev_idle is not useful. Because mddev->last_events must be increased while upper ios come in and idle will be set to false. For dm array, mddev->last_events can't work. So is_rdev_idle is for dm array. If member disk is one partition, is_rdev_idle alwasy returns true, and is_mddev_idle always return true. It's a bug here. Do we need to check bdev_is_partition here?
Best Regards
Xiao