<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md, branch v3.12.4</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md?h=v3.12.4</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md?h=v3.12.4'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-12-08T15:29:15Z</updated>
<entry>
<title>md/raid5: Use conf-&gt;device_lock protect changing of multi-thread resources.</title>
<updated>2013-12-08T15:29:15Z</updated>
<author>
<name>majianpeng</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2013-11-14T04:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8d3022e39bd68f76669ee3200797d44afdebd841'/>
<id>urn:sha1:8d3022e39bd68f76669ee3200797d44afdebd841</id>
<content type='text'>
commit 60aaf933854511630e16be4efe0f96485e132de4 upstream.
and commit 0c775d5208284700de423e6746259da54a42e1f5

When we change group_thread_cnt from sysfs entry, it can OOPS.

The kernel messages are:
[  135.299021] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  135.299073] IP: [&lt;ffffffff815188ab&gt;] handle_active_stripes+0x32b/0x440
[  135.299107] PGD 0
[  135.299122] Oops: 0000 [#1] SMP
[  135.299144] Modules linked in: netconsole e1000e ptp pps_core
[  135.299188] CPU: 3 PID: 2225 Comm: md0_raid5 Not tainted 3.12.0+ #24
[  135.299214] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080015  11/09/2011
[  135.299255] task: ffff8800b9638f80 ti: ffff8800b77a4000 task.ti: ffff8800b77a4000
[  135.299283] RIP: 0010:[&lt;ffffffff815188ab&gt;]  [&lt;ffffffff815188ab&gt;] handle_active_stripes+0x32b/0x440
[  135.299323] RSP: 0018:ffff8800b77a5c48  EFLAGS: 00010002
[  135.299344] RAX: ffff880037bb5c70 RBX: 0000000000000000 RCX: 0000000000000008
[  135.299371] RDX: ffff880037bb5cb8 RSI: 0000000000000001 RDI: ffff880037bb5c00
[  135.299398] RBP: ffff8800b77a5d08 R08: 0000000000000001 R09: 0000000000000000
[  135.299425] R10: ffff8800b77a5c98 R11: 00000000ffffffff R12: ffff880037bb5c00
[  135.299452] R13: 0000000000000000 R14: 0000000000000000 R15: ffff880037bb5c70
[  135.299479] FS:  0000000000000000(0000) GS:ffff88013fd80000(0000) knlGS:0000000000000000
[  135.299510] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  135.299532] CR2: 0000000000000000 CR3: 0000000001c0b000 CR4: 00000000000407e0
[  135.299559] Stack:
[  135.299570]  ffff8800b77a5c88 ffffffff8107383e ffff8800b77a5c88 ffff880037a64300
[  135.299611]  000000000000ec08 ffff880037bb5cb8 ffff8800b77a5c98 ffffffffffffffd8
[  135.299654]  000000000000ec08 ffff880037bb5c60 ffff8800b77a5c98 ffff8800b77a5c98
[  135.299696] Call Trace:
[  135.299711]  [&lt;ffffffff8107383e&gt;] ? __wake_up+0x4e/0x70
[  135.299733]  [&lt;ffffffff81518f88&gt;] raid5d+0x4c8/0x680
[  135.299756]  [&lt;ffffffff817174ed&gt;] ? schedule_timeout+0x15d/0x1f0
[  135.299781]  [&lt;ffffffff81524c9f&gt;] md_thread+0x11f/0x170
[  135.299804]  [&lt;ffffffff81069cd0&gt;] ? wake_up_bit+0x40/0x40
[  135.299826]  [&lt;ffffffff81524b80&gt;] ? md_rdev_init+0x110/0x110
[  135.299850]  [&lt;ffffffff81069656&gt;] kthread+0xc6/0xd0
[  135.299871]  [&lt;ffffffff81069590&gt;] ? kthread_freezable_should_stop+0x70/0x70
[  135.299899]  [&lt;ffffffff81722ffc&gt;] ret_from_fork+0x7c/0xb0
[  135.299923]  [&lt;ffffffff81069590&gt;] ? kthread_freezable_should_stop+0x70/0x70
[  135.299951] Code: ff ff ff 0f 84 d7 fe ff ff e9 5c fe ff ff 66 90 41 8b b4 24 d8 01 00 00 45 31 ed 85 f6 0f 8e 7b fd ff ff 49 8b 9c 24 d0 01 00 00 &lt;48&gt; 3b 1b 49 89 dd 0f 85 67 fd ff ff 48 8d 43 28 31 d2 eb 17 90
[  135.300005] RIP  [&lt;ffffffff815188ab&gt;] handle_active_stripes+0x32b/0x440
[  135.300005]  RSP &lt;ffff8800b77a5c48&gt;
[  135.300005] CR2: 0000000000000000
[  135.300005] ---[ end trace 504854e5bb7562ed ]---
[  135.300005] Kernel panic - not syncing: Fatal exception

