]> git.itanic.dy.fi Git - linux-stable/commit
md/r5cache: fix set_syndrome_sources() for data in cache
authorSong Liu <songliubraving@fb.com>
Mon, 13 Mar 2017 20:44:35 +0000 (13:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Mar 2017 11:08:11 +0000 (13:08 +0200)
commit3e037a0fe0b67412eb743c66d22394dca18e6d54
treefece430c74c00ba851ff113b4bb8357cb32e8015
parent2fe91a8e5fd35debb5bea65e3727375da873eed8
md/r5cache: fix set_syndrome_sources() for data in cache

commit 0977762f6d15f13caccc20d71a5dec47d098907d upstream.

Before this patch, device InJournal will be included in prexor
(SYNDROME_SRC_WANT_DRAIN) but not in reconstruct (SYNDROME_SRC_WRITTEN). So it
will break parity calculation. With srctype == SYNDROME_SRC_WRITTEN, we need
include both dev with non-null ->written and dev with R5_InJournal. This fixes
logic in 1e6d690(md/r5cache: caching phase of r5cache)

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid5.c