linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* raid1 data corruption during resync
@ 2014-08-29 19:29 Eivind Sarto
  2014-09-02 14:10 ` Brassow Jonathan
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Eivind Sarto @ 2014-08-29 19:29 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

I am seeing occasional data corruption during raid1 resync.
Reviewing the raid1 code, I suspect that commit 79ef3a8aa1cb1523cc231c9a90a278333c21f761 introduced a bug.
Prior to this commit raise_barrier() used to wait for conf->nr_pending to become zero.  It no longer does this.
It is not easy to reproduce the corruption, so I wanted to ask about the following potential fix while I am still testing it.
Once I validate that the fix indeed works, I will post a proper patch.
Do you have any feedback?

— drivers/md/raid1.c	2014-08-22 15:19:15.000000000 -0700
+++ /tmp/raid1.c	2014-08-29 12:07:51.000000000 -0700
@@ -851,7 +851,7 @@ static void raise_barrier(struct r1conf 
 	 *    handling.
 	 */
 	wait_event_lock_irq(conf->wait_barrier,
-			    !conf->array_frozen &&
+			    !conf->array_frozen && !conf->nr_pending &&
 			    conf->barrier < RESYNC_DEPTH &&
 			    (conf->start_next_window >=
 			     conf->next_resync + RESYNC_SECTORS),


--
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] 16+ messages in thread
[parent not found: <D4FE2D75-4208-48C9-A4D0-432F092E5AE9@redhat.com>]

end of thread, other threads:[~2014-09-09  1:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29 19:29 raid1 data corruption during resync Eivind Sarto
2014-09-02 14:10 ` Brassow Jonathan
2014-09-02 16:43   ` Eivind Sarto
2014-09-02 17:04   ` Eivind Sarto
2014-09-02 16:59 ` Brassow Jonathan
2014-09-02 19:24 ` Brassow Jonathan
2014-09-02 22:07   ` Eivind Sarto
2014-09-02 22:14     ` Brassow Jonathan
2014-09-02 23:55     ` NeilBrown
2014-09-03  0:48       ` Eivind Sarto
2014-09-03  1:18       ` Brassow Jonathan
2014-09-03  1:31         ` NeilBrown
2014-09-03  1:45           ` Brassow Jonathan
2014-09-03 21:39             ` Brassow Jonathan
2014-09-04  5:28               ` NeilBrown
     [not found] <D4FE2D75-4208-48C9-A4D0-432F092E5AE9@redhat.com>
2014-09-08 15:52 ` Fwd: " Brassow Jonathan
2014-09-09  1:08   ` NeilBrown

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).