<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/raid10.c, branch v3.0.86</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md/raid10.c?h=v3.0.86</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md/raid10.c?h=v3.0.86'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-07-16T15:47:52Z</updated>
<entry>
<title>md/raid10: Don't try to recovery unmatched (and unused) chunks.</title>
<updated>2012-07-16T15:47:52Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-07-03T00:37:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cc675040202e8f4e825a91997319b4b0bf9e9960'/>
<id>urn:sha1:cc675040202e8f4e825a91997319b4b0bf9e9960</id>
<content type='text'>
commit fc448a18ae6219af9a73257b1fbcd009efab4a81 upstream.

If a RAID10 has an odd number of chunks - as might happen when there
are an odd number of devices - the last chunk has no pair and so is
not mirrored.  We don't store data there, but when recovering the last
device in an array we retry to recover that last chunk from a
non-existent location.  This results in an error, and the recovery
aborts.

When we get to that last chunk we should just stop - there is nothing
more to do anyway.

This bug has been present since the introduction of RAID10, so the
patch is appropriate for any -stable kernel.

Reported-by: Christian Balzer &lt;chibi@gol.com&gt;
Tested-by: Christian Balzer &lt;chibi@gol.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>md/raid1,raid10: avoid deadlock during resync/recovery.</title>
<updated>2012-04-02T16:27:11Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-03-19T01:46:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4db1aef6a2b79aba4f862285c2658348e083f2b7'/>
<id>urn:sha1:4db1aef6a2b79aba4f862285c2658348e083f2b7</id>
<content type='text'>
commit d6b42dcb995e6acd7cc276774e751ffc9f0ef4bf upstream.

If RAID1 or RAID10 is used under LVM or some other stacking
block device, it is possible to enter a deadlock during
resync or recovery.
This can happen if the upper level block device creates
two requests to the RAID1 or RAID10.  The first request gets
processed, blocks recovery and queue requests for underlying
requests in current-&gt;bio_list.  A resync request then starts
which will wait for those requests and block new IO.

But then the second request to the RAID1/10 will be attempted
and it cannot progress until the resync request completes,
which cannot progress until the underlying device requests complete,
which are on a queue behind that second request.

So allow that second request to proceed even though there is
a resync request about to start.

This is suitable for any -stable kernel.

Reported-by: Ray Morris &lt;support@bettercgi.com&gt;
Tested-by: Ray Morris &lt;support@bettercgi.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>md: Avoid waking up a thread after it has been freed.</title>
<updated>2011-10-16T21:14:53Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-09-21T05:30:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7f3b5ef8184a929f56293d6c7a88f426c7b74558'/>
<id>urn:sha1:7f3b5ef8184a929f56293d6c7a88f426c7b74558</id>
<content type='text'>
commit 01f96c0a9922cd9919baf9d16febdf7016177a12 upstream.

Two related problems:

1/ some error paths call "md_unregister_thread(mddev-&gt;thread)"
   without subsequently clearing -&gt;thread.  A subsequent call
   to mddev_unlock will try to wake the thread, and crash.

2/ Most calls to md_wakeup_thread are protected against the thread
   disappeared either by:
      - holding the -&gt;mutex
      - having an active request, so something else must be keeping
        the array active.
   However mddev_unlock calls md_wakeup_thread after dropping the
   mutex and without any certainty of an active request, so the
   -&gt;thread could theoretically disappear.
   So we need a spinlock to provide some protections.

So change md_unregister_thread to take a pointer to the thread
pointer, and ensure that it always does the required locking, and
clears the pointer properly.

Reported-by: "Moshe Melnikov" &lt;moshe@zadarastorage.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>md/raid10:  reformat some loops with less indenting.</title>
<updated>2011-05-11T04:54:41Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-05-11T04:54:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ab9d47e990c12c11cc95ed1247a3782234a7e33a'/>
<id>urn:sha1:ab9d47e990c12c11cc95ed1247a3782234a7e33a</id>
<content type='text'>
When a loop ends with an 'if' with a large body, it is neater
to make the if 'continue' on the inverse condition, and then
the body is indented less.

Apply this pattern 3 times, and wrap some other long lines.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid10: remove unused variable.</title>
<updated>2011-05-11T04:54:32Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-05-11T04:54:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f17ed07c853d5d772515f565a7fc68f9098d6d69'/>
<id>urn:sha1:f17ed07c853d5d772515f565a7fc68f9098d6d69</id>
<content type='text'>
This variable 'disk' is never used - how odd.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid10: make more use of 'slot' in raid10d.</title>
<updated>2011-05-11T04:54:19Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-05-11T04:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a8830bcaf3206f15e29efcd9e04becd96a0722e9'/>
<id>urn:sha1:a8830bcaf3206f15e29efcd9e04becd96a0722e9</id>
<content type='text'>
Now that we have a 'slot' variable, make better use of it to simplify
some code a little.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid10: some tidying up in fix_read_error</title>
<updated>2011-05-11T04:53:17Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-05-11T04:53:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7c4e06ff2b6a4c09638551dfde76f37f9fca5c0c'/>
<id>urn:sha1:7c4e06ff2b6a4c09638551dfde76f37f9fca5c0c</id>
<content type='text'>
Currently the rdev on which a read error happened could be removed
before we perform the fix_error handling.  This requires extra tests
for NULL.

So delay the rdev_dec_pending call until after the call to
fix_read_error so that we can be sure that the rdev still exists.

This allows an 'if' clause to be removed so the body gets re-indented
back one level.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: simplify raid10 read_balance</title>
<updated>2011-05-11T04:27:03Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-05-11T04:27:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=56d9912106b0974ffb6dd264c80c7e816677e998'/>
<id>urn:sha1:56d9912106b0974ffb6dd264c80c7e816677e998</id>
<content type='text'>
raid10 read balance has two different loop for looking through
possible devices to chose the best.
Collapse those into one loop and generally make the code more
readable.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: fix up raid1/raid10 unplugging.</title>
<updated>2011-04-18T08:25:43Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-04-18T08:25:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c3b328ac846bcf6b9a62c5563380a81ab723006d'/>
<id>urn:sha1:c3b328ac846bcf6b9a62c5563380a81ab723006d</id>
<content type='text'>
We just need to make sure that an unplug event wakes up the md
thread, which is exactly what mddev_check_plugged does.

Also remove some plug-related code that is no longer needed.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: use new plugging interface for RAID IO.</title>
<updated>2011-04-18T08:25:41Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-04-18T08:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e1dfa0a29737142c32f00a3bac0f609dc85b4a82'/>
<id>urn:sha1:e1dfa0a29737142c32f00a3bac0f609dc85b4a82</id>
<content type='text'>
md/raid submits a lot of IO from the various raid threads.
So adding start/finish plug calls to those so that some
plugging happens.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
</feed>
