<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md, branch v3.10.43</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md?h=v3.10.43</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md?h=v3.10.43'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-06-11T19:03:24Z</updated>
<entry>
<title>md: always set MD_RECOVERY_INTR when interrupting a reshape thread.</title>
<updated>2014-06-11T19:03:24Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-05-29T01:40:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=88580b125ac63b24bbba7f71bd235f27c65f5baa'/>
<id>urn:sha1:88580b125ac63b24bbba7f71bd235f27c65f5baa</id>
<content type='text'>
commit 2ac295a544dcae9299cba13ce250419117ae7fd1 upstream.

Commit 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97
   md: fix problem when adding device to read-only array with bitmap.

added a called to md_reap_sync_thread() which cause a reshape thread
to be interrupted (in particular, it could cause md_thread() to never even
call md_do_sync()).
However it didn't set MD_RECOVERY_INTR so -&gt;finish_reshape() would not
know that the reshape didn't complete.

This only happens when mddev-&gt;ro is set and normally reshape threads
don't run in that situation.  But raid5 and raid10 can start a reshape
thread during "run" is the array is in the middle of a reshape.
They do this even if -&gt;ro is set.

So it is best to set MD_RECOVERY_INTR before abortingg the
sync thread, just in case.

Though it rare for this to trigger a problem it can cause data corruption
because the reshape isn't finished properly.
So it is suitable for any stable which the offending commit was applied to.
(3.2 or later)

Fixes: 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97
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: always set MD_RECOVERY_INTR when aborting a reshape or other "resync".</title>
<updated>2014-06-11T19:03:24Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-05-28T03:39:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d86a5d297deedda0d991e1216ad8817d2d5a3a2b'/>
<id>urn:sha1:d86a5d297deedda0d991e1216ad8817d2d5a3a2b</id>
<content type='text'>
commit 3991b31ea072b070081ca3bfa860a077eda67de5 upstream.

If mddev-&gt;ro is set, md_to_sync will (correctly) abort.
However in that case MD_RECOVERY_INTR isn't set.

If a RESHAPE had been requested, then -&gt;finish_reshape() will be
called and it will think the reshape was successful even though
nothing happened.

Normally a resync will not be requested if -&gt;ro is set, but if an
array is stopped while a reshape is on-going, then when the array is
started, the reshape will be restarted.  If the array is also set
read-only at this point, the reshape will instantly appear to success,
resulting in data corruption.

Consequently, this patch is suitable for any -stable kernel.

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 cache: always split discards on cache block boundaries</title>
<updated>2014-06-11T19:03:23Z</updated>
<author>
<name>Heinz Mauelshagen</name>
<email>heinzm@redhat.com</email>
</author>
<published>2014-05-23T18:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=50faf9370b0aa357a9d114faafc2327505547928'/>
<id>urn:sha1:50faf9370b0aa357a9d114faafc2327505547928</id>
<content type='text'>
commit f1daa838e861ae1a0fb7cd9721a21258430fcc8c upstream.

The DM cache target cannot cope with discards that span multiple cache
blocks, so each discard bio that spans more than one cache block must
get split by the DM core.

Signed-off-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Acked-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 crypt: fix cpu hotplug crash by removing per-cpu structure</title>
<updated>2014-06-07T20:25:39Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2014-02-20T23:01:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=019c8ec9e3c6a3616f10be9eda359f1927d1f8b1'/>
<id>urn:sha1:019c8ec9e3c6a3616f10be9eda359f1927d1f8b1</id>
<content type='text'>
commit 610f2de3559c383caf8fbbf91e9968102dff7ca0 upstream.

The DM crypt target used per-cpu structures to hold pointers to a
ablkcipher_request structure.  The code assumed that the work item keeps
executing on a single CPU, so it didn't use synchronization when
accessing this structure.

