linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: ravichandra <vmynidi@caviumnetworks.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Problem regarding RAID10 on kernel 2.6.31
Date: Fri, 6 Aug 2010 20:14:35 +1000	[thread overview]
Message-ID: <20100806201435.5a3cb1f9@notabene> (raw)
In-Reply-To: <1281087718.14259.5.camel@venkata-pc.in.caveonetworks.com>

On Fri, 06 Aug 2010 15:11:58 +0530
ravichandra <vmynidi@caviumnetworks.com> wrote:

> Hi everyone,
>                  I  used 2 (1 TB disks) disks each with 3
> partitions(sda[1-3] and sdb[1-3]).Using sda[1-2] and sdb[1-2] i have
> created a RAID10 array say md2. Then  i was reading and writing to the
> array and simultaneously removing a disk and adding it to the same
> array. In the process i got a hang causing recovery process to halt. The
> array was not operational after.These were done on kernel 2.6.31.
> 
>            I am working on the RAID10 for the first time. Can someone
> help in this so that i can proceed further?? 
> 
> Thanks in advance.

Known problem.  I'll be submitting the fix upstream shortly.  I include it
below.
Thanks for the report
NeilBrown


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



diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 42e64e4..d1d6891 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -825,11 +825,29 @@ static int make_request(mddev_t *mddev, struct bio * bio)
 		 */
 		bp = bio_split(bio,
 			       chunk_sects - (bio->bi_sector & (chunk_sects - 1)) );
+
+		/* Each of these 'make_request' calls will call 'wait_barrier'.
+		 * If the first succeeds but the second blocks due to the resync
+		 * thread raising the barrier, we will deadlock because the
+		 * IO to the underlying device will be queued in generic_make_request
+		 * and will never complete, so will never reduce nr_pending.
+		 * So increment nr_waiting here so no new raise_barriers will
+		 * succeed, and so the second wait_barrier cannot block.
+		 */
+		spin_lock_irq(&conf->resync_lock);
+		conf->nr_waiting++;
+		spin_unlock_irq(&conf->resync_lock);
+
 		if (make_request(mddev, &bp->bio1))
 			generic_make_request(&bp->bio1);
 		if (make_request(mddev, &bp->bio2))
 			generic_make_request(&bp->bio2);
 
+		spin_lock_irq(&conf->resync_lock);
+		conf->nr_waiting--;
+		wake_up(&conf->wait_barrier);
+		spin_unlock_irq(&conf->resync_lock);
+
 		bio_pair_release(bp);
 		return 0;
 	bad_map:

  reply	other threads:[~2010-08-06 10:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06  9:41 Problem regarding RAID10 on kernel 2.6.31 ravichandra
2010-08-06 10:14 ` Neil Brown [this message]
2010-08-09  7:39   ` ravichandra
2010-08-09  8:10     ` Neil Brown
2010-10-18 21:23       ` Hari Subramanian
2010-10-18 22:38         ` Neil Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100806201435.5a3cb1f9@notabene \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=vmynidi@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).