<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md, branch v3.16</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md?h=v3.16</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-08-01T16:25:22Z</updated>
<entry>
<title>dm cache: fix race affecting dirty block count</title>
<updated>2014-08-01T16:25:22Z</updated>
<author>
<name>Anssi Hannula</name>
<email>anssi.hannula@iki.fi</email>
</author>
<published>2014-08-01T15:55:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=44fa816bb778edbab6b6ddaaf24908dd6295937e'/>
<id>urn:sha1:44fa816bb778edbab6b6ddaaf24908dd6295937e</id>
<content type='text'>
nr_dirty is updated without locking, causing it to drift so that it is
non-zero (either a small positive integer, or a very large one when an
underflow occurs) even when there are no actual dirty blocks.  This was
due to a race between the workqueue and map function accessing nr_dirty
in parallel without proper protection.

People were seeing under runs due to a race on increment/decrement of
nr_dirty, see: https://lkml.org/lkml/2014/6/3/648

Fix this by using an atomic_t for nr_dirty.

Reported-by: roma1390@gmail.com
Signed-off-by: Anssi Hannula &lt;anssi.hannula@iki.fi&gt;
Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm bufio: fully initialize shrinker</title>
<updated>2014-08-01T16:07:21Z</updated>
<author>
<name>Greg Thelen</name>
<email>gthelen@google.com</email>
</author>
<published>2014-07-31T16:07:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d8c712ea471ce7a4fd1734ad2211adf8469ddddc'/>
<id>urn:sha1:d8c712ea471ce7a4fd1734ad2211adf8469ddddc</id>
<content type='text'>
1d3d4437eae1 ("vmscan: per-node deferred work") added a flags field to
struct shrinker assuming that all shrinkers were zero filled.  The dm
bufio shrinker is not zero filled, which leaves arbitrary kmalloc() data
in flags.  So far the only defined flags bit is SHRINKER_NUMA_AWARE.
But there are proposed patches which add other bits to shrinker.flags
(e.g. memcg awareness).

Rather than simply initializing the shrinker, this patch uses kzalloc()
when allocating the dm_bufio_client to ensure that the embedded shrinker
and any other similar structures are zeroed.

This fixes theoretical over aggressive shrinking of dm bufio objects.
If the uninitialized dm_bufio_client.shrinker.flags contains
SHRINKER_NUMA_AWARE then shrink_slab() would call the dm shrinker for
each numa node rather than just once.  This has been broken since 3.12.

Signed-off-by: Greg Thelen &lt;gthelen@google.com&gt;
Acked-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org # v3.12+
</content>
</entry>
<entry>
<title>Merge tag 'dm-3.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2014-07-18T16:25:05Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-07-18T16:25:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=55ae1bd0d2fca3858fdc4bb86c1fc9b79650fe5b'/>
<id>urn:sha1:55ae1bd0d2fca3858fdc4bb86c1fc9b79650fe5b</id>
<content type='text'>
Pull device mapper fixes from Mike Snitzer:
 "Fix the dm-thinp and dm-cache targets to disallow changing the data
  device's block size"

* tag 'dm-3.16-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm cache metadata: do not allow the data block size to change
  dm thin metadata: do not allow the data block size to change
</content>
</entry>
<entry>
<title>dm cache metadata: do not allow the data block size to change</title>
<updated>2014-07-15T18:07:50Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-07-14T20:59:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=048e5a07f282c57815b3901d4a68a77fa131ce0a'/>
<id>urn:sha1:048e5a07f282c57815b3901d4a68a77fa131ce0a</id>
<content type='text'>
The block size for the dm-cache's data device must remained fixed for
the life of the cache.  Disallow any attempt to change the cache's data
block size.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm thin metadata: do not allow the data block size to change</title>
<updated>2014-07-15T18:05:26Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-07-14T20:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9aec8629ec829fc9403788cd959e05dd87988bd1'/>
<id>urn:sha1:9aec8629ec829fc9403788cd959e05dd87988bd1</id>
<content type='text'>
The block size for the thin-pool's data device must remained fixed for
the life of the thin-pool.  Disallow any attempt to change the
thin-pool's data block size.

It should be noted that attempting to change the data block size via
thin-pool table reload will be ignored as a side-effect of the thin-pool
handover that the thin-pool target does during thin-pool table reload.

Here is an example outcome of attempting to load a thin-pool table that
reduced the thin-pool's data block size from 1024K to 512K.

Before:
kernel: device-mapper: thin: 253:4: growing the data device from 204800 to 409600 blocks

After:
kernel: device-mapper: thin metadata: changing the data block size (from 2048 to 1024) is not supported
kernel: device-mapper: table: 253:4: thin-pool: Error creating metadata object
kernel: device-mapper: ioctl: error adding target to table

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>Merge tag 'dm-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2014-07-11T16:33:36Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-07-11T16:33:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=67b9d76f9e2f9f87f94a11521cc996dc2e43ce14'/>
<id>urn:sha1:67b9d76f9e2f9f87f94a11521cc996dc2e43ce14</id>
<content type='text'>
Pull device mapper fixes from Mike Snitzer:

 - Fix DM multipath IO hang regression from 3.15 due to logic bug in
   multipath_busy.  This impacted cable-pull testing and also the
   ability to boot with IPR SCSI on a POWER8 box.

 - Fix possible deadlock with deferred device removal by using a new
   dedicated workqueue rather than using the system workqueue.

 - Fix NULL pointer crash due to race condition in dm-io's wake up code
   for sync_io by using a completion.

 - Update dm-crypt and dm-zero author name following legal name change;
   this is important to Jana so I didn't see any reason to hold it back.