This is because raid5d() can be running when the multi-thread
resources are changed via system. We see need to provide locking.

mddev-&gt;device_lock is suitable, but we cannot simple call
alloc_thread_groups under this lock as we cannot allocate memory
while holding a spinlock.
So change alloc_thread_groups() to allocate and return the data
structures, then raid5_store_group_thread_cnt() can take the lock
while updating the pointers to the data structures.

This fixes a bug introduced in 3.12 and so is suitable for the 3.12.x
stable series.

Fixes: b721420e8719131896b009b11edbbd27
Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Reviewed-by: Shaohua Li &lt;shli@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>md: test mddev-&gt;flags more safely in md_check_recovery.</title>
<updated>2013-12-04T19:05:54Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-11-27T23:34:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=52df633c9c9c92264e04e1ead9290e5192a8768e'/>
<id>urn:sha1:52df633c9c9c92264e04e1ead9290e5192a8768e</id>
<content type='text'>
commit 142d44c310819e1965ca70b4d55d7679f5797e25 upstream.

commit 7a0a5355cbc71efa md: Don't test all of mddev-&gt;flags at once.
made most tests on mddev-&gt;flags safer, but missed one.

When
commit 260fa034ef7a4ff8b7306 md: avoid deadlock when dirty buffers during md_stop.
added MD_STILL_CLOSED, this caused md_check_recovery to misbehave.
It can think there is something to do but find nothing.  This can
lead to the md thread spinning during array shutdown.

https://bugzilla.kernel.org/show_bug.cgi?id=65721

Reported-and-tested-by: Richard W.M. Jones &lt;rjones@redhat.com&gt;
Fixes: 260fa034ef7a4ff8b7306
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/raid5: Before freeing old multi-thread worker, it should flush them.</title>
<updated>2013-12-04T19:05:54Z</updated>
<author>
<name>majianpeng</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2013-11-14T04:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2501e938cf2350ca719e423b3aa30e7303805b7c'/>
<id>urn:sha1:2501e938cf2350ca719e423b3aa30e7303805b7c</id>
<content type='text'>
commit d206dcfa9809ec3409483e93b5e362f801fa0c27 upstream.

When changing group_thread_cnt from sysfs entry, the kernel can oops.