If a CPU is disabled by writing 0 to /sys/devices/system/cpu/cpu*/online,
the work item could be moved to another CPU.  This causes dm-crypt
crashes, like the following, because the code starts using an incorrect
ablkcipher_request:

 smpboot: CPU 7 is now offline
 BUG: unable to handle kernel NULL pointer dereference at 0000000000000130
 IP: [&lt;ffffffffa1862b3d&gt;] crypt_convert+0x12d/0x3c0 [dm_crypt]
 ...
 Call Trace:
  [&lt;ffffffffa1864415&gt;] ? kcryptd_crypt+0x305/0x470 [dm_crypt]
  [&lt;ffffffff81062060&gt;] ? finish_task_switch+0x40/0xc0
  [&lt;ffffffff81052a28&gt;] ? process_one_work+0x168/0x470
  [&lt;ffffffff8105366b&gt;] ? worker_thread+0x10b/0x390
  [&lt;ffffffff81053560&gt;] ? manage_workers.isra.26+0x290/0x290
  [&lt;ffffffff81058d9f&gt;] ? kthread+0xaf/0xc0
  [&lt;ffffffff81058cf0&gt;] ? kthread_create_on_node+0x120/0x120
  [&lt;ffffffff813464ac&gt;] ? ret_from_fork+0x7c/0xb0
  [&lt;ffffffff81058cf0&gt;] ? kthread_create_on_node+0x120/0x120

Fix this bug by removing the per-cpu definition.  The structure
ablkcipher_request is accessed via a pointer from convert_context.
Consequently, if the work item is rescheduled to a different CPU, the
thread still uses the same ablkcipher_request.

This change may undermine performance improvements intended by commit
c0297721 ("dm crypt: scale to multiple cpus") on select hardware.  In
practice no performance difference was observed on recent hardware.  But
regardless, correctness is more important than performance.

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: avoid possible spinning md thread at shutdown.</title>
<updated>2014-06-07T20:25:32Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-05-05T23:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=658864cc2cc40d228ff0a75457fcbb4dedb1a52e'/>
<id>urn:sha1:658864cc2cc40d228ff0a75457fcbb4dedb1a52e</id>
<content type='text'>
commit 0f62fb220aa4ebabe8547d3a9ce4a16d3c045f21 upstream.

If an md array with externally managed metadata (e.g. DDF or IMSM)
is in use, then we should not set safemode==2 at shutdown because:

1/ this is ineffective: user-space need to be involved in any 'safemode' handling,
2/ The safemode management code doesn't cope with safemode==2 on external metadata
   and md_check_recover enters an infinite loop.

Even at shutdown, an infinite-looping process can be problematic, so this
could cause shutdown to hang.

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: r1buf_pool_alloc: free allocate pages when subsequent allocation fails.</title>
<updated>2014-05-31T04:52:12Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-04-09T02:25:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fdc9aa48b7ca57c9e2154ad68bf0fcd731dabeb7'/>
<id>urn:sha1:fdc9aa48b7ca57c9e2154ad68bf0fcd731dabeb7</id>
<content type='text'>
commit da1aab3dca9aa88ae34ca392470b8943159e25fe upstream.

When performing a user-request check/repair (MD_RECOVERY_REQUEST is set)
on a raid1, we allocate multiple bios each with their own set of pages.

If the page allocations for one bio fails, we currently do *not* free
the pages allocated for the previous bios, nor do we free the bio itself.

This patch frees all the already-allocate pages, and makes sure that
all the bios are freed as well.

This bug can cause a memory leak which can ultimately OOM a machine.
It was introduced in 3.10-rc1.

Fixes: a07876064a0b73ab5ef1ebcf14b1cf0231c07858
Cc: Kent Overstreet &lt;koverstreet@google.com&gt;
Reported-by: Russell King - ARM Linux &lt;linux@arm.linux.org.uk&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>dm thin: fix dangling bio in process_deferred_bios error path</title>
<updated>2014-05-13T11:59:46Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-03-28T06:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e2e8845036f5cd4391fc753367604562c65d8008'/>
<id>urn:sha1:e2e8845036f5cd4391fc753367604562c65d8008</id>
<content type='text'>
commit fe76cd88e654124d1431bb662a0fc6e99ca811a5 upstream.

If unable to ensure_next_mapping() we must add the current bio, which
was removed from the @bios list via bio_list_pop, back to the
deferred_bios list before all the remaining @bios.

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

