<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/raid1.c, branch v3.10.29</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md/raid1.c?h=v3.10.29</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md/raid1.c?h=v3.10.29'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-11-13T03:05:32Z</updated>
<entry>
<title>md: Fix skipping recovery for read-only arrays.</title>
<updated>2013-11-13T03:05:32Z</updated>
<author>
<name>Lukasz Dorau</name>
<email>lukasz.dorau@intel.com</email>
</author>
<published>2013-10-24T01:55:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ed840bec21c6f2f99ca34e974a5905e4f2116c1b'/>
<id>urn:sha1:ed840bec21c6f2f99ca34e974a5905e4f2116c1b</id>
<content type='text'>
commit 61e4947c99c4494336254ec540c50186d186150b upstream.

Since:
        commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86
        md: Allow devices to be re-added to a read-only array.

spares are activated on a read-only array. In case of raid1 and raid10
personalities it causes that not-in-sync devices are marked in-sync
without checking if recovery has been finished.

If a read-only array is degraded and one of its devices is not in-sync
(because the array has been only partially recovered) recovery will be skipped.

This patch adds checking if recovery has been finished before marking a device
in-sync for raid1 and raid10 personalities. In case of raid5 personality
such condition is already present (at raid5.c:6029).

Bug was introduced in 3.10 and causes data corruption.

Signed-off-by: Pawel Baldysiak &lt;pawel.baldysiak@intel.com&gt;
Signed-off-by: Lukasz Dorau &lt;lukasz.dorau@intel.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/raid1: fix bio handling problems in process_checks()</title>
<updated>2013-08-04T08:50:54Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-07-17T05:19:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8afb90da9f16abc5e577318544419bfcf3565391'/>
<id>urn:sha1:8afb90da9f16abc5e577318544419bfcf3565391</id>
<content type='text'>
commit 30bc9b53878a9921b02e3b5bc4283ac1c6de102a upstream.

Recent change to use bio_copy_data() in raid1 when repairing
an array is faulty.

The underlying may have changed the bio in various ways using
bio_advance and these need to be undone not just for the 'sbio' which
is being copied to, but also the 'pbio' (primary) which is being
copied from.

So perform the reset on all bios that were read from and do it early.

This also ensure that the sbio-&gt;bi_io_vec[j].bv_len passed to
memcmp is correct.

This fixes a crash during a 'check' of a RAID1 array.  The crash was
introduced in 3.10 so this is suitable for 3.10-stable.

Reported-by: Joe Lawrence &lt;joe.lawrence@stratus.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>Merge tag 'md-3.10-fixes' of git://neil.brown.name/md</title>
<updated>2013-06-13T17:13:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-06-13T17:13:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=82ea4be61f45d1a7ba1f5151d90124d1ece0c07a'/>
<id>urn:sha1:82ea4be61f45d1a7ba1f5151d90124d1ece0c07a</id>
<content type='text'>
Pull md bugfixes from Neil Brown:
 "A few bugfixes for md

  Some tagged for -stable"

* tag 'md-3.10-fixes' of git://neil.brown.name/md:
  md/raid1,5,10: Disable WRITE SAME until a recovery strategy is in place
  md/raid1,raid10: use freeze_array in place of raise_barrier in various places.
  md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it.
  md: md_stop_writes() should always freeze recovery.
</content>
</entry>
<entry>
<title>md/raid1,5,10: Disable WRITE SAME until a recovery strategy is in place</title>
<updated>2013-06-13T04:49:54Z</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2013-06-12T14:37:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5026d7a9b2f3eb1f9bda66c18ac6bc3036ec9020'/>
<id>urn:sha1:5026d7a9b2f3eb1f9bda66c18ac6bc3036ec9020</id>
<content type='text'>
There are cases where the kernel will believe that the WRITE SAME
command is supported by a block device which does not, in fact,
support WRITE SAME.  This currently happens for SATA drivers behind a
SAS controller, but there are probably a hundred other ways that can
happen, including drive firmware bugs.