The kernel messages are:
[  740.961389] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[  740.961444] IP: [&lt;ffffffff81062570&gt;] process_one_work+0x30/0x500
[  740.961476] PGD b9013067 PUD b651e067 PMD 0
[  740.961503] Oops: 0000 [#1] SMP
[  740.961525] Modules linked in: netconsole e1000e ptp pps_core
[  740.961577] CPU: 0 PID: 3683 Comm: kworker/u8:5 Not tainted 3.12.0+ #23
[  740.961602] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./To be filled by O.E.M., BIOS 080015  11/09/2011
[  740.961646] task: ffff88013abe0000 ti: ffff88013a246000 task.ti: ffff88013a246000
[  740.961673] RIP: 0010:[&lt;ffffffff81062570&gt;]  [&lt;ffffffff81062570&gt;] process_one_work+0x30/0x500
[  740.961708] RSP: 0018:ffff88013a247e08  EFLAGS: 00010086
[  740.961730] RAX: ffff8800b912b400 RBX: ffff88013a61e680 RCX: ffff8800b912b400
[  740.961757] RDX: ffff8800b912b600 RSI: ffff8800b912b600 RDI: ffff88013a61e680
[  740.961782] RBP: ffff88013a247e48 R08: ffff88013a246000 R09: 000000000002c09d
[  740.961808] R10: 000000000000010f R11: 0000000000000000 R12: ffff88013b00cc00
[  740.961833] R13: 0000000000000000 R14: ffff88013b00cf80 R15: ffff88013a61e6b0
[  740.961861] FS:  0000000000000000(0000) GS:ffff88013fc00000(0000) knlGS:0000000000000000
[  740.961893] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  740.962001] CR2: 00000000000000b8 CR3: 00000000b24fe000 CR4: 00000000000407f0
[  740.962001] Stack:
[  740.962001]  0000000000000008 ffff8800b912b600 ffff88013b00cc00 ffff88013a61e680
[  740.962001]  ffff88013b00cc00 ffff88013b00cc18 ffff88013b00cf80 ffff88013a61e6b0
[  740.962001]  ffff88013a247eb8 ffffffff810639c6 0000000000012a80 ffff88013a247fd8
[  740.962001] Call Trace:
[  740.962001]  [&lt;ffffffff810639c6&gt;] worker_thread+0x206/0x3f0
[  740.962001]  [&lt;ffffffff810637c0&gt;] ? manage_workers+0x2c0/0x2c0
[  740.962001]  [&lt;ffffffff81069656&gt;] kthread+0xc6/0xd0
[  740.962001]  [&lt;ffffffff81069590&gt;] ? kthread_freezable_should_stop+0x70/0x70
[  740.962001]  [&lt;ffffffff81722ffc&gt;] ret_from_fork+0x7c/0xb0
[  740.962001]  [&lt;ffffffff81069590&gt;] ? kthread_freezable_should_stop+0x70/0x70
[  740.962001] Code: 89 e5 41 57 41 56 41 55 45 31 ed 41 54 53 48 89 fb 48 83 ec 18 48 8b 06 4c 8b 67 48 48 89 c1 30 c9 a8 04 4c 0f 45 e9 80 7f 58 00 &lt;49&gt; 8b 45 08 44 8b b0 00 01 00 00 78 0c 41 f6 44 24 10 04 0f 84
[  740.962001] RIP  [&lt;ffffffff81062570&gt;] process_one_work+0x30/0x500
[  740.962001]  RSP &lt;ffff88013a247e08&gt;
[  740.962001] CR2: 0000000000000008
[  740.962001] ---[ end trace 39181460000748de ]---
[  740.962001] Kernel panic - not syncing: Fatal exception

This can happen if there are some stripes left, fewer than MAX_STRIPE_BATCH.
A worker is queued to handle them.
But before calling raid5_do_work, raid5d handles those
stripes making conf-&gt;active_stripe = 0.
So mddev_suspend() can return.
We might then free old worker resources before the queued
raid5_do_work() handled them.  When it runs, it crashes.

	raid5d()		raid5_store_group_thread_cnt()
	queue_work		mddev_suspend()
				handle_strips
				active_stripe=0
				free(old worker resources)
	process_one_work
	raid5_do_work

To avoid this, we should only flush the worker resources before freeing them.

This fixes a bug introduced in 3.12 so is suitable for the 3.12.x
stable series.

Fixes: b721420e8719131896b009b11edbbd27
Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Reviewed-by: Shaohua Li &lt;shli@kernel.org&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-04T19:05:54Z</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=2befeea454107590a5f6db1e5839cadfa599eb34'/>
<id>urn:sha1:2befeea454107590a5f6db1e5839cadfa599eb34</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>
<entry>
<title>raid5: Use slow_path to release stripe when mddev-&gt;thread is null</title>
<updated>2013-12-04T19:05:53Z</updated>
<author>
<name>majianpeng</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2013-11-14T04:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0524a6bf9f76d51cfb1d96622bffedf1219990fb'/>
<id>urn:sha1:0524a6bf9f76d51cfb1d96622bffedf1219990fb</id>
<content type='text'>
commit ad4068de49862b083ac2a15bc50689bb30ce3e44 upstream.

When release_stripe() is called in grow_one_stripe(), the
mddev-&gt;thread is null. So it will omit one wakeup this thread to
release stripe.
For this condition, use slow_path to release stripe.

Bug was introduced in 3.12

Fixes: 773ca82fa1ee58dd1bf88b
Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&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>bcache: Fix dirty_data accounting</title>
<updated>2013-12-04T19:05:38Z</updated>
<author>
<name>Kent Overstreet</name>
<email>kmo@daterainc.com</email>
</author>
<published>2013-11-11T05:55:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a8ffbb939c4e4d630b0c2155e6703a64da040556'/>
<id>urn:sha1:a8ffbb939c4e4d630b0c2155e6703a64da040556</id>
<content type='text'>
commit 1fa8455deb92e9ec7756df23030e73b2d28eeca7 upstream.

