<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md, branch v3.4.80</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md?h=v3.4.80</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md?h=v3.4.80'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-02-13T19:51:14Z</updated>
<entry>
<title>dm space map common: make sure new space is used during extend</title>
<updated>2014-02-13T19:51:14Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-01-07T15:47:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=11690e1491de3c35b09bff55336c14aacbdf1627'/>
<id>urn:sha1:11690e1491de3c35b09bff55336c14aacbdf1627</id>
<content type='text'>
commit 12c91a5c2d2a8e8cc40a9552313e1e7b0a2d9ee3 upstream.

When extending a low level space map we should update nr_blocks at
the start so the new space is used for the index entries.

Otherwise extend can fail, e.g.: sm_metadata_extend call sequence
that fails:
 -&gt; sm_ll_extend
    -&gt; dm_tm_new_block -&gt; dm_sm_new_block -&gt; sm_bootstrap_new_block
    =&gt; returns -ENOSPC because smm-&gt;begin == smm-&gt;ll.nr_blocks

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm: wait until embedded kobject is released before destroying a device</title>
<updated>2014-02-13T19:51:14Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2014-01-07T04:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=39bbeb69ace5742f3cbad2ae77c27bc2fa3c2c0f'/>
<id>urn:sha1:39bbeb69ace5742f3cbad2ae77c27bc2fa3c2c0f</id>
<content type='text'>
commit be35f486108227e10fe5d96fd42fb2b344c59983 upstream.

There may be other parts of the kernel holding a reference on the dm
kobject.  We must wait until all references are dropped before
deallocating the mapped_device structure.

The dm_kobject_release method signals that all references are dropped
via completion.  But dm_kobject_release doesn't free the kobject (which
is embedded in the mapped_device structure).

This is the sequence of operations:
* when destroying a DM device, call kobject_put from dm_sysfs_exit
* wait until all users stop using the kobject, when it happens the
  release method is called
* the release method signals the completion and should return without
  delay
* the dm device removal code that waits on the completion continues
* the dm device removal code drops the dm_mod reference the device had
* the dm device removal code frees the mapped_device structure that
  contains the kobject

Using kobject this way should avoid the module unload race that was
mentioned at the beginning of this thread:
https://lkml.org/lkml/2014/1/4/83

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>md/raid5: fix long-standing problem with bitmap handling on write failure.</title>
<updated>2014-02-06T19:05:46Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-15T22:35:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=18c8053c6b59f11bcd941850c1d13b3b502e1e74'/>
<id>urn:sha1:18c8053c6b59f11bcd941850c1d13b3b502e1e74</id>
<content type='text'>
commit 9f97e4b128d2ea90a5f5063ea0ee3b0911f4c669 upstream.

Before a write starts we set a bit in the write-intent bitmap.
When the write completes we clear that bit if the write was successful
to all devices.  However if the write wasn't fully successful we
should not clear the bit.  If the faulty drive is subsequently
re-added, the fact that the bit is still set ensure that we will
re-write the data that is missing.

This logic is mediated by the STRIPE_DEGRADED flag - we only clear the
bitmap bit when this flag is not set.
Currently we correctly set the flag if a write starts when some
devices are failed or missing.  But we do *not* set the flag if some
device failed during the write attempt.
This is wrong and can result in clearing the bit inappropriately.

So: set the flag when a write fails.

This bug has been present since bitmaps were introduces, so the fix is
suitable for any -stable kernel.

Reported-by: Ethan Wilson &lt;ethan.wilson@shiftmail.org&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/raid10: fix two bugs in handling of known-bad-blocks.</title>
<updated>2014-01-29T13:10:42Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-13T23:38:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7e34f43dcc317f24ccc36c26f906909de9058b5c'/>
<id>urn:sha1:7e34f43dcc317f24ccc36c26f906909de9058b5c</id>
<content type='text'>
commit b50c259e25d9260b9108dc0c2964c26e5ecbe1c1 upstream.

If we discover a bad block when reading we split the request and
potentially read some of it from a different device.

The code path of this has two bugs in RAID10.
1/ we get a spin_lock with _irq, but unlock without _irq!!
2/ The calculation of 'sectors_handled' is wrong, as can be clearly
   seen by comparison with raid1.c

This leads to at least 2 warnings and a probable crash is a RAID10
ever had known bad blocks.

Fixes: 856e08e23762dfb92ffc68fd0a8d228f9e152160
Reported-by: Damian Nowak &lt;spam@nowaker.net&gt;
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
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/raid10: fix bug when raid10 recovery fails to recover a block.</title>
<updated>2014-01-29T13:10:42Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-01-05T23:35:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=511375d15b111abe2806aed91acb9a4f9d09b4cb'/>
<id>urn:sha1:511375d15b111abe2806aed91acb9a4f9d09b4cb</id>
<content type='text'>
commit e8b849158508565e0cd6bc80061124afc5879160 upstream.

commit e875ecea266a543e643b19e44cf472f1412708f9
    md/raid10 record bad blocks as needed during recovery.

added code to the "cannot recover this block" path to record a bad
block rather than fail the whole recovery.
Unfortunately this new case was placed *after* r10bio was freed rather
than *before*, yet it still uses r10bio.
This is will crash with a null dereference.

