All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Michael Guntsche <mike@it-loops.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
	linux-raid@vger.kernel.org, Robin Hill <robin@robinhill.me.uk>
Subject: Re: Strange RAID-5 rebuild problem
Date: Mon, 3 Mar 2008 11:33:36 +1100	[thread overview]
Message-ID: <18379.18272.464486.925011@notabene.brown> (raw)
In-Reply-To: message from Michael Guntsche on Sunday March 2

On Sunday March 2, mike@it-loops.com wrote:
> 
> So apparently it does switch to read-write on the first write  
> request, but the rebuild is not continuing.

Yes. 
This bug is fixed by the following patch which I have just sent of for
inclusion in mainline.
The patches talks about "reshape" but it applies to "resync" too.

The workaround is to "mdadm -w" before the first write.

Thanks,
NeilBrown


Make sure a reshape is started when device switches to read-write.

A resync/reshape/recovery thread will refuse to progress when the
array is marked read-only.  So whenever it mark it not read-only, it
is important to wake up thread resync thread.
There is one place we didn't do this.

The problem manifests if the start_ro module parameters is set, and a
raid5 array that is in the middle of a reshape (restripe) is started.
The array will initially be semi-read-only (meaning it acts like it is
readonly until the first write).  So the reshape will not proceed.

On the first write, the array will become read-write, but the reshape
will not be started, and there is no event which will ever restart
that thread.

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./drivers/md/md.c |    1 +
 1 file changed, 1 insertion(+)

diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c	2008-02-22 15:46:25.000000000 +1100
+++ ./drivers/md/md.c	2008-02-22 15:46:52.000000000 +1100
@@ -5356,6 +5356,7 @@ void md_write_start(mddev_t *mddev, stru
 		mddev->ro = 0;
 		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
 		md_wakeup_thread(mddev->thread);
+		md_wakeup_thread(mddev->sync_thread);
 	}
 	atomic_inc(&mddev->writes_pending);
 	if (mddev->in_sync) {

  reply	other threads:[~2008-03-03  0:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-01 21:09 Strange RAID-5 rebuild problem Michael Guntsche
2008-03-01 22:02 ` Michael Guntsche
     [not found]   ` <20080301222326.GA20435@cthulhu.home.robinhill.me.uk>
2008-03-01 22:41     ` Michael Guntsche
2008-03-02  7:38       ` Michael Guntsche
2008-03-02  8:14         ` Michael Guntsche
2008-03-02 10:09           ` Michael Tokarev
2008-03-02 10:20             ` Michael Guntsche
2008-03-03  0:33               ` Neil Brown [this message]
2008-03-03 12:38                 ` Michael Guntsche
2008-03-02 12:29           ` Robin Hill
2008-03-02 20:55             ` Michael Guntsche
2008-03-03 17:53         ` Bill Davidsen
  -- strict thread matches above, loose matches on Subject: below --
2008-03-01 20:57 Michael Guntsche

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=18379.18272.464486.925011@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=mike@it-loops.com \
    --cc=mjt@tls.msk.ru \
    --cc=robin@robinhill.me.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.