* tag 'dm-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm mpath: fix IO hang due to logic bug in multipath_busy
  dm io: fix a race condition in the wake up code for sync_io
  dm crypt, dm zero: update author name following legal name change
  dm: allocate a special workqueue for deferred device removal
</content>
</entry>
<entry>
<title>dm mpath: fix IO hang due to logic bug in multipath_busy</title>
<updated>2014-07-10T20:44:15Z</updated>
<author>
<name>Jun'ichi Nomura</name>
<email>j-nomura@ce.jp.nec.com</email>
</author>
<published>2014-07-08T00:55:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7a7a3b45fed9a144dbf766ee842a4c5d0632b81d'/>
<id>urn:sha1:7a7a3b45fed9a144dbf766ee842a4c5d0632b81d</id>
<content type='text'>
Commit e80991773 ("dm mpath: push back requests instead of queueing")
modified multipath_busy() to return true if !pg_ready().  pg_ready()
checks the current state of the multipath device and may return false
even if a new IO is needed to change the state.

Bart Van Assche reported that he had multipath IO lockup when he was
performing cable pull tests.  Analysis showed that the multipath
device had a single path group with both paths active, but that the
path group itself was not active.  During the multipath device state
transitions 'queue_io' got set but nothing could clear it.  Clearing
'queue_io' only happens in __choose_pgpath(), but it won't be called
if multipath_busy() returns true due to pg_ready() returning false
when 'queue_io' is set.

As such the !pg_ready() check in multipath_busy() is wrong because new
IO will not be sent to multipath target and the multipath state change
won't happen.  That results in multipath IO lockup.

The intent of multipath_busy() is to avoid unnecessary cycles of
dequeue + request_fn + requeue if it is known that the multipath
device will requeue.

Such "busy" situations would be:
  - path group is being activated
  - there is no path and the multipath is setup to requeue if no path

Fix multipath_busy() to return "busy" early only for these specific
situations.

Reported-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Tested-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org # v3.15
</content>
</entry>
<entry>
<title>dm io: fix a race condition in the wake up code for sync_io</title>
<updated>2014-07-10T20:44:14Z</updated>
<author>
<name>Joe Thornber</name>
<email>thornber@redhat.com</email>
</author>
<published>2014-06-27T19:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=10f1d5d111e8aed46a0f1179faf9a3cf422f689e'/>
<id>urn:sha1:10f1d5d111e8aed46a0f1179faf9a3cf422f689e</id>
<content type='text'>
There's a race condition between the atomic_dec_and_test(&amp;io-&gt;count)
in dec_count() and the waking of the sync_io() thread.  If the thread
is spuriously woken immediately after the decrement it may exit,
making the on stack io struct invalid, yet the dec_count could still
be using it.

Fix this race by using a completion in sync_io() and dec_count().

Reported-by: Minfei Huang &lt;huangminfei@ucloud.cn&gt;
Signed-off-by: Joe Thornber &lt;thornber@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm crypt, dm zero: update author name following legal name change</title>
<updated>2014-07-10T20:44:14Z</updated>
<author>
<name>Jana Saout</name>
<email>jana@saout.de</email>
</author>
<published>2014-06-24T18:27:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bf14299f1ce96c9d632533c4557303f8a74afc9e'/>
<id>urn:sha1:bf14299f1ce96c9d632533c4557303f8a74afc9e</id>
<content type='text'>
Signed-off-by: Jana Saout &lt;jana@saout.de&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: allocate a special workqueue for deferred device removal</title>
<updated>2014-07-10T20:44:13Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2014-06-14T17:44:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=acfe0ad74d2e1bfc81d1d7bf5e15b043985d3650'/>
<id>urn:sha1:acfe0ad74d2e1bfc81d1d7bf5e15b043985d3650</id>
<content type='text'>
The commit 2c140a246dc ("dm: allow remove to be deferred") introduced a
deferred removal feature for the device mapper.  When this feature is
used (by passing a flag DM_DEFERRED_REMOVE to DM_DEV_REMOVE_CMD ioctl)
and the user tries to remove a device that is currently in use, the
device will be removed automatically in the future when the last user
closes it.

Device mapper used the system workqueue to perform deferred removals.
However, some targets (dm-raid1, dm-mpath, dm-stripe) flush work items
scheduled for the system workqueue from their destructor.  If the
destructor itself is called from the system workqueue during deferred
removal, it introduces a possible deadlock - the workqueue tries to flush
itself.

Fix this possible deadlock by introducing a new workqueue for deferred
removals.  We allocate just one workqueue for all dm targets.  The
ability of dm targets to process IOs isn't dependent on deferred removal
of unused targets, so a deadlock due to shared workqueue isn't possible.

Also, cleanup local_init() to eliminate potential for returning success
on failure.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org # 3.13+
</content>
</entry>
</feed>
