linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/r5cache: fix set_syndrome_sources()
@ 2017-03-13 20:44 Song Liu
  2017-03-13 20:58 ` Dan Williams
  2017-03-14 16:52 ` Shaohua Li
  0 siblings, 2 replies; 4+ messages in thread
From: Song Liu @ 2017-03-13 20:44 UTC (permalink / raw)
  To: linux-raid; +Cc: shli, neilb, kernel-team, dan.j.williams, hch, Song Liu

With srctype == SYNDROME_SRC_WRITTEN, we need include both
dev with non-null ->written and dev with R5_InJournal.

Signed-off-by: Song Liu <songliubraving@fb.com>
---
 drivers/md/raid5.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 1c554a8..88cc898 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1499,7 +1499,8 @@ static int set_syndrome_sources(struct page **srcs,
 		     (test_bit(R5_Wantdrain, &dev->flags) ||
 		      test_bit(R5_InJournal, &dev->flags))) ||
 		    (srctype == SYNDROME_SRC_WRITTEN &&
-		     dev->written)) {
+		     (dev->written ||
+		      test_bit(R5_InJournal, &dev->flags)))) {
 			if (test_bit(R5_InJournal, &dev->flags))
 				srcs[slot] = sh->dev[i].orig_page;
 			else
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] md/r5cache: fix set_syndrome_sources()
  2017-03-13 20:44 [PATCH] md/r5cache: fix set_syndrome_sources() Song Liu
@ 2017-03-13 20:58 ` Dan Williams
  2017-03-13 21:20   ` Song Liu
  2017-03-14 16:52 ` Shaohua Li
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Williams @ 2017-03-13 20:58 UTC (permalink / raw)
  To: Song Liu
  Cc: linux-raid, Shaohua Li, NeilBrown, Kernel Team, Christoph Hellwig

On Mon, Mar 13, 2017 at 1:44 PM, Song Liu <songliubraving@fb.com> wrote:
> With srctype == SYNDROME_SRC_WRITTEN, we need include both
> dev with non-null ->written and dev with R5_InJournal.
>

Can you say a bit more about what this fixes? How does this bug
manifest itself (user visible effect), and should this be marked for
-stable?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] md/r5cache: fix set_syndrome_sources()
  2017-03-13 20:58 ` Dan Williams
@ 2017-03-13 21:20   ` Song Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Song Liu @ 2017-03-13 21:20 UTC (permalink / raw)
  To: Dan Williams
  Cc: linux-raid, Shaohua Li, NeilBrown, Kernel Team, Christoph Hellwig


> On Mar 13, 2017, at 1:58 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> 
> On Mon, Mar 13, 2017 at 1:44 PM, Song Liu <songliubraving@fb.com> wrote:
>> With srctype == SYNDROME_SRC_WRITTEN, we need include both
>> dev with non-null ->written and dev with R5_InJournal.
>> 
> 
> Can you say a bit more about what this fixes? How does this bug
> manifest itself (user visible effect), and should this be marked for
> -stable?

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. 

This fixes logic in 1e6d690b9334b7e1b31d25fd8d93e980e449a5f9. 

Thanks,
Song

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] md/r5cache: fix set_syndrome_sources()
  2017-03-13 20:44 [PATCH] md/r5cache: fix set_syndrome_sources() Song Liu
  2017-03-13 20:58 ` Dan Williams
@ 2017-03-14 16:52 ` Shaohua Li
  1 sibling, 0 replies; 4+ messages in thread
From: Shaohua Li @ 2017-03-14 16:52 UTC (permalink / raw)
  To: Song Liu; +Cc: linux-raid, shli, neilb, kernel-team, dan.j.williams, hch

On Mon, Mar 13, 2017 at 01:44:35PM -0700, Song Liu wrote:
> With srctype == SYNDROME_SRC_WRITTEN, we need include both
> dev with non-null ->written and dev with R5_InJournal.

Thanks, applied. I'll add this to stable
 
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---
>  drivers/md/raid5.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 1c554a8..88cc898 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -1499,7 +1499,8 @@ static int set_syndrome_sources(struct page **srcs,
>  		     (test_bit(R5_Wantdrain, &dev->flags) ||
>  		      test_bit(R5_InJournal, &dev->flags))) ||
>  		    (srctype == SYNDROME_SRC_WRITTEN &&
> -		     dev->written)) {
> +		     (dev->written ||
> +		      test_bit(R5_InJournal, &dev->flags)))) {
>  			if (test_bit(R5_InJournal, &dev->flags))
>  				srcs[slot] = sh->dev[i].orig_page;
>  			else
> -- 
> 2.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-14 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 20:44 [PATCH] md/r5cache: fix set_syndrome_sources() Song Liu
2017-03-13 20:58 ` Dan Williams
2017-03-13 21:20   ` Song Liu
2017-03-14 16:52 ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).