Skip to content

Commit 9a8b27f

Browse files
committed
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>
1 parent 16f8894 commit 9a8b27f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/raid5-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ static int r5l_recovery_log(struct r5l_log *log)
10871087
* 1's seq + 10 and let superblock points to meta2. The same recovery will
10881088
* not think meta 3 is a valid meta, because its seq doesn't match
10891089
*/
1090-
if (ctx.seq > log->last_cp_seq + 1) {
1090+
if (ctx.seq > log->last_cp_seq) {
10911091
int ret;
10921092

10931093
ret = r5l_log_write_empty_meta_block(log, ctx.pos, ctx.seq + 10);

0 commit comments

Comments
 (0)