diff options
author | Shaohua Li <shli@fb.com> | 2016-10-27 15:22:13 -0700 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-10-28 22:04:03 -0700 |
commit | 9a8b27fac5bbb77337cc2e5d31d37c9936782d87 (patch) | |
tree | a10573f48736ba5b5e89fdc6f4f7844fae2ce133 /drivers | |
parent | 16f889499a5214ebe038f8bd00f4c0094ed0ed75 (diff) | |
download | linux-9a8b27fac5bbb77337cc2e5d31d37c9936782d87.tar.bz2 |
raid5-cache: correct condition for empty metadata write
As long as we recover one metadata block, we should write the empty metadata
write. The original code could make recovery corrupted if only one meta is
valid.
Reported-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5-cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 981f85515191..a227a9f3ee65 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -1087,7 +1087,7 @@ static int r5l_recovery_log(struct r5l_log *log) * 1's seq + 10 and let superblock points to meta2. The same recovery will * not think meta 3 is a valid meta, because its seq doesn't match */ - if (ctx.seq > log->last_cp_seq + 1) { + if (ctx.seq > log->last_cp_seq) { int ret; ret = r5l_log_write_empty_meta_block(log, ctx.pos, ctx.seq + 10); |