</content>
</entry>
<entry>
<title>dm transaction manager: fix corruption due to non-atomic transaction commit</title>
<updated>2014-05-13T11:59:45Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-03-27T14:13:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff3296214ce60fb2215ef06143a773eb48a0e5d3'/>
<id>urn:sha1:ff3296214ce60fb2215ef06143a773eb48a0e5d3</id>
<content type='text'>
commit a9d45396f5956d0b615c7ae3b936afd888351a47 upstream.

The persistent-data library used by dm-thin, dm-cache, etc is
transactional.  If anything goes wrong, such as an io error when writing
new metadata or a power failure, then we roll back to the last
transaction.

Atomicity when committing a transaction is achieved by:

a) Never overwriting data from the previous transaction.
b) Writing the superblock last, after all other metadata has hit the
   disk.

This commit and the following commit ("dm: take care to copy the space
map roots before locking the superblock") fix a bug associated with (b).
When committing it was possible for the superblock to still be written
in spite of an io error occurring during the preceeding metadata flush.
With these commits we're careful not to take the write lock out on the
superblock until after the metadata flush has completed.

Change the transaction manager's semantics for dm_tm_commit() to assume
all data has been flushed _before_ the single superblock that is passed
in.

As a prerequisite, split the block manager's block unlocking and
flushing by simplifying dm_bm_flush_and_unlock() to dm_bm_flush().  Now
the unlocking must be done separately.

This issue was discovered by forcing io errors at the crucial time
using dm-flakey.

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 cache: fix access beyond end of origin device</title>
<updated>2014-03-24T04:38:18Z</updated>
<author>
<name>Heinz Mauelshagen</name>
<email>heinzm@redhat.com</email>
</author>
<published>2014-03-12T15:13:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bd86e7cb779a11a18ce2f33ccdde50c9568c3f6d'/>
<id>urn:sha1:bd86e7cb779a11a18ce2f33ccdde50c9568c3f6d</id>
<content type='text'>
commit e893fba90c09f9b57fb97daae204ea9cc2c52fa5 upstream.

In order to avoid wasting cache space a partial block at the end of the
origin device is not cached.  Unfortunately, the check for such a
partial block at the end of the origin device was flawed.

Fix accesses beyond the end of the origin device that occured due to
attempted promotion of an undetected partial block by:

- initializing the per bio data struct to allow cache_end_io to work properly
- recognizing access to the partial block at the end of the origin device
- avoiding out of bounds access to the discard bitset

Otherwise, users can experience errors like the following:

 attempt to access beyond end of device
 dm-5: rw=0, want=20971520, limit=20971456
 ...
 device-mapper: cache: promotion failed; couldn't copy block

Signed-off-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Acked-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 cache: fix truncation bug when copying a block to/from &gt;2TB fast device</title>
<updated>2014-03-24T04:38:18Z</updated>
<author>
<name>Heinz Mauelshagen</name>
<email>heinzm@redhat.com</email>
</author>
<published>2014-03-11T23:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e88217a8ee592adc45e14558091f254a2ce1868d'/>
<id>urn:sha1:e88217a8ee592adc45e14558091f254a2ce1868d</id>
<content type='text'>
commit 8b9d96666529a979acf4825391efcc7c8a3e9f12 upstream.

During demotion or promotion to a cache's &gt;2TB fast device we must not
truncate the cache block's associated sector to 32bits.  The 32bit
temporary result of from_cblock() caused a 32bit multiplication when
calculating the sector of the fast device in issue_copy_real().

Use an intermediate 64bit type to store the 32bit from_cblock() to allow
for proper 64bit multiplication.

Here is an example of how this bug manifests on an ext4 filesystem:

 EXT4-fs error (device dm-0): ext4_mb_generate_buddy:756: group 17136, 32768 clusters in bitmap, 30688 in gd; block bitmap corrupt.
 JBD2: Spotted dirty metadata buffer (dev = dm-0, blocknr = 0). There's a risk of filesystem corruption in case of system crash.

Signed-off-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Acked-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>
</feed>
