File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -657,24 +657,22 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio)
657
657
WARN_ON (percpu_ref_is_zero (& mddev -> active_io ));
658
658
percpu_ref_get (& mddev -> active_io );
659
659
mddev -> flush_bio = bio ;
660
- bio = NULL ;
661
- }
662
- spin_unlock_irq (& mddev -> lock );
663
-
664
- if (!bio ) {
660
+ spin_unlock_irq (& mddev -> lock );
665
661
INIT_WORK (& mddev -> flush_work , submit_flushes );
666
662
queue_work (md_wq , & mddev -> flush_work );
667
- } else {
668
- /* flush was performed for some other bio while we waited. */
669
- if (bio -> bi_iter .bi_size == 0 )
670
- /* an empty barrier - all done */
671
- bio_endio (bio );
672
- else {
673
- bio -> bi_opf &= ~REQ_PREFLUSH ;
674
- return false;
675
- }
663
+ return true;
676
664
}
677
- return true;
665
+
666
+ /* flush was performed for some other bio while we waited. */
667
+ spin_unlock_irq (& mddev -> lock );
668
+ if (bio -> bi_iter .bi_size == 0 ) {
669
+ /* pure flush without data - all done */
670
+ bio_endio (bio );
671
+ return true;
672
+ }
673
+
674
+ bio -> bi_opf &= ~REQ_PREFLUSH ;
675
+ return false;
678
676
}
679
677
EXPORT_SYMBOL (md_flush_request );
680
678
You can’t perform that action at this time.
0 commit comments