summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5-cache.c
diff options
context:
space:
mode:
authorShaohua Li2015-09-04 23:14:05 +0200
committerNeilBrown2015-11-01 03:48:26 +0100
commit85f2f9a4f49d3e3230b3c5fb08362d561691421e (patch)
tree2cac2cfdac6a7f602ea81f8bd20c38f7269c9a22 /drivers/md/raid5-cache.c
parentmd: skip resync for raid array with journal (diff)
downloadkernel-qcow2-linux-85f2f9a4f49d3e3230b3c5fb08362d561691421e.tar.gz
kernel-qcow2-linux-85f2f9a4f49d3e3230b3c5fb08362d561691421e.tar.xz
kernel-qcow2-linux-85f2f9a4f49d3e3230b3c5fb08362d561691421e.zip
raid5-cache: check stripe finish out of order
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 <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r--drivers/md/raid5-cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index ea1480392eba..30c7e5e79a02 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -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);