<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md, branch v3.17</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=v3.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-10-02T03:45:00Z</updated>
<entry>
<title>md/raid5: disable 'DISCARD' by default due to safety concerns.</title>
<updated>2014-10-02T03:45:00Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-10-02T03:45:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e0e99ba64c7ba46133a7c8a3e3f7de01f23bd93'/>
<id>urn:sha1:8e0e99ba64c7ba46133a7c8a3e3f7de01f23bd93</id>
<content type='text'>
It has come to my attention (thanks Martin) that 'discard_zeroes_data'
is only a hint.  Some devices in some cases don't do what it
says on the label.

The use of DISCARD in RAID5 depends on reads from discarded regions
being predictably zero.  If a write to a previously discarded region
performs a read-modify-write cycle it assumes that the parity block
was consistent with the data blocks.  If all were zero, this would
be the case.  If some are and some aren't this would not be the case.
This could lead to data corruption after a device failure when
data needs to be reconstructed from the parity.

As we cannot trust 'discard_zeroes_data', ignore it by default
and so disallow DISCARD on all raid4/5/6 arrays.

As many devices are trustworthy, and as there are benefits to using
DISCARD, add a module parameter to over-ride this caution and cause
DISCARD to work if discard_zeroes_data is set.

If a site want to enable DISCARD on some arrays but not on others they
should select DISCARD support at the filesystem level, and set the
raid456 module parameter.
    raid456.devices_handle_discard_safely=Y

As this is a data-safety issue, I believe this patch is suitable for
-stable.
DISCARD support for RAID456 was added in 3.7

Cc: Shaohua Li &lt;shli@kernel.org&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.com&gt;
Cc: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Cc: stable@vger.kernel.org (3.7+)
Acked-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Acked-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Fixes: 620125f2bf8ff0c4969b79653b54d7bcc9d40637
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge tag 'md/3.17-more-fixes' of git://git.neil.brown.name/md</title>
<updated>2014-09-24T15:53:33Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-09-24T15:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a90e41e228b50f3975c5f1b9359f927fc0173a19'/>
<id>urn:sha1:a90e41e228b50f3975c5f1b9359f927fc0173a19</id>
<content type='text'>
Pull bugfixes for md/raid1 from Neil Brown:
 "It is amazing how much easier it is to find bugs when you know one is
  there.  Two bug reports resulted in finding 7 bugs!

  All are tagged for -stable.  Those that can't cause (rare) data
  corruption, cause lockups.

  Particularly, but not only, fixing new "resync" code"

* tag 'md/3.17-more-fixes' of git://git.neil.brown.name/md:
  md/raid1: fix_read_error should act on all non-faulty devices.
  md/raid1: count resync requests in nr_pending.
  md/raid1: update next_resync under resync_lock.
  md/raid1: Don't use next_resync to determine how far resync has progressed
  md/raid1: make sure resync waits for conflicting writes to complete.
  md/raid1: clean up request counts properly in close_sync()
  md/raid1:  be more cautious where we read-balance during resync.
  md/raid1: intialise start_next_window for READ case to avoid hang
</content>
</entry>
<entry>
<title>md/raid1: fix_read_error should act on all non-faulty devices.</title>
<updated>2014-09-22T01:26:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-18T01:09:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b8cb6b4c121e1bf1963c16ed69e7adcb1bc301cd'/>
<id>urn:sha1:b8cb6b4c121e1bf1963c16ed69e7adcb1bc301cd</id>
<content type='text'>
If a devices is being recovered it is not InSync and is not Faulty.

If a read error is experienced on that device, fix_read_error()
will be called, but it ignores non-InSync devices.  So it will
neither fix the error nor fail the device.

It is incorrect that fix_read_error() ignores non-InSync devices.
It should only ignore Faulty devices.  So fix it.

This became a bug when we allowed reading from a device that was being
recovered.  It is suitable for any subsequent -stable kernel.

Fixes: da8840a747c0dbf49506ec906757a6b87b9741e9
Cc: stable@vger.kernel.org (v3.5+)
Reported-by: Alexander Lyakas &lt;alex.bolshoy@gmail.com&gt;
Tested-by: Alexander Lyakas &lt;alex.bolshoy@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: count resync requests in nr_pending.</title>
<updated>2014-09-22T01:26:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-16T02:14:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=34e97f170149bfa14979581c4c748bc9b4b79d5b'/>
<id>urn:sha1:34e97f170149bfa14979581c4c748bc9b4b79d5b</id>
<content type='text'>
Both normal IO and resync IO can be retried with reschedule_retry()
and so be counted into -&gt;nr_queued, but only normal IO gets counted in
-&gt;nr_pending.