After receiving an error for WRITE SAME the block layer will retry the
request as a plain write of zeroes, but mdraid will consider the
failure as fatal and consider the drive failed.  This has the effect
that all the mirrors containing a specific set of data are each
offlined in very rapid succession resulting in data loss.

However, just bouncing the request back up to the block layer isn't
ideal either, because the whole initial request-retry sequence should
be inside the write bitmap fence, which probably means that md needs
to do its own conversion of WRITE SAME to write zero.

Until the failure scenario has been sorted out, disable WRITE SAME for
raid1, raid5, and raid10.

[neilb: added raid5]

This patch is appropriate for any -stable since 3.7 when write_same
support was added.

Cc: stable@vger.kernel.org
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1,raid10: use freeze_array in place of raise_barrier in various places.</title>
<updated>2013-06-13T03:40:48Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-06-12T01:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e2d59925221cd562e07fee38ec8839f7209ae603'/>
<id>urn:sha1:e2d59925221cd562e07fee38ec8839f7209ae603</id>
<content type='text'>
Various places in raid1 and raid10 are calling raise_barrier when they
really should call freeze_array.
The former is only intended to be called from "make_request".
The later has extra checks for 'nr_queued' and makes a call to
flush_pending_writes(), so it is safe to call it from within the
management thread.

Using raise_barrier will sometimes deadlock.  Using freeze_array
should not.

As 'freeze_array' currently expects one request to be pending (in
handle_read_error - the only previous caller), we need to pass
it the number of pending requests (extra) to ignore.

The deadlock was made particularly noticeable by commits
050b66152f87c7 (raid10) and 6b740b8d79252f13 (raid1) which
appeared in 3.4, so the fix is appropriate for any -stable
kernel since then.

This patch probably won't apply directly to some early kernels and
will need to be applied by hand.

Cc: stable@vger.kernel.org
Reported-by: Alexander Lyakas &lt;alex.bolshoy@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it.</title>
<updated>2013-06-13T03:20:03Z</updated>
<author>
<name>Alex Lyakas</name>
<email>alex@zadarastorage.com</email>
</author>
<published>2013-06-04T17:42:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3056e3aec8d8ba61a0710fb78b2d562600aa2ea7'/>
<id>urn:sha1:3056e3aec8d8ba61a0710fb78b2d562600aa2ea7</id>
<content type='text'>
Without that fix, the following scenario could happen:

- RAID1 with drives A and B; drive B was freshly-added and is rebuilding
- Drive A fails
- WRITE request arrives to the array. It is failed by drive A, so
r1_bio is marked as R1BIO_WriteError, but the rebuilding drive B
succeeds in writing it, so the same r1_bio is marked as
R1BIO_Uptodate.
- r1_bio arrives to handle_write_finished, badblocks are disabled,
md_error()-&gt;error() does nothing because we don't fail the last drive
of raid1
- raid_end_bio_io()  calls call_bio_endio()
- As a result, in call_bio_endio():
        if (!test_bit(R1BIO_Uptodate, &amp;r1_bio-&gt;state))
                clear_bit(BIO_UPTODATE, &amp;bio-&gt;bi_flags);
this code doesn't clear the BIO_UPTODATE flag, and the whole master
WRITE succeeds, back to the upper layer.

So we returned success to the upper layer, even though we had written
the data onto the rebuilding drive only. But when we want to read the
data back, we would not read from the rebuilding drive, so this data
is lost.

[neilb - applied identical change to raid10 as well]

This bug can result in lost data, so it is suitable for any
-stable kernel.

Cc: stable@vger.kernel.org
Signed-off-by: Alex Lyakas &lt;alex@zadarastorage.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block</title>
<updated>2013-05-08T17:13:35Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-08T17:13:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4de13d7aa8f4d02f4dc99d4609575659f92b3c5a'/>
<id>urn:sha1:4de13d7aa8f4d02f4dc99d4609575659f92b3c5a</id>
<content type='text'>
Pull block core updates from Jens Axboe:

 - Major bit is Kents prep work for immutable bio vecs.

 - Stable candidate fix for a scheduling-while-atomic in the queue
   bypass operation.

 - Fix for the hang on exceeded rq-&gt;datalen 32-bit unsigned when merging
   discard bios.

 - Tejuns changes to convert the writeback thread pool to the generic
   workqueue mechanism.

 - Runtime PM framework, SCSI patches exists on top of these in James'
   tree.

 - A few random fixes.

* 'for-3.10/core' of git://git.kernel.dk/linux-block: (40 commits)
  relay: move remove_buf_file inside relay_close_buf
  partitions/efi.c: replace useless kzalloc's by kmalloc's
  fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read()
  block: fix max discard sectors limit
  blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
  Documentation: cfq-iosched: update documentation help for cfq tunables
  writeback: expose the bdi_wq workqueue
  writeback: replace custom worker pool implementation with unbound workqueue
  writeback: remove unused bdi_pending_list
  aoe: Fix unitialized var usage
  bio-integrity: Add explicit field for owner of bip_buf
  block: Add an explicit bio flag for bios that own their bvec
  block: Add bio_alloc_pages()
  block: Convert some code to bio_for_each_segment_all()
  block: Add bio_for_each_segment_all()
  bounce: Refactor __blk_queue_bounce to not use bi_io_vec
  raid1: use bio_copy_data()
  pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage
  pktcdvd: use bio_copy_data()
  block: Add bio_copy_data()
  ...
</content>
</entry>
<entry>
<title>MD: ignore discard request for hard disks of hybid raid1/raid10 array</title>
<updated>2013-04-30T04:49:36Z</updated>
<author>
<name>Shaohua Li</name>
<email>shli@kernel.org</email>
</author>
<published>2013-04-28T10:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=32f9f570d04461a41bdcd5c1d93b41ebc5ce182a'/>
<id>urn:sha1:32f9f570d04461a41bdcd5c1d93b41ebc5ce182a</id>
<content type='text'>
In SSD/hard disk hybid storage, discard request should be ignored for hard
disk. We used to be doing this way, but the unplug path forgets it.

This is suitable for stable tree since v3.6.

Cc: stable@vger.kernel.org
Reported-and-tested-by: Markus &lt;M4rkusXXL@web.de&gt;
Signed-off-by: Shaohua Li &lt;shli@fusionio.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: raid1/raid10 md devices leak memory when stopping</title>
<updated>2013-04-30T04:49:26Z</updated>
<author>
<name>Hirokazu Takahashi</name>
<email>taka@valinux.co.jp</email>
</author>
<published>2013-04-24T01:42:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0fea7ed82b1edf384735a2b535368f54a8584c3a'/>
<id>urn:sha1:0fea7ed82b1edf384735a2b535368f54a8584c3a</id>
<content type='text'>
Hi.

Raid1 and raid10 devices leak memory every time they stop.
This is a patch for linux-3.9.0-rc7 to fix this problem.

Thanks,
Hirokazu Takahashi.

Signed-off-by: Hirokazu Takahashi &lt;taka@valinux.co.jp&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>block: Add bio_alloc_pages()</title>
<updated>2013-03-23T21:26:31Z</updated>
<author>
<name>Kent Overstreet</name>
<email>koverstreet@google.com</email>
</author>
<published>2012-09-10T21:03:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a07876064a0b73ab5ef1ebcf14b1cf0231c07858'/>
<id>urn:sha1:a07876064a0b73ab5ef1ebcf14b1cf0231c07858</id>
<content type='text'>
More utility code to replace stuff that's getting open coded.

Signed-off-by: Kent Overstreet &lt;koverstreet@google.com&gt;
CC: Jens Axboe &lt;axboe@kernel.dk&gt;
CC: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
</feed>
