1
0
Fork 0

md/raid5-cache: use ring add to prevent overflow

'write_pos' must be protected with 'r5l_ring_add', or it may overflow

Signed-off-by: JackieLiu <liuyun01@kylinos.cn>
Reviewed-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
hifive-unleashed-5.1
JackieLiu 2016-11-28 16:19:19 +08:00 committed by Shaohua Li
parent 9b69173e5c
commit fc833c2a2f
1 changed files with 1 additions and 1 deletions

View File

@ -2084,7 +2084,7 @@ r5c_recovery_rewrite_data_only_stripes(struct r5l_log *log,
ctx->pos, ctx->seq);
mb = page_address(page);
offset = le32_to_cpu(mb->meta_size);
write_pos = ctx->pos + BLOCK_SECTORS;
write_pos = r5l_ring_add(log, ctx->pos, BLOCK_SECTORS);
for (i = sh->disks; i--; ) {
struct r5dev *dev = &sh->dev[i];