<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/md, branch v3.12.49</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.49</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.49'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-05T20:02:55Z</updated>
<entry>
<title>md: flush -&gt;event_work before stopping array.</title>
<updated>2015-10-05T20:02:55Z</updated>
<author>
<name>Neil Brown</name>
<email>neilb@suse.com</email>
</author>
<published>2015-09-30T03:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e460fa8bdc1f744a92dd20a968ac652c6cacaf89'/>
<id>urn:sha1:e460fa8bdc1f744a92dd20a968ac652c6cacaf89</id>
<content type='text'>
commit ee5d004fd0591536a061451eba2b187092e9127c upstream.

The 'event_work' worker used by dm-raid may still be running
when the array is stopped.  This can result in an oops.

So flush the workqueue on which it is run after detaching
and before destroying the device.

Reported-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Fixes: 9d09e663d550 ("dm: raid456 basic support")
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>md/raid10: always set reshape_safe when initializing reshape_position.</title>
<updated>2015-09-30T09:13:09Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.com</email>
</author>
<published>2015-07-06T07:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c7af5eb41f18b5fc4629e754ff855f93ee88e301'/>
<id>urn:sha1:c7af5eb41f18b5fc4629e754ff855f93ee88e301</id>
<content type='text'>
commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 upstream.

'reshape_position' tracks where in the reshape we have reached.
'reshape_safe' tracks where in the reshape we have safely recorded
in the metadata.

These are compared to determine when to update the metadata.
So it is important that reshape_safe is initialised properly.
Currently it isn't.  When starting a reshape from the beginning
it usually has the correct value by luck.  But when reducing the
number of devices in a RAID10, it has the wrong value and this leads
to the metadata not being updated correctly.
This can lead to corruption if the reshape is not allowed to complete.

This patch is suitable for any -stable kernel which supports RAID10
reshape, which is 3.5 and later.

Fixes: 3ea7daa5d7fd ("md/raid10: add reshape support")
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>dm cache mq: fix memory allocation failure for large cache devices</title>
<updated>2015-09-02T15:02:55Z</updated>
<author>
<name>Heinz Mauelshagen</name>
<email>heinzm@redhat.com</email>
</author>
<published>2014-02-28T17:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ca6292e4e78f9448c62509f35ace5bd1f092b330'/>
<id>urn:sha1:ca6292e4e78f9448c62509f35ace5bd1f092b330</id>
<content type='text'>
commit 14f398ca2f26a2ed6236aec54395e0fa06ec8a82 upstream.

The memory allocated for the multiqueue policy's hash table doesn't need
to be physically contiguous.  Use vzalloc() instead of kzalloc().
Fedora has been carrying this fix since 10/10/2013.

