<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/raid1.c, branch v4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-02-25T00:37:02Z</updated>
<entry>
<title>md/raid1: fix read balance when a drive is write-mostly.</title>
<updated>2015-02-25T00:37:02Z</updated>
<author>
<name>Tomáš Hodek</name>
<email>tomas.hodek@volny.cz</email>
</author>
<published>2015-02-23T00:00:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1901ef099c38afd11add4cfb3312c02ef21ec4a'/>
<id>urn:sha1:d1901ef099c38afd11add4cfb3312c02ef21ec4a</id>
<content type='text'>
When a drive is marked write-mostly it should only be the
target of reads if there is no other option.

This behaviour was broken by

commit 9dedf60313fa4dddfd5b9b226a0ef12a512bf9dc
    md/raid1: read balance chooses idlest disk for SSD

which causes a write-mostly device to be *preferred* is some cases.

Restore correct behaviour by checking and setting
best_dist_disk and best_pending_disk rather than best_disk.

We only need to test one of these as they are both changed
from -1 or &gt;=0 at the same time.

As we leave min_pending and best_dist unchanged, any non-write-mostly
device will appear better than the write-mostly device.

Reported-by: Tomáš Hodek &lt;tomas.hodek@volny.cz&gt;
Reported-by: Dark Penguin &lt;darkpenguin@yandex.ru&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Link: http://marc.info/?l=linux-raid&amp;m=135982797322422
Fixes: 9dedf60313fa4dddfd5b9b226a0ef12a512bf9dc
Cc: stable@vger.kernel.org (3.6+)
</content>
</entry>
<entry>
<title>md/raid1: round up to bdev_logical_block_size in narrow_write_error</title>
<updated>2015-02-16T03:49:26Z</updated>
<author>
<name>Nate Dailey</name>
<email>nate.dailey@stratus.com</email>
</author>
<published>2015-02-12T17:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ab713cdc6f70da62c254c4acf77a0cfcda87b7f5'/>
<id>urn:sha1:ab713cdc6f70da62c254c4acf77a0cfcda87b7f5</id>
<content type='text'>
This modifies raid1's narrow_write_error to round up block_sectors to the
device's logical block size.

This prevents sd complaining about "Bad block number requested" for non-512-byte
sector disks.

Signed-off-by: Nate Dailey &lt;nate.dailey@stratus.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: rename -&gt;stop to -&gt;free</title>
<updated>2015-02-03T21:35:52Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-12-15T01:56:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=afa0f557cb15176570a18fb2a093e348a793afd4'/>
<id>urn:sha1:afa0f557cb15176570a18fb2a093e348a793afd4</id>
<content type='text'>
Now that the -&gt;stop function only frees the private data,
rename is accordingly.

Also pass in the private pointer as an arg rather than using
mddev-&gt;private.  This flexibility will be useful in level_store().

Finally, don't clear -&gt;private.  It doesn't make sense to clear
it seeing that isn't what we free, and it is no longer necessary
to clear -&gt;private (it was some time ago before  -&gt;to_remove was
introduced).

Setting -&gt;to_remove in -&gt;free() is a bit of a wart, but not a
big problem at the moment.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: split detach operation out from -&gt;stop.</title>
<updated>2015-02-03T21:35:52Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-12-15T01:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5aa61f427e4979be733e4847b9199ff9cc48a47e'/>
<id>urn:sha1:5aa61f427e4979be733e4847b9199ff9cc48a47e</id>
<content type='text'>
Each md personality has a 'stop' operation which does two
things:
 1/ it finalizes some aspects of the array to ensure nothing
    is accessing the -&gt;private data
 2/ it frees the -&gt;private data.

All the steps in '1' can apply to all arrays and so can be
performed in common code.

This is useful as in the case where we change the personality which
manages an array (in level_store()), it would be helpful to do
step 1 early, and step 2 later.

So split the 'step 1' functionality out into a new mddev_detach().

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: make merge_bvec_fn more robust in face of personality changes.</title>
<updated>2015-02-03T21:35:52Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-12-15T01:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=64590f45ddc7147fa1968147a1f5b5c436b728fe'/>
<id>urn:sha1:64590f45ddc7147fa1968147a1f5b5c436b728fe</id>
<content type='text'>
There is no locking around calls to merge_bvec_fn(), so
it is possible that calls which coincide with a level (or personality)
change could go wrong.

So create a central dispatch point for these functions and use
rcu_read_lock().
If the array is suspended, reject any merge that can be rejected.
If not, we know it is safe to call the function.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: make -&gt;congested robust against personality changes.</title>
<updated>2015-02-03T21:35:52Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-12-15T01:56:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c675f83c68fbdf9c0e103c1090b06be747fa62c'/>
<id>urn:sha1:5c675f83c68fbdf9c0e103c1090b06be747fa62c</id>
<content type='text'>
There is currently no locking around calls to the 'congested'
bdi function.  If called at an awkward time while an array is
being converted from one level (or personality) to another, there
is a tiny chance of running code in an unreferenced module etc.

So add a 'congested' function to the md_personality operations
structure, and call it with appropriate locking from a central
'mddev_congested'.

When the array personality is changing the array will be 'suspended'
so no IO is processed.
If mddev_congested detects this, it simply reports that the
array is congested, which is a safe guess.
As mddev_suspend calls synchronize_rcu(), mddev_congested can
avoid races by included the whole call inside an rcu_read_lock()
region.
This require that the congested functions for all subordinate devices
can be run under rcu_lock.  Fortunately this is the case.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: remove unwanted white space from md.c</title>
<updated>2014-10-14T02:08:29Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-30T04:23:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f72ffdd68616e3697bc782b21c82197aeb480fd5'/>
<id>urn:sha1:f72ffdd68616e3697bc782b21c82197aeb480fd5</id>
<content type='text'>
My editor shows much of this is RED.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: process_checks doesn't use its return value.</title>
<updated>2014-10-14T02:08:28Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-09T03:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c95e6385e8098ef549008ab29d671bf528a50043'/>
<id>urn:sha1:c95e6385e8098ef549008ab29d671bf528a50043</id>
<content type='text'>
process_checks() always returns '0', so change it to 'void'.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: use set_bit/clear_bit instead of shift/mask for bi_flags changes.</title>
<updated>2014-10-08T23:07:04Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-08-23T10:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3fd83717e47687817f5d3e45696bf22456d8b422'/>
<id>urn:sha1:3fd83717e47687817f5d3e45696bf22456d8b422</id>
<content type='text'>
Using {set,clear}_bit is more consistent than shifting and masking.

No functional change.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: minor typos and reformatting.</title>
<updated>2014-10-08T23:07:04Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-04T05:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5965b642ff1ba36d7a1a22df2b3c5e2cb0445e3a'/>
<id>urn:sha1:5965b642ff1ba36d7a1a22df2b3c5e2cb0445e3a</id>
<content type='text'>
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
</feed>