Before the recent improvement to RAID1 resync there could only
possibly have been one or the other on the queue.  When handling a
read failure it could only be normal IO.  So when handle_read_error()
called freeze_array() the fact that freeze_array only compares
-&gt;nr_queued against -&gt;nr_pending was safe.

But now that these two types can interleave, we can have both normal
and resync IO requests queued, so we need to count them both in
nr_pending.

This error can lead to freeze_array() hanging if there is a read
error, so it is suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Reported-by: Brassow Jonathan &lt;jbrassow@redhat.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: update next_resync under resync_lock.</title>
<updated>2014-09-22T01:26:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-10T06:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c2fd4c94deedb89ac1746c4a53219be499372c06'/>
<id>urn:sha1:c2fd4c94deedb89ac1746c4a53219be499372c06</id>
<content type='text'>
raise_barrier() uses next_resync as part of its calculations, so it
really should be updated first, instead of afterwards.

next_resync is always used under resync_lock so update it under
resync lock to, just before it is used.  That is safest.

This could cause normal IO and resync IO to interact badly so
it suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: Don't use next_resync to determine how far resync has progressed</title>
<updated>2014-09-22T01:26:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-10T05:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=235549605eb7f1c5a37cef8b09d12e6d412c5cd6'/>
<id>urn:sha1:235549605eb7f1c5a37cef8b09d12e6d412c5cd6</id>
<content type='text'>
next_resync is (approximately) the location for the next resync request.
However it does *not* reliably determine the earliest location
at which resync might be happening.
This is because resync requests can complete out of order, and
we only limit the number of current requests, not the distance
from the earliest pending request to the latest.

mddev-&gt;curr_resync_completed is a reliable indicator of the earliest
position at which resync could be happening.   It is updated less
frequently, but is actually reliable which is more important.

So use it to determine if a write request is before the region
being resynced and so safe from conflict.

This error can allow resync IO to interfere with normal IO which
could lead to data corruption. Hence: stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: make sure resync waits for conflicting writes to complete.</title>
<updated>2014-09-22T01:26:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-10T05:01:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f73d3c55d09ce60647b96ad2a9b539c95a530ee'/>
<id>urn:sha1:2f73d3c55d09ce60647b96ad2a9b539c95a530ee</id>
<content type='text'>
The resync/recovery process for raid1 was recently changed
so that writes could happen in parallel with resync providing
they were in different regions of the device.

There is a problem though:  While a write request will always
wait for conflicting resync to complete, a resync request
will *not* always wait for conflicting writes to complete.

Two changes are needed to fix this:

1/ raise_barrier (which waits until it is safe to do resync)
   must wait until current_window_requests is zero
2/ wait_battier (which waits at the start of a new write request)
   must update current_window_requests if the request could
   possible conflict with a concurrent resync.

As concurrent writes and resync can lead to data loss,
this patch is suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Cc: stable@vger.kernel.org (v3.13+)
Cc: majianpeng &lt;majianpeng@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: clean up request counts properly in close_sync()</title>
<updated>2014-09-22T01:26:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-04T06:30:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=669cc7ba77864e7b1ac39c9f2b2afb8730f341f4'/>
<id>urn:sha1:669cc7ba77864e7b1ac39c9f2b2afb8730f341f4</id>
<content type='text'>
If there are outstanding writes when close_sync is called,
the change to -&gt;start_next_window might cause them to
decrement the wrong counter when they complete.  Fix this
by merging the two counters into the one that will be decremented.

Having an incorrect value in a counter can cause raise_barrier()
to hangs, so this is suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1:  be more cautious where we read-balance during resync.</title>
<updated>2014-09-22T00:26:41Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-09T03:49:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c6d119cf1b5a778e9ed60a006e2a434fcc4471a2'/>
<id>urn:sha1:c6d119cf1b5a778e9ed60a006e2a434fcc4471a2</id>
<content type='text'>
commit 79ef3a8aa1cb1523cc231c9a90a278333c21f761 made
it possible for reads to happen concurrently with resync.
This means that we need to be more careful where read_balancing
is allowed during resync - we can no longer be sure that any
resync that has already started will definitely finish.

So keep read_balancing to before recovery_cp, which is conservative
but safe.

This bug makes it possible to read from a device that doesn't
have up-to-date data, so it can cause data corruption.
So it is suitable for any kernel since 3.11.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: intialise start_next_window for READ case to avoid hang</title>
<updated>2014-09-22T00:18:03Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-09-22T00:06:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0cc9a057151892b885be21a1d19b0185568281d'/>
<id>urn:sha1:f0cc9a057151892b885be21a1d19b0185568281d</id>
<content type='text'>
r1_bio-&gt;start_next_window is not initialised in the READ
case, so allow_barrier may incorrectly decrement
   conf-&gt;current_window_requests
which can cause raise_barrier() to block forever.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Reported-by: Brassow Jonathan &lt;jbrassow@redhat.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
</feed>