Dirty data accounting wasn't quite right - firstly, we were adding the key we're
inserting after it could have merged with another dirty key already in the
btree, and secondly we could sometimes pass the wrong offset to
bcache_dev_sectors_dirty_add() for dirty data we were overwriting - which is
important when tracking dirty data by stripe.

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm: allocate buffer for messages with small number of arguments using GFP_NOIO</title>
<updated>2013-12-04T19:05:36Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2013-10-31T17:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9afdbf0a4e3d7ea4030de51ca4b73de5c18386ec'/>
<id>urn:sha1:9afdbf0a4e3d7ea4030de51ca4b73de5c18386ec</id>
<content type='text'>
commit f36afb3957353d2529cb2b00f78fdccd14fc5e9c upstream.

dm-mpath and dm-thin must process messages even if some device is
suspended, so we allocate argv buffer with GFP_NOIO. These messages have
a small fixed number of arguments.

On the other hand, dm-switch needs to process bulk data using messages
so excessive use of GFP_NOIO could cause trouble.

The patch also lowers the default number of arguments from 64 to 8, so
that there is smaller load on GFP_NOIO allocations.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Acked-by: Alasdair G Kergon &lt;agk@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 a race condition between queuing new migrations and quiescing for a shutdown</title>
<updated>2013-12-04T19:05:33Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-10-30T17:11:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=901dfc022de56b1f3c6dc605116af540bd0c1044'/>
<id>urn:sha1:901dfc022de56b1f3c6dc605116af540bd0c1044</id>
<content type='text'>
commit 66cb1910df17b38334153462ec8166e48058035f upstream.

The code that was trying to do this was inadequate.  The postsuspend
method (in ioctl context), needs to wait for the worker thread to
acknowledge the request to quiesce.  Otherwise the migration count may
drop to zero temporarily before the worker thread realises we're
quiescing.  In this case the target will be taken down, but the worker
thread may have issued a new migration, which will cause an oops when
it completes.

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 array: fix bug in growing array</title>
<updated>2013-12-04T19:05:27Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-10-30T11:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=884d5952afcbee9d56961663051390dda586107f'/>
<id>urn:sha1:884d5952afcbee9d56961663051390dda586107f</id>
<content type='text'>
commit 9c1d4de56066e4d6abc66ec188faafd7b303fb08 upstream.

Entries would be lost if the old tail block was partially filled.

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 mpath: fix race condition between multipath_dtr and pg_init_done</title>
<updated>2013-12-04T19:05:27Z</updated>
<author>
<name>Shiva Krishna Merla</name>
<email>shivakrishna.merla@netapp.com</email>
</author>
<published>2013-10-30T03:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0cc9fcd42fdf34e165a90a4358a37ec93e682d0c'/>
<id>urn:sha1:0cc9fcd42fdf34e165a90a4358a37ec93e682d0c</id>
<content type='text'>
commit 954a73d5d3073df2231820c718fdd2f18b0fe4c9 upstream.

Whenever multipath_dtr() is happening we must prevent queueing any
further path activation work.  Implement this by adding a new
'pg_init_disabled' flag to the multipath structure that denotes future
path activation work should be skipped if it is set.  By disabling
pg_init and then re-enabling in flush_multipath_work() we also avoid the
potential for pg_init to be initiated while suspending an mpath device.

Without this patch a race condition exists that may result in a kernel
panic:

1) If after pg_init_done() decrements pg_init_in_progress to 0, a call
   to wait_for_pg_init_completion() assumes there are no more pending path
   management commands.
2) If pg_init_required is set by pg_init_done(), due to retryable
   mode_select errors, then process_queued_ios() will again queue the
   path activation work.
3) If free_multipath() completes before activate_path() work is called a
   NULL pointer dereference like the following can be seen when
   accessing members of the recently destructed multipath:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
RIP: 0010:[&lt;ffffffffa003db1b&gt;]  [&lt;ffffffffa003db1b&gt;] activate_path+0x1b/0x30 [dm_multipath]
[&lt;ffffffff81090ac0&gt;] worker_thread+0x170/0x2a0
[&lt;ffffffff81096c80&gt;] ? autoremove_wake_function+0x0/0x40

[switch to disabling pg_init in flush_multipath_work &amp; header edits by Mike Snitzer]
Signed-off-by: Shiva Krishna Merla &lt;shivakrishna.merla@netapp.com&gt;
Reviewed-by: Krishnasamy Somasundaram &lt;somasundaram.krishnasamy@netapp.com&gt;
Tested-by: Speagle Andy &lt;Andy.Speagle@netapp.com&gt;
Acked-by: Junichi Nomura &lt;j-nomura@ce.jp.nec.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>
