File tree Expand file tree Collapse file tree 1 file changed +17
-18
lines changed Expand file tree Collapse file tree 1 file changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -1745,26 +1745,25 @@ static inline bool bio_remaining_done(struct bio *bio)
1745
1745
**/
1746
1746
void bio_endio (struct bio * bio )
1747
1747
{
1748
- while ( bio ) {
1749
- if (unlikely (!bio_remaining_done (bio )))
1750
- break ;
1748
+ again :
1749
+ if (unlikely (!bio_remaining_done (bio )))
1750
+ return ;
1751
1751
1752
- /*
1753
- * Need to have a real endio function for chained bios,
1754
- * otherwise various corner cases will break (like stacking
1755
- * block devices that save/restore bi_end_io) - however, we want
1756
- * to avoid unbounded recursion and blowing the stack. Tail call
1757
- * optimization would handle this, but compiling with frame
1758
- * pointers also disables gcc's sibling call optimization.
1759
- */
1760
- if (bio -> bi_end_io == bio_chain_endio ) {
1761
- bio = __bio_chain_endio (bio );
1762
- } else {
1763
- if (bio -> bi_end_io )
1764
- bio -> bi_end_io (bio );
1765
- bio = NULL ;
1766
- }
1752
+ /*
1753
+ * Need to have a real endio function for chained bios, otherwise
1754
+ * various corner cases will break (like stacking block devices that
1755
+ * save/restore bi_end_io) - however, we want to avoid unbounded
1756
+ * recursion and blowing the stack. Tail call optimization would
1757
+ * handle this, but compiling with frame pointers also disables
1758
+ * gcc's sibling call optimization.
1759
+ */
1760
+ if (bio -> bi_end_io == bio_chain_endio ) {
1761
+ bio = __bio_chain_endio (bio );
1762
+ goto again ;
1767
1763
}
1764
+
1765
+ if (bio -> bi_end_io )
1766
+ bio -> bi_end_io (bio );
1768
1767
}
1769
1768
EXPORT_SYMBOL (bio_endio );
1770
1769
You can’t perform that action at this time.
0 commit comments