Failure seen during creation of a 10TB cached device with a 2048 sector
block size and 411GB cache size:

 dmsetup: page allocation failure: order:9, mode:0x10c0d0
 CPU: 11 PID: 29235 Comm: dmsetup Not tainted 3.10.4 #3
 Hardware name: Supermicro X8DTL/X8DTL, BIOS 2.1a       12/30/2011
  000000000010c0d0 ffff880090941898 ffffffff81387ab4 ffff880090941928
  ffffffff810bb26f 0000000000000009 000000000010c0d0 ffff880090941928
  ffffffff81385dbc ffffffff815f3840 ffffffff00000000 000002000010c0d0
 Call Trace:
  [&lt;ffffffff81387ab4&gt;] dump_stack+0x19/0x1b
  [&lt;ffffffff810bb26f&gt;] warn_alloc_failed+0x110/0x124
  [&lt;ffffffff81385dbc&gt;] ? __alloc_pages_direct_compact+0x17c/0x18e
  [&lt;ffffffff810bda2e&gt;] __alloc_pages_nodemask+0x6c7/0x75e
  [&lt;ffffffff810bdad7&gt;] __get_free_pages+0x12/0x3f
  [&lt;ffffffff810ea148&gt;] kmalloc_order_trace+0x29/0x88
  [&lt;ffffffff810ec1fd&gt;] __kmalloc+0x36/0x11b
  [&lt;ffffffffa031eeed&gt;] ? mq_create+0x1dc/0x2cf [dm_cache_mq]
  [&lt;ffffffffa031efc0&gt;] mq_create+0x2af/0x2cf [dm_cache_mq]
  [&lt;ffffffffa0314605&gt;] dm_cache_policy_create+0xa7/0xd2 [dm_cache]
  [&lt;ffffffffa0312530&gt;] ? cache_ctr+0x245/0xa13 [dm_cache]
  [&lt;ffffffffa031263e&gt;] cache_ctr+0x353/0xa13 [dm_cache]
  [&lt;ffffffffa012b916&gt;] dm_table_add_target+0x227/0x2ce [dm_mod]
  [&lt;ffffffffa012e8e4&gt;] table_load+0x286/0x2ac [dm_mod]
  [&lt;ffffffffa012e65e&gt;] ? dev_wait+0x8a/0x8a [dm_mod]
  [&lt;ffffffffa012e324&gt;] ctl_ioctl+0x39a/0x3c2 [dm_mod]
  [&lt;ffffffffa012e35a&gt;] dm_ctl_ioctl+0xe/0x12 [dm_mod]
  [&lt;ffffffff81101181&gt;] vfs_ioctl+0x21/0x34
  [&lt;ffffffff811019d3&gt;] do_vfs_ioctl+0x3b1/0x3f4
  [&lt;ffffffff810f4d2e&gt;] ? ____fput+0x9/0xb
  [&lt;ffffffff81050b6c&gt;] ? task_work_run+0x7e/0x92
  [&lt;ffffffff81101a68&gt;] SyS_ioctl+0x52/0x82
  [&lt;ffffffff81391d92&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>dm thin metadata: delete btrees when releasing metadata snapshot</title>
<updated>2015-08-25T14:57:09Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2015-08-12T14:10:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1d124d81dfdb65173dd291d3b33e4bfb9c4cb624'/>
<id>urn:sha1:1d124d81dfdb65173dd291d3b33e4bfb9c4cb624</id>
<content type='text'>
commit 7f518ad0a212e2a6fd68630e176af1de395070a7 upstream.

The device details and mapping trees were just being decremented
before.  Now btree_del() is called to do a deep delete.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>md/bitmap: return an error when bitmap superblock is corrupt.</title>
<updated>2015-08-25T14:57:05Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.com</email>
</author>
<published>2015-08-14T07:04:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=eb037379413742e9390b8f20b6340c79e0fb9e6d'/>
<id>urn:sha1:eb037379413742e9390b8f20b6340c79e0fb9e6d</id>
<content type='text'>
commit b97e92574c0bf335db1cd2ec491d8ff5cd5d0b49 upstream
    Use separate bitmaps for each nodes in the cluster

bitmap_read_sb() validates the bitmap superblock that it reads in.
If it finds an inconsistency like a bad magic number or out-of-range
version number, it prints an error and returns, but it incorrectly
returns zero, so the array is still assembled with the (invalid) bitmap.

This means it could try to use a bitmap with a new version number which
it therefore does not understand.

This bug was introduced in 3.5 and fix as part of a larger patch in 4.1.
So the patch is suitable for any -stable kernel in that range.

Fixes: 27581e5ae01f ("md/bitmap: centralise allocation of bitmap file pages.")
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Reported-by: GuoQing Jiang &lt;gqjiang@suse.com&gt;

</content>
</entry>
<entry>
<title>md/raid1: extend spinlock to protect raid1_end_read_request against inconsistencies</title>
<updated>2015-08-25T14:56:56Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.com</email>
</author>
<published>2015-07-27T01:48:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=44174364dd6ce4a345f402474294d7694f7312ab'/>
<id>urn:sha1:44174364dd6ce4a345f402474294d7694f7312ab</id>
<content type='text'>
commit 423f04d63cf421ea436bcc5be02543d549ce4b28 upstream.

raid1_end_read_request() assumes that the In_sync bits are consistent
with the -&gt;degaded count.
raid1_spare_active updates the In_sync bit before the -&gt;degraded count
and so exposes an inconsistency, as does error()
So extend the spinlock in raid1_spare_active() and error() to hide those
inconsistencies.

This should probably be part of
  Commit: 34cab6f42003 ("md/raid1: fix test for 'was read error from
  last working device'.")
as it addresses the same issue.  It fixes the same bug and should go
to -stable for same reasons.

Fixes: 76073054c95b ("md/raid1: clean up read_balance.")
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>md: use kzalloc() when bitmap is disabled</title>
<updated>2015-08-19T06:36:51Z</updated>
<author>
<name>Benjamin Randazzo</name>
<email>benjamin@randazzo.fr</email>
</author>
<published>2015-07-25T14:36:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6578b22cd80381c9fbab152e1ababd8bfce8b5d0'/>
<id>urn:sha1:6578b22cd80381c9fbab152e1ababd8bfce8b5d0</id>
<content type='text'>
commit b6878d9e03043695dbf3fa1caa6dfc09db225b16 upstream.

In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".

5769         file = kmalloc(sizeof(*file), GFP_NOIO);
5770         if (!file)
5771                 return -ENOMEM;

This structure is copied to user space at the end of the function.

5786         if (err == 0 &amp;&amp;
5787             copy_to_user(arg, file, sizeof(*file)))
5788                 err = -EFAULT

But if bitmap is disabled only the first byte of "file" is initialized
with zero, so it's possible to read some bytes (up to 4095) of kernel
space memory from user space. This is an information leak.

5775         /* bitmap disabled, zero the first byte and copy out */
5776         if (!mddev-&gt;bitmap_info.file)
5777                 file-&gt;pathname[0] = '\0';

Signed-off-by: Benjamin Randazzo &lt;benjamin@randazzo.fr&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>md/raid1: fix test for 'was read error from last working device'.</title>
<updated>2015-08-19T06:36:38Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.com</email>
</author>
<published>2015-07-23T23:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7ceb73910bf3e50b19ae16ad9481f3eb4d09df65'/>
<id>urn:sha1:7ceb73910bf3e50b19ae16ad9481f3eb4d09df65</id>
<content type='text'>
commit 34cab6f42003cb06f48f86a86652984dec338ae9 upstream.

When we get a read error from the last working device, we don't
try to repair it, and don't fail the device.  We simple report a
read error to the caller.

However the current test for 'is this the last working device' is
wrong.
When there is only one fully working device, it assumes that a
non-faulty device is that device.  However a spare which is rebuilding
would be non-faulty but so not the only working device.

So change the test from "!Faulty" to "In_sync".  If -&gt;degraded says
there is only one fully working device and this device is in_sync,
this must be the one.

This bug has existed since we allowed read_balance to read from
a recovering spare in v3.0

Reported-and-tested-by: Alexander Lyakas &lt;alex.bolshoy@gmail.com&gt;
Fixes: 76073054c95b ("md/raid1: clean up read_balance.")
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>md: fix a build warning</title>
<updated>2015-08-04T14:52:24Z</updated>
<author>
<name>Firo Yang</name>
<email>firogm@gmail.com</email>
</author>
<published>2015-06-11T01:41:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3f3556dd0a0a5ed1c489fcd3daf50fc355bdaf45'/>
<id>urn:sha1:3f3556dd0a0a5ed1c489fcd3daf50fc355bdaf45</id>
<content type='text'>
commit 4e023612325a9034a542bfab79f78b1fe5ebb841 upstream.

Warning like this:

drivers/md/md.c: In function "update_array_info":
drivers/md/md.c:6394:26: warning: logical not is only applied
to the left hand side of comparison [-Wlogical-not-parentheses]
      !mddev-&gt;persistent  != info-&gt;not_persistent||

Fix it as Neil Brown said:
mddev-&gt;persistent != !info-&gt;not_persistent ||

Signed-off-by: Firo Yang &lt;firogm@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>dm btree: silence lockdep lock inversion in dm_btree_del()</title>
<updated>2015-08-04T14:52:16Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2015-07-03T13:51:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c3195fb188fd965efca9e388a1b1b4b3bad7e988'/>
<id>urn:sha1:c3195fb188fd965efca9e388a1b1b4b3bad7e988</id>
<content type='text'>
commit 1c7518794a3647eb345d59ee52844e8a40405198 upstream.

Allocate memory using GFP_NOIO when deleting a btree.  dm_btree_del()
can be called via an ioctl and we don't want to recurse into the FS or
block layer.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
</feed>
