提交 3d7e7e1d 编写于 作者: Z Zhengyuan Liu 提交者: Shaohua Li

md/r5cache: do r5c_update_log_state after log recovery

We should update log state after we did a log recovery, current completion
may get wrong log state since log->log_start wasn't initalized until we
called r5l_recovery_log.

At log recovery stage, no lock needed as there is no race conditon.
next_checkpoint field will be initialized in r5l_recovery_log too.
Signed-off-by: NZhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: NShaohua Li <shli@fb.com>
上级 43b96748
......@@ -2542,14 +2542,12 @@ static int r5l_load_log(struct r5l_log *log)
if (log->max_free_space > RECLAIM_MAX_FREE_SPACE)
log->max_free_space = RECLAIM_MAX_FREE_SPACE;
log->last_checkpoint = cp;
log->next_checkpoint = cp;
mutex_lock(&log->io_mutex);
r5c_update_log_state(log);
mutex_unlock(&log->io_mutex);
__free_page(page);
return r5l_recovery_log(log);
ret = r5l_recovery_log(log);
r5c_update_log_state(log);
return ret;
ioerr:
__free_page(page);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册