summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5-cache.c
diff options
context:
space:
mode:
authorJackieLiu <liuyun01@kylinos.cn>2016-12-08 08:47:39 +0800
committerShaohua Li <shli@fb.com>2016-12-08 10:01:17 -0800
commitd30dfeb9be25c67c9cfdfd932db57a571fd347b4 (patch)
tree53a8b05f30d1d219002270685d6a876ff9dae84e /drivers/md/raid5-cache.c
parente2342ca832726a840ca6bd196dd2cc073815b08a (diff)
downloadblackbird-obmc-linux-d30dfeb9be25c67c9cfdfd932db57a571fd347b4.tar.gz
blackbird-obmc-linux-d30dfeb9be25c67c9cfdfd932db57a571fd347b4.zip
md/raid5-cache: no recovery is required when create super-block
When create the super-block information, We do not need to do this recovery stage, only need to initialize some variables. Signed-off-by: JackieLiu <liuyun01@kylinos.cn> Reviewed-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r--drivers/md/raid5-cache.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index c3b3124e033b..7c732c5f87c9 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -2492,7 +2492,7 @@ static int r5l_load_log(struct r5l_log *log)
sector_t cp = log->rdev->journal_tail;
u32 stored_crc, expected_crc;
bool create_super = false;
- int ret;
+ int ret = 0;
/* Make sure it's valid */
if (cp >= rdev->sectors || round_down(cp, BLOCK_SECTORS) != cp)
@@ -2545,7 +2545,13 @@ create:
__free_page(page);
- ret = r5l_recovery_log(log);
+ if (create_super) {
+ log->log_start = r5l_ring_add(log, cp, BLOCK_SECTORS);
+ log->seq = log->last_cp_seq + 1;
+ log->next_checkpoint = cp;
+ } else
+ ret = r5l_recovery_log(log);
+
r5c_update_log_state(log);
return ret;
ioerr:
OpenPOWER on IntegriCloud