Skip to content

Commit

Permalink
raid5-cache: check stripe finish out of order
Browse files Browse the repository at this point in the history
stripes could finish out of order. Hence r5l_move_io_unit_list() of
__r5l_stripe_write_finished might not move any entry and leave
stripe_end_ios list empty.

This applies on top of http://marc.info/?l=linux-raid&m=144122700510667

Signed-off-by: Shaohua Li <[email protected]>
Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
shligit authored and NeilBrown committed Nov 1, 2015
1 parent bd18f64 commit 85f2f9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/md/raid5-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,13 @@ static void __r5l_stripe_write_finished(struct r5l_io_unit *io)

spin_lock_irqsave(&log->io_list_lock, flags);
__r5l_set_io_unit_state(io, IO_UNIT_STRIPE_END);
/* might move 0 entry */
r5l_move_io_unit_list(&log->flushed_ios, &log->stripe_end_ios,
IO_UNIT_STRIPE_END);
if (list_empty(&log->stripe_end_ios)) {
spin_unlock_irqrestore(&log->io_list_lock, flags);
return;
}

last = list_last_entry(&log->stripe_end_ios,
struct r5l_io_unit, log_sibling);
Expand Down

0 comments on commit 85f2f9a

Please sign in to comment.