summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2015-08-13 14:31:58 -0700
committerNeilBrown <neilb@suse.com>2015-10-24 17:16:19 +1100
commitb70abcb24711d1327a8a505ab3e931c24cbab0a7 (patch)
treea7acca4e476a5e6166eaf41d34066221b66f67be /drivers/md/raid5.c
parent6d036f7d52e5a9c3b2ff77883db4c34620681804 (diff)
downloadop-kernel-dev-b70abcb24711d1327a8a505ab3e931c24cbab0a7.zip
op-kernel-dev-b70abcb24711d1327a8a505ab3e931c24cbab0a7.tar.gz
raid5: add a new state for stripe log handling
When a stripe finishes construction, we write the stripe to raid in ops_run_io normally. With log, we do a bunch of other operations before the stripe is written to raid. Mainly write the stripe to log disk, flush disk cache and so on. The operations are still driven by raid5d and run in the stripe state machine. We introduce a new state for such stripe (trapped into log). The stripe is in this state from the time it first enters ops_run_io (finish construction) to the time it is written to raid. Since we know the state is only for log, we bypass other check/operation in handle_stripe. Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index b200c19..4b789f1 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4316,6 +4316,9 @@ static void handle_stripe(struct stripe_head *sh)
analyse_stripe(sh, &s);
+ if (test_bit(STRIPE_LOG_TRAPPED, &sh->state))
+ goto finish;
+
if (s.handle_bad_blocks) {
set_bit(STRIPE_HANDLE, &sh->state);
goto finish;
OpenPOWER on IntegriCloud