Commit d30dfeb9 authored by JackieLiu's avatar JackieLiu Committed by Shaohua Li

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: default avatarJackieLiu <liuyun01@kylinos.cn>
Reviewed-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent e2342ca8
...@@ -2492,7 +2492,7 @@ static int r5l_load_log(struct r5l_log *log) ...@@ -2492,7 +2492,7 @@ static int r5l_load_log(struct r5l_log *log)
sector_t cp = log->rdev->journal_tail; sector_t cp = log->rdev->journal_tail;
u32 stored_crc, expected_crc; u32 stored_crc, expected_crc;
bool create_super = false; bool create_super = false;
int ret; int ret = 0;
/* Make sure it's valid */ /* Make sure it's valid */
if (cp >= rdev->sectors || round_down(cp, BLOCK_SECTORS) != cp) if (cp >= rdev->sectors || round_down(cp, BLOCK_SECTORS) != cp)
...@@ -2545,7 +2545,13 @@ static int r5l_load_log(struct r5l_log *log) ...@@ -2545,7 +2545,13 @@ static int r5l_load_log(struct r5l_log *log)
__free_page(page); __free_page(page);
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); ret = r5l_recovery_log(log);
r5c_update_log_state(log); r5c_update_log_state(log);
return ret; return ret;
ioerr: ioerr:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment