<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/raid1.c, branch v3.9</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.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-02-26T00:58:50Z</updated>
<entry>
<title>md/raid1,raid10: fix deadlock with freeze_array()</title>
<updated>2013-02-26T00:58:50Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-02-25T01:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee0b0244030434cdda26777bfb98962447e080cd'/>
<id>urn:sha1:ee0b0244030434cdda26777bfb98962447e080cd</id>
<content type='text'>
When raid1/raid10 needs to fix a read error, it first drains
all pending requests by calling freeze_array().
This calls flush_pending_writes() if it needs to sleep,
but some writes may be pending in a per-process plug rather
than in the per-array request queue.

When raid1{,0}_unplug() moves the request from the per-process
plug to the per-array request queue (from which
flush_pending_writes() can flush them), it needs to wake up
freeze_array(), or freeze_array() will never flush them and so
it will block forever.

So add the requires wake_up() calls.

This bug was introduced by commit
   f54a9d0e59c4bea3db733921ca9147612a6f292c
for raid1 and a similar commit for RAID10, and so has been present
since linux-3.6.  As the bug causes a deadlock I believe this fix is
suitable for -stable.

Cc: stable@vger.kernel.org (3.6.y 3.7.y 3.8.y)
Reported-by: Tregaron Bayly &lt;tbayly@bluehost.com&gt;
Tested-by: Tregaron Bayly &lt;tbayly@bluehost.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: raid1,10: Handle REQ_WRITE_SAME flag in write bios</title>
<updated>2013-02-26T00:55:21Z</updated>
<author>
<name>Joe Lawrence</name>
<email>Joe.Lawrence@stratus.com</email>
</author>
<published>2013-02-21T02:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c8dc9c654794a765ca61baed07f84ed8aaa7ca8c'/>
<id>urn:sha1:c8dc9c654794a765ca61baed07f84ed8aaa7ca8c</id>
<content type='text'>
Set mddev queue's max_write_same_sectors to its chunk_sector value (before
disk_stack_limits merges the underlying disk limits.)  With that in place,
be sure to handle writes coming down from the block layer that have the
REQ_WRITE_SAME flag set.  That flag needs to be copied into any newly cloned
write bio.

Signed-off-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Acked-by: "Martin K. Petersen" &lt;martin.petersen@oracle.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.8/drivers' of git://git.kernel.dk/linux-block</title>
<updated>2012-12-17T21:39:11Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-12-17T21:39:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9228ff90387e276ad67b10c0eb525c9d6a57d5e9'/>
<id>urn:sha1:9228ff90387e276ad67b10c0eb525c9d6a57d5e9</id>
<content type='text'>
Pull block driver update from Jens Axboe:
 "Now that the core bits are in, here are the driver bits for 3.8.  The
  branch contains:

   - A huge pile of drbd bits that were dumped from the 3.7 merge
     window.  Following that, it was both made perfectly clear that
     there is going to be no more over-the-wall pulls and how the
     situation on individual pulls can be improved.

   - A few cleanups from Akinobu Mita for drbd and cciss.

   - Queue improvement for loop from Lukas.  This grew into adding a
     generic interface for waiting/checking an even with a specific
     lock, allowing this to be pulled out of md and now loop and drbd is
     also using it.

   - A few fixes for xen back/front block driver from Roger Pau Monne.

   - Partition improvements from Stephen Warren, allowing partiion UUID
     to be used as an identifier."

* 'for-3.8/drivers' of git://git.kernel.dk/linux-block: (609 commits)
  drbd: update Kconfig to match current dependencies
  drbd: Fix drbdsetup wait-connect, wait-sync etc... commands
  drbd: close race between drbd_set_role and drbd_connect
  drbd: respect no-md-barriers setting also when changed online via disk-options
  drbd: Remove obsolete check
  drbd: fixup after wait_even_lock_irq() addition to generic code
  loop: Limit the number of requests in the bio list
  wait: add wait_event_lock_irq() interface
  xen-blkfront: free allocated page
  xen-blkback: move free persistent grants code
  block: partition: msdos: provide UUIDs for partitions
  init: reduce PARTUUID min length to 1 from 36
  block: store partition_meta_info.uuid as a string
  cciss: use check_signature()
  cciss: cleanup bitops usage
  drbd: use copy_highpage
  drbd: if the replication link breaks during handshake, keep retrying
  drbd: check return of kmalloc in receive_uuids
  drbd: Broadcast sync progress no more often than once per second
  drbd: don't try to clear bits once the disk has failed
  ...
</content>
</entry>
<entry>
<title>wait: add wait_event_lock_irq() interface</title>
<updated>2012-11-30T10:47:57Z</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2012-11-30T10:42:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eed8c02e680c04cd737e0a9cef74e68d8eb0cefa'/>
<id>urn:sha1:eed8c02e680c04cd737e0a9cef74e68d8eb0cefa</id>
<content type='text'>
New wait_event{_interruptible}_lock_irq{_cmd} macros added. This commit
moves the private wait_event_lock_irq() macro from MD to regular wait
includes, introduces new macro wait_event_lock_irq_cmd() instead of using
the old method with omitting cmd parameter which is ugly and makes a use
of new macros in the MD. It also introduces the _interruptible_ variant.

The use of new interface is when one have a special lock to protect data
structures used in the condition, or one also needs to invoke "cmd"
before putting it to sleep.

All new macros are expected to be called with the lock taken. The lock
is released before sleep and is reacquired afterwards. We will leave the
macro with the lock held.

Note to DM: IMO this should also fix theoretical race on waitqueue while
using simultaneously wait_event_lock_irq() and wait_event() because of
lack of locking around current state setting and wait queue removal.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>md/raid1{,0}: fix deadlock in bitmap_unplug.</title>
<updated>2012-11-27T01:14:40Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-11-27T01:14:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=874807a83139abc094f939e93623c5623573d543'/>
<id>urn:sha1:874807a83139abc094f939e93623c5623573d543</id>
<content type='text'>
If the raid1 or raid10 unplug function gets called
from a make_request function (which is very possible) when
there are bios on the current-&gt;bio_list list, then it will not
be able to successfully call bitmap_unplug() and it could
need to submit more bios and wait for them to complete.
But they won't complete while current-&gt;bio_list is non-empty.

So detect that case and handle the unplugging off to another thread
just like we already do when called from within the scheduler.

RAID1 version of bug was introduced in 3.6, so that part of fix is
suitable for 3.6.y.  RAID10 part won't apply.

Cc: stable@vger.kernel.org
Reported-by: Torsten Kaiser &lt;just.for.lkml@googlemail.com&gt;
Reported-by: Peter Maloney &lt;peter.maloney@brockmann-consult.de&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: Fix assembling of arrays containing Replacements.</title>
<updated>2012-10-31T00:42:03Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-10-31T00:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=02b898f2f04e418094f0093a3ad0b415bcdbe8eb'/>
<id>urn:sha1:02b898f2f04e418094f0093a3ad0b415bcdbe8eb</id>
<content type='text'>
setup_conf in raid1.c uses conf-&gt;raid_disks before assigning
a value.  It is used when including 'Replacement' devices.

The consequence is that assembling an array which contains a
replacement will misbehave and either not include the replacement, or
not include the device being replaced.

Though this doesn't lead directly to data corruption, it could lead to
reduced data safety.

So use mddev-&gt;raid_disks, which is initialised, instead.

Bug was introduced by commit c19d57980b38a5bb613a898937a1cf85f422fb9b
      md/raid1: recognise replacements when assembling arrays.

in 3.3, so fix is suitable for 3.3.y thru 3.6.y.

Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>Subject: [PATCH] md:change resync_mismatches to atomic64_t to avoid races</title>
<updated>2012-10-11T03:17:59Z</updated>
<author>
<name>Jianpeng Ma</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2012-10-11T03:17:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f7583d420231b9d09897afd57a957011b606a5b'/>
<id>urn:sha1:7f7583d420231b9d09897afd57a957011b606a5b</id>
<content type='text'>
Now that multiple threads can handle stripes, it is safer to
use an atomic64_t for resync_mismatches, to avoid update races.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md/raid1: Don't release reference to device while handling read error.</title>
<updated>2012-10-11T02:44:30Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-10-11T02:44:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7ad4d4a68a1a19f21c7b39cb3f51bf17fba6e3d0'/>
<id>urn:sha1:7ad4d4a68a1a19f21c7b39cb3f51bf17fba6e3d0</id>
<content type='text'>
When we get a read error, we arrange for raid1d to handle it.
Currently we release the reference on the device.  This can result
in
   conf-&gt;mirrors[read_disk].rdev
being NULL in fix_read_error, if the device happens to get removed
before the read error is handled.

So instead keep the reference until the read error has been fully
handled.

Reported-by: hank &lt;pyu@redhat.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>MD: change the parameter of md thread</title>
<updated>2012-10-11T02:34:00Z</updated>
<author>
<name>Shaohua Li</name>
<email>shli@kernel.org</email>
</author>
<published>2012-10-11T02:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ed8731d8e6bd2a88a30697fbf4f7e6e979a6c46'/>
<id>urn:sha1:4ed8731d8e6bd2a88a30697fbf4f7e6e979a6c46</id>
<content type='text'>
Change the thread parameter, so the thread can carry extra info. Next patch
will use it.

Signed-off-by: Shaohua Li &lt;shli@fusionio.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: raid 1 supports TRIM</title>
<updated>2012-10-11T02:28:54Z</updated>
<author>
<name>Shaohua Li</name>
<email>shli@fusionio.com</email>
</author>
<published>2012-10-11T02:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ff8cc2c6d4e323de71a42affeb3041fa17d5b10'/>
<id>urn:sha1:2ff8cc2c6d4e323de71a42affeb3041fa17d5b10</id>
<content type='text'>
This makes md raid 1 support TRIM.
If one disk supports discard and another not, or one has discard_zero_data and
another not, there could be inconsistent between data from such disks. But this
should not matter, discarded data is useless. This will add extra copy in rebuild
though.

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