Message ID | 20210205141438.72069-1-jinpu.wang@cloud.ionos.com |
---|---|
State | New |
Headers | show |
Series | [stable-5.4] md: Set prev_flush_start and flush_bio in an atomic way | expand |
diff --git a/drivers/md/md.c b/drivers/md/md.c index ec5dfb7ae4e1..cc38530804c9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -538,8 +538,10 @@ static void md_submit_flush_data(struct work_struct *ws) * could wait for this and below md_handle_request could wait for those * bios because of suspend check */ + spin_lock_irq(&mddev->lock); mddev->last_flush = mddev->start_flush; mddev->flush_bio = NULL; + spin_unlock_irq(&mddev->lock); wake_up(&mddev->sb_wait); if (bio->bi_iter.bi_size == 0) {