@@ -354,7 +354,7 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
*/
static bool is_suspended(struct mddev *mddev, struct bio *bio)
{
- if (is_md_suspended(mddev))
+ if (is_md_suspended(mddev) || percpu_ref_is_dying(&mddev->active_io))
return true;
if (bio_data_dir(bio) != WRITE)
return false;
@@ -576,7 +576,7 @@ static inline bool md_is_rdwr(struct mddev *mddev)
static inline bool is_md_suspended(struct mddev *mddev)
{
- return percpu_ref_is_dying(&mddev->active_io);
+ return READ_ONCE(mddev->suspended) != 0;
}
static inline int __must_check mddev_lock(struct mddev *mddev)