On Mon, Sep 05, 2011 at 12:37:34 -0400,
  "Clyde E. Kunkel" <clydekunkel7...@cox.net> wrote:
> On 09/05/2011 10:44 AM, Bruno Wolff III wrote:
> > <snip>
> >
> > Neil Brown has a patch for the 3.1 kernel raid issue I am tracking upstream.
> > I'm working on building test kernels and hope to be able to confirm the
> > patch appears to work after a couple of days. (Crashes are random and occur
> > after hours of uptime, so absolute confirmation will be difficult.)
> 
> I see this often and can help test, if you like.

I've attached the patch. You need to build a kernel with it.
Comments can be added to: https://bugzilla.kernel.org/show_bug.cgi?id=41862
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 32323f0..f4622dd 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1099,12 +1099,11 @@ read_again:
                bio_list_add(&conf->pending_bio_list, mbio);
                spin_unlock_irqrestore(&conf->device_lock, flags);
        }
-       r1_bio_write_done(r1_bio);
-
-       /* In case raid1d snuck in to freeze_array */
-       wake_up(&conf->wait_barrier);
-
+       /* Mustn't call r1_bio_write_done before this next test,
+        * as it could result in the bio being freed.
+        */
        if (sectors_handled < (bio->bi_size >> 9)) {
+               r1_bio_write_done(r1_bio);
                /* We need another r1_bio.  It has already been counted
                 * in bio->bi_phys_segments
                 */
@@ -1117,6 +1116,11 @@ read_again:
                goto retry_write;
        }
 
+       r1_bio_write_done(r1_bio);
+
+       /* In case raid1d snuck in to freeze_array */
+       wake_up(&conf->wait_barrier);
+
        if (do_sync || !bitmap || !plugged)
                md_wakeup_thread(mddev->thread);
 
-- 
test mailing list
test@lists.fedoraproject.org
To unsubscribe: 
https://admin.fedoraproject.org/mailman/listinfo/test

Reply via email to