So move the freeing of r10bio down where it is safe.

Fixes: e875ecea266a543e643b19e44cf472f1412708f9
Reported-by: Damian Nowak &lt;spam@nowaker.net&gt;
URL: https://bugzilla.kernel.org/show_bug.cgi?id=68181
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm table: fail dm_table_create on dm_round_up overflow</title>
<updated>2013-12-20T15:34:20Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2013-11-23T00:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d84ae92281ac08a47fcfd14e43a092407be45b60'/>
<id>urn:sha1:d84ae92281ac08a47fcfd14e43a092407be45b60</id>
<content type='text'>
commit 5b2d06576c5410c10d95adfd5c4d8b24de861d87 upstream.

The dm_round_up function may overflow to zero.  In this case,
dm_table_create() must fail rather than go on to allocate an empty array
with alloc_targets().

This fixes a possible memory corruption that could be caused by passing
too large a number in "param-&gt;target_count".

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm delay: fix a possible deadlock due to shared workqueue</title>
<updated>2013-12-20T15:34:20Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2013-11-15T21:12:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b0d16fe070836cc8090524fe16aa5ae2dfab72fc'/>
<id>urn:sha1:b0d16fe070836cc8090524fe16aa5ae2dfab72fc</id>
<content type='text'>
commit 718822c1c112dc99e0c72c8968ee1db9d9d910f0 upstream.

The dm-delay target uses a shared workqueue for multiple instances.  This
can cause deadlock if two or more dm-delay targets are stacked on the top
of each other.

This patch changes dm-delay to use a per-instance workqueue.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm bufio: initialize read-only module parameters</title>
<updated>2013-12-20T15:34:20Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2013-12-05T22:33:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=aa42ac11510cd2584a04cdd5dacb3f4bf8e82af0'/>
<id>urn:sha1:aa42ac11510cd2584a04cdd5dacb3f4bf8e82af0</id>
<content type='text'>
commit 4cb57ab4a2e61978f3a9b7d4f53988f30d61c27f upstream.

Some module parameters in dm-bufio are read-only. These parameters
inform the user about memory consumption. They are not supposed to be
changed by the user.

However, despite being read-only, these parameters can be set on
modprobe or insmod command line, for example:
modprobe dm-bufio current_allocated_bytes=12345

The kernel doesn't expect that these variables can be non-zero at module
initialization and if the user sets them, it results in BUG.

This patch initializes the variables in the module init routine, so that
user-supplied values are ignored.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm: fix truncated status strings</title>
<updated>2013-12-08T15:29:43Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2013-03-01T22:45:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d8b8a43e0f3c99bb29f258ef508969793f8e43bd'/>
<id>urn:sha1:d8b8a43e0f3c99bb29f258ef508969793f8e43bd</id>
<content type='text'>
commit fd7c092e711ebab55b2688d3859d95dfd0301f73 upstream.

Avoid returning a truncated table or status string instead of setting
the DM_BUFFER_FULL_FLAG when the last target of a table fills the
buffer.

When processing a table or status request, the function retrieve_status
calls ti-&gt;type-&gt;status. If ti-&gt;type-&gt;status returns non-zero,
retrieve_status assumes that the buffer overflowed and sets
DM_BUFFER_FULL_FLAG.

However, targets don't return non-zero values from their status method
on overflow. Most targets returns always zero.

If a buffer overflow happens in a target that is not the last in the
table, it gets noticed during the next iteration of the loop in
retrieve_status; but if a buffer overflow happens in the last target, it
goes unnoticed and erroneously truncated data is returned.

In the current code, the targets behave in the following way:
* dm-crypt returns -ENOMEM if there is not enough space to store the
  key, but it returns 0 on all other overflows.
* dm-thin returns errors from the status method if a disk error happened.
  This is incorrect because retrieve_status doesn't check the error
  code, it assumes that all non-zero values mean buffer overflow.
* all the other targets always return 0.

This patch changes the ti-&gt;type-&gt;status function to return void (because
most targets don't use the return code). Overflow is detected in
retrieve_status: if the status method fills up the remaining space
completely, it is assumed that buffer overflow happened.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>md: fix calculation of stacking limits on level change.</title>
<updated>2013-12-04T18:50:33Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-11-14T04:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f69a26d2cff8533570ca3ef3c59f2e1174b084b1'/>
<id>urn:sha1:f69a26d2cff8533570ca3ef3c59f2e1174b084b1</id>
<content type='text'>
commit 02e5f5c0a0f726e66e3d8506ea1691e344277969 upstream.

The various -&gt;run routines of md personalities assume that the 'queue'
has been initialised by the blk_set_stacking_limits() call in
md_alloc().

However when the level is changed (by level_store()) the -&gt;run routine
for the new level is called for an array which has already had the
stacking limits modified.  This can result in incorrect final
settings.

So call blk_set_stacking_limits() before -&gt;run in level_store().

A specific consequence of this bug is that it causes
discard_granularity to be set incorrectly when reshaping a RAID4 to a
RAID0.

This is suitable for any -stable kernel since 3.3 in which
blk_set_stacking_limits() was introduced.

Reported-and-tested-by: "Baldysiak, Pawel" &lt;pawel.baldysiak@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>
</feed>
