<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/md/md.c, branch v3.10.76</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>md: flush writes before starting a recovery.</title>
<updated>2014-07-09T18:14:02+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-07-02T02:04:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=527d01946f8bda3328b9e2f5247500643ee42eb8'/>
<id>527d01946f8bda3328b9e2f5247500643ee42eb8</id>
<content type='text'>
commit 133d4527eab8d199a62eee6bd433f0776842df2e upstream.

When we write to a degraded array which has a bitmap, we
make sure the relevant bit in the bitmap remains set when
the write completes (so a 're-add' can quickly rebuilt a
temporarily-missing device).

If, immediately after such a write starts, we incorporate a spare,
commence recovery, and skip over the region where the write is
happening (because the 'needs recovery' flag isn't set yet),
then that write will not get to the new device.

Once the recovery finishes the new device will be trusted, but will
have incorrect data, leading to possible corruption.

We cannot set the 'needs recovery' flag when we start the write as we
do not know easily if the write will be "degraded" or not.  That
depends on details of the particular raid level and particular write
request.

This patch fixes a corruption issue of long standing and so it
suitable for any -stable kernel.  It applied correctly to 3.0 at
least and will minor editing to earlier kernels.

Reported-by: Bill &lt;billstuff2001@sbcglobal.net&gt;
Tested-by: Bill &lt;billstuff2001@sbcglobal.net&gt;
Link: http://lkml.kernel.org/r/53A518BB.60709@sbcglobal.net
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 133d4527eab8d199a62eee6bd433f0776842df2e upstream.

When we write to a degraded array which has a bitmap, we
make sure the relevant bit in the bitmap remains set when
the write completes (so a 're-add' can quickly rebuilt a
temporarily-missing device).

If, immediately after such a write starts, we incorporate a spare,
commence recovery, and skip over the region where the write is
happening (because the 'needs recovery' flag isn't set yet),
then that write will not get to the new device.

Once the recovery finishes the new device will be trusted, but will
have incorrect data, leading to possible corruption.

We cannot set the 'needs recovery' flag when we start the write as we
do not know easily if the write will be "degraded" or not.  That
depends on details of the particular raid level and particular write
request.

This patch fixes a corruption issue of long standing and so it
suitable for any -stable kernel.  It applied correctly to 3.0 at
least and will minor editing to earlier kernels.

Reported-by: Bill &lt;billstuff2001@sbcglobal.net&gt;
Tested-by: Bill &lt;billstuff2001@sbcglobal.net&gt;
Link: http://lkml.kernel.org/r/53A518BB.60709@sbcglobal.net
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: always set MD_RECOVERY_INTR when interrupting a reshape thread.</title>
<updated>2014-06-11T19:03:24+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-05-29T01:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=88580b125ac63b24bbba7f71bd235f27c65f5baa'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: always set MD_RECOVERY_INTR when aborting a reshape or other "resync".</title>
<updated>2014-06-11T19:03:24+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-05-28T03:39:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d86a5d297deedda0d991e1216ad8817d2d5a3a2b'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: avoid possible spinning md thread at shutdown.</title>
<updated>2014-06-07T20:25:32+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2014-05-05T23:36:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=658864cc2cc40d228ff0a75457fcbb4dedb1a52e'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: fix problem when adding device to read-only array with bitmap.</title>
<updated>2014-01-25T16:27:12+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-12-11T23:13:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=bb4a65df3097524be403d455176710aee14d41f7'/>
<id>bb4a65df3097524be403d455176710aee14d41f7</id>
<content type='text'>
commit 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97 upstream.

If an array is started degraded, and then the missing device
is found it can be re-added and a minimal bitmap-based recovery
will bring it fully up-to-date.

If the array is read-only a recovery would not be allowed.
But also if the array is read-only and the missing device was
present very recently, then there could be no need for any
recovery at all, so we simply include the device in the read-only
array without any recovery.

However... if the missing device was removed a little longer ago
it could be missing some updates, but if a bitmap is present it will
be conditionally accepted pending a bitmap-based update.  We don't
currently detect this case properly and will include that old
device into the read-only array with no recovery even though it really
needs a recovery.

This patch keeps track of whether a bitmap-based-recovery is really
needed or not in the new Bitmap_sync rdev flag.  If that is set,
then the device will not be added to a read-only array.

Cc: Andrei Warkentin &lt;andreiw@vmware.com&gt;
Fixes: d70ed2e4fafdbef0800e73942482bb075c21578b
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97 upstream.

If an array is started degraded, and then the missing device
is found it can be re-added and a minimal bitmap-based recovery
will bring it fully up-to-date.

If the array is read-only a recovery would not be allowed.
But also if the array is read-only and the missing device was
present very recently, then there could be no need for any
recovery at all, so we simply include the device in the read-only
array without any recovery.

However... if the missing device was removed a little longer ago
it could be missing some updates, but if a bitmap is present it will
be conditionally accepted pending a bitmap-based update.  We don't
currently detect this case properly and will include that old
device into the read-only array with no recovery even though it really
needs a recovery.

This patch keeps track of whether a bitmap-based-recovery is really
needed or not in the new Bitmap_sync rdev flag.  If that is set,
then the device will not be added to a read-only array.

Cc: Andrei Warkentin &lt;andreiw@vmware.com&gt;
Fixes: d70ed2e4fafdbef0800e73942482bb075c21578b
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: fix calculation of stacking limits on level change.</title>
<updated>2013-12-04T18:57:15+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-11-14T04:16:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=8e43aac1ec86b5955ecf396395f6fd8b4be42157'/>
<id>8e43aac1ec86b5955ecf396395f6fd8b4be42157</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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: avoid deadlock when md_set_badblocks.</title>
<updated>2013-11-13T03:05:32+00:00</updated>
<author>
<name>Bian Yu</name>
<email>bianyu@kedacom.com</email>
</author>
<published>2013-10-12T05:10:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=0465496671f4769e0f4f00481ce5bc5598c5caa2'/>
<id>0465496671f4769e0f4f00481ce5bc5598c5caa2</id>
<content type='text'>
commit 905b0297a9533d7a6ee00a01a990456636877dd6 upstream.

When operate harddisk and hit errors, md_set_badblocks is called after
scsi_restart_operations which already disabled the irq. but md_set_badblocks
will call write_sequnlock_irq and enable irq. so softirq can preempt the
current thread and that may cause a deadlock. I think this situation should
use write_sequnlock_irqsave/irqrestore instead.

I met the situation and the call trace is below:
[  638.919974] BUG: spinlock recursion on CPU#0, scsi_eh_13/1010
[  638.921923]  lock: 0xffff8800d4d51fc8, .magic: dead4ead, .owner: scsi_eh_13/1010, .owner_cpu: 0
[  638.923890] CPU: 0 PID: 1010 Comm: scsi_eh_13 Not tainted 3.12.0-rc5+ #37
[  638.925844] Hardware name: To be filled by O.E.M. To be filled by O.E.M./MAHOBAY, BIOS 4.6.5 03/05/2013
[  638.927816]  ffff880037ad4640 ffff880118c03d50 ffffffff8172ff85 0000000000000007
[  638.929829]  ffff8800d4d51fc8 ffff880118c03d70 ffffffff81730030 ffff8800d4d51fc8
[  638.931848]  ffffffff81a72eb0 ffff880118c03d90 ffffffff81730056 ffff8800d4d51fc8
[  638.933884] Call Trace:
[  638.935867]  &lt;IRQ&gt;  [&lt;ffffffff8172ff85&gt;] dump_stack+0x55/0x76
[  638.937878]  [&lt;ffffffff81730030&gt;] spin_dump+0x8a/0x8f
[  638.939861]  [&lt;ffffffff81730056&gt;] spin_bug+0x21/0x26
[  638.941836]  [&lt;ffffffff81336de4&gt;] do_raw_spin_lock+0xa4/0xc0
[  638.943801]  [&lt;ffffffff8173f036&gt;] _raw_spin_lock+0x66/0x80
[  638.945747]  [&lt;ffffffff814a73ed&gt;] ? scsi_device_unbusy+0x9d/0xd0
[  638.947672]  [&lt;ffffffff8173fb1b&gt;] ? _raw_spin_unlock+0x2b/0x50
[  638.949595]  [&lt;ffffffff814a73ed&gt;] scsi_device_unbusy+0x9d/0xd0
[  638.951504]  [&lt;ffffffff8149ec47&gt;] scsi_finish_command+0x37/0xe0
[  638.953388]  [&lt;ffffffff814a75e8&gt;] scsi_softirq_done+0xa8/0x140
[  638.955248]  [&lt;ffffffff8130e32b&gt;] blk_done_softirq+0x7b/0x90
[  638.957116]  [&lt;ffffffff8104fddd&gt;] __do_softirq+0xfd/0x330
[  638.958987]  [&lt;ffffffff810b964f&gt;] ? __lock_release+0x6f/0x100
[  638.960861]  [&lt;ffffffff8174a5cc&gt;] call_softirq+0x1c/0x30
[  638.962724]  [&lt;ffffffff81004c7d&gt;] do_softirq+0x8d/0xc0
[  638.964565]  [&lt;ffffffff8105024e&gt;] irq_exit+0x10e/0x150
[  638.966390]  [&lt;ffffffff8174ad4a&gt;] smp_apic_timer_interrupt+0x4a/0x60
[  638.968223]  [&lt;ffffffff817499af&gt;] apic_timer_interrupt+0x6f/0x80
[  638.970079]  &lt;EOI&gt;  [&lt;ffffffff810b964f&gt;] ? __lock_release+0x6f/0x100
[  638.971899]  [&lt;ffffffff8173fa6a&gt;] ? _raw_spin_unlock_irq+0x3a/0x50
[  638.973691]  [&lt;ffffffff8173fa60&gt;] ? _raw_spin_unlock_irq+0x30/0x50
[  638.975475]  [&lt;ffffffff81562393&gt;] md_set_badblocks+0x1f3/0x4a0
[  638.977243]  [&lt;ffffffff81566e07&gt;] rdev_set_badblocks+0x27/0x80
[  638.978988]  [&lt;ffffffffa00d97bb&gt;] raid5_end_read_request+0x36b/0x4e0 [raid456]
[  638.980723]  [&lt;ffffffff811b5a1d&gt;] bio_endio+0x1d/0x40
[  638.982463]  [&lt;ffffffff81304ff3&gt;] req_bio_endio.isra.65+0x83/0xa0
[  638.984214]  [&lt;ffffffff81306b9f&gt;] blk_update_request+0x7f/0x350
[  638.985967]  [&lt;ffffffff81306ea1&gt;] blk_update_bidi_request+0x31/0x90
[  638.987710]  [&lt;ffffffff813085e0&gt;] __blk_end_bidi_request+0x20/0x50
[  638.989439]  [&lt;ffffffff8130862f&gt;] __blk_end_request_all+0x1f/0x30
[  638.991149]  [&lt;ffffffff81308746&gt;] blk_peek_request+0x106/0x250
[  638.992861]  [&lt;ffffffff814a62a9&gt;] ? scsi_kill_request.isra.32+0xe9/0x130
[  638.994561]  [&lt;ffffffff814a633a&gt;] scsi_request_fn+0x4a/0x3d0
[  638.996251]  [&lt;ffffffff813040a7&gt;] __blk_run_queue+0x37/0x50
[  638.997900]  [&lt;ffffffff813045af&gt;] blk_run_queue+0x2f/0x50
[  638.999553]  [&lt;ffffffff814a5750&gt;] scsi_run_queue+0xe0/0x1c0
[  639.001185]  [&lt;ffffffff814a7721&gt;] scsi_run_host_queues+0x21/0x40
[  639.002798]  [&lt;ffffffff814a2e87&gt;] scsi_restart_operations+0x177/0x200
[  639.004391]  [&lt;ffffffff814a4fe9&gt;] scsi_error_handler+0xc9/0xe0
[  639.005996]  [&lt;ffffffff814a4f20&gt;] ? scsi_unjam_host+0xd0/0xd0
[  639.007600]  [&lt;ffffffff81072f6b&gt;] kthread+0xdb/0xe0
[  639.009205]  [&lt;ffffffff81072e90&gt;] ? flush_kthread_worker+0x170/0x170
[  639.010821]  [&lt;ffffffff81748cac&gt;] ret_from_fork+0x7c/0xb0
[  639.012437]  [&lt;ffffffff81072e90&gt;] ? flush_kthread_worker+0x170/0x170

This bug was introduce in commit  2e8ac30312973dd20e68073653
(the first time rdev_set_badblock was call from interrupt context),
so this patch is appropriate for 3.5 and subsequent kernels.

Signed-off-by: Bian Yu &lt;bianyu@kedacom.com&gt;
Reviewed-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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 905b0297a9533d7a6ee00a01a990456636877dd6 upstream.

When operate harddisk and hit errors, md_set_badblocks is called after
scsi_restart_operations which already disabled the irq. but md_set_badblocks
will call write_sequnlock_irq and enable irq. so softirq can preempt the
current thread and that may cause a deadlock. I think this situation should
use write_sequnlock_irqsave/irqrestore instead.

I met the situation and the call trace is below:
[  638.919974] BUG: spinlock recursion on CPU#0, scsi_eh_13/1010
[  638.921923]  lock: 0xffff8800d4d51fc8, .magic: dead4ead, .owner: scsi_eh_13/1010, .owner_cpu: 0
[  638.923890] CPU: 0 PID: 1010 Comm: scsi_eh_13 Not tainted 3.12.0-rc5+ #37
[  638.925844] Hardware name: To be filled by O.E.M. To be filled by O.E.M./MAHOBAY, BIOS 4.6.5 03/05/2013
[  638.927816]  ffff880037ad4640 ffff880118c03d50 ffffffff8172ff85 0000000000000007
[  638.929829]  ffff8800d4d51fc8 ffff880118c03d70 ffffffff81730030 ffff8800d4d51fc8
[  638.931848]  ffffffff81a72eb0 ffff880118c03d90 ffffffff81730056 ffff8800d4d51fc8
[  638.933884] Call Trace:
[  638.935867]  &lt;IRQ&gt;  [&lt;ffffffff8172ff85&gt;] dump_stack+0x55/0x76
[  638.937878]  [&lt;ffffffff81730030&gt;] spin_dump+0x8a/0x8f
[  638.939861]  [&lt;ffffffff81730056&gt;] spin_bug+0x21/0x26
[  638.941836]  [&lt;ffffffff81336de4&gt;] do_raw_spin_lock+0xa4/0xc0
[  638.943801]  [&lt;ffffffff8173f036&gt;] _raw_spin_lock+0x66/0x80
[  638.945747]  [&lt;ffffffff814a73ed&gt;] ? scsi_device_unbusy+0x9d/0xd0
[  638.947672]  [&lt;ffffffff8173fb1b&gt;] ? _raw_spin_unlock+0x2b/0x50
[  638.949595]  [&lt;ffffffff814a73ed&gt;] scsi_device_unbusy+0x9d/0xd0
[  638.951504]  [&lt;ffffffff8149ec47&gt;] scsi_finish_command+0x37/0xe0
[  638.953388]  [&lt;ffffffff814a75e8&gt;] scsi_softirq_done+0xa8/0x140
[  638.955248]  [&lt;ffffffff8130e32b&gt;] blk_done_softirq+0x7b/0x90
[  638.957116]  [&lt;ffffffff8104fddd&gt;] __do_softirq+0xfd/0x330
[  638.958987]  [&lt;ffffffff810b964f&gt;] ? __lock_release+0x6f/0x100
[  638.960861]  [&lt;ffffffff8174a5cc&gt;] call_softirq+0x1c/0x30
[  638.962724]  [&lt;ffffffff81004c7d&gt;] do_softirq+0x8d/0xc0
[  638.964565]  [&lt;ffffffff8105024e&gt;] irq_exit+0x10e/0x150
[  638.966390]  [&lt;ffffffff8174ad4a&gt;] smp_apic_timer_interrupt+0x4a/0x60
[  638.968223]  [&lt;ffffffff817499af&gt;] apic_timer_interrupt+0x6f/0x80
[  638.970079]  &lt;EOI&gt;  [&lt;ffffffff810b964f&gt;] ? __lock_release+0x6f/0x100
[  638.971899]  [&lt;ffffffff8173fa6a&gt;] ? _raw_spin_unlock_irq+0x3a/0x50
[  638.973691]  [&lt;ffffffff8173fa60&gt;] ? _raw_spin_unlock_irq+0x30/0x50
[  638.975475]  [&lt;ffffffff81562393&gt;] md_set_badblocks+0x1f3/0x4a0
[  638.977243]  [&lt;ffffffff81566e07&gt;] rdev_set_badblocks+0x27/0x80
[  638.978988]  [&lt;ffffffffa00d97bb&gt;] raid5_end_read_request+0x36b/0x4e0 [raid456]
[  638.980723]  [&lt;ffffffff811b5a1d&gt;] bio_endio+0x1d/0x40
[  638.982463]  [&lt;ffffffff81304ff3&gt;] req_bio_endio.isra.65+0x83/0xa0
[  638.984214]  [&lt;ffffffff81306b9f&gt;] blk_update_request+0x7f/0x350
[  638.985967]  [&lt;ffffffff81306ea1&gt;] blk_update_bidi_request+0x31/0x90
[  638.987710]  [&lt;ffffffff813085e0&gt;] __blk_end_bidi_request+0x20/0x50
[  638.989439]  [&lt;ffffffff8130862f&gt;] __blk_end_request_all+0x1f/0x30
[  638.991149]  [&lt;ffffffff81308746&gt;] blk_peek_request+0x106/0x250
[  638.992861]  [&lt;ffffffff814a62a9&gt;] ? scsi_kill_request.isra.32+0xe9/0x130
[  638.994561]  [&lt;ffffffff814a633a&gt;] scsi_request_fn+0x4a/0x3d0
[  638.996251]  [&lt;ffffffff813040a7&gt;] __blk_run_queue+0x37/0x50
[  638.997900]  [&lt;ffffffff813045af&gt;] blk_run_queue+0x2f/0x50
[  638.999553]  [&lt;ffffffff814a5750&gt;] scsi_run_queue+0xe0/0x1c0
[  639.001185]  [&lt;ffffffff814a7721&gt;] scsi_run_host_queues+0x21/0x40
[  639.002798]  [&lt;ffffffff814a2e87&gt;] scsi_restart_operations+0x177/0x200
[  639.004391]  [&lt;ffffffff814a4fe9&gt;] scsi_error_handler+0xc9/0xe0
[  639.005996]  [&lt;ffffffff814a4f20&gt;] ? scsi_unjam_host+0xd0/0xd0
[  639.007600]  [&lt;ffffffff81072f6b&gt;] kthread+0xdb/0xe0
[  639.009205]  [&lt;ffffffff81072e90&gt;] ? flush_kthread_worker+0x170/0x170
[  639.010821]  [&lt;ffffffff81748cac&gt;] ret_from_fork+0x7c/0xb0
[  639.012437]  [&lt;ffffffff81072e90&gt;] ? flush_kthread_worker+0x170/0x170

This bug was introduce in commit  2e8ac30312973dd20e68073653
(the first time rdev_set_badblock was call from interrupt context),
so this patch is appropriate for 3.5 and subsequent kernels.

Signed-off-by: Bian Yu &lt;bianyu@kedacom.com&gt;
Reviewed-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;

</pre>
</div>
</content>
</entry>
<entry>
<title>md: Remove recent change which allows devices to skip recovery.</title>
<updated>2013-08-04T08:50:53+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-07-17T04:55:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1d83ab8548ff19bad94dcae62ba13ea476974e7f'/>
<id>1d83ab8548ff19bad94dcae62ba13ea476974e7f</id>
<content type='text'>
commit 5024c298311f3b97c85cb034f9edaa333fdb9338 upstream.

commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86
    md: Allow devices to be re-added to a read-only array.

allowed a bit more than just that.  It also allows devices to be added
to a read-write array and to end up skipping recovery.

This patch removes the offending piece of code pending a rewrite for a
subsequent release.

More specifically:
 If the array has a bitmap, then the device will still need a bitmap
 based resync ('saved_raid_disk' is set under different conditions
 is a bitmap is present).
 If the array doesn't have a bitmap, then this is correct as long as
 nothing has been written to the array since the metadata was checked
 by -&gt;validate_super.  However there is no locking to ensure that there
 was no write.

Bug was introduced in 3.10 and causes data corruption so
patch is suitable for 3.10-stable.

Reported-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5024c298311f3b97c85cb034f9edaa333fdb9338 upstream.

commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86
    md: Allow devices to be re-added to a read-only array.

allowed a bit more than just that.  It also allows devices to be added
to a read-write array and to end up skipping recovery.

This patch removes the offending piece of code pending a rewrite for a
subsequent release.

More specifically:
 If the array has a bitmap, then the device will still need a bitmap
 based resync ('saved_raid_disk' is set under different conditions
 is a bitmap is present).
 If the array doesn't have a bitmap, then this is correct as long as
 nothing has been written to the array since the metadata was checked
 by -&gt;validate_super.  However there is no locking to ensure that there
 was no write.

Bug was introduced in 3.10 and causes data corruption so
patch is suitable for 3.10-stable.

Reported-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'md-3.10-fixes' of git://neil.brown.name/md</title>
<updated>2013-06-13T17:13:29+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-06-13T17:13:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=82ea4be61f45d1a7ba1f5151d90124d1ece0c07a'/>
<id>82ea4be61f45d1a7ba1f5151d90124d1ece0c07a</id>
<content type='text'>
Pull md bugfixes from Neil Brown:
 "A few bugfixes for md

  Some tagged for -stable"

* tag 'md-3.10-fixes' of git://neil.brown.name/md:
  md/raid1,5,10: Disable WRITE SAME until a recovery strategy is in place
  md/raid1,raid10: use freeze_array in place of raise_barrier in various places.
  md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it.
  md: md_stop_writes() should always freeze recovery.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull md bugfixes from Neil Brown:
 "A few bugfixes for md

  Some tagged for -stable"

* tag 'md-3.10-fixes' of git://neil.brown.name/md:
  md/raid1,5,10: Disable WRITE SAME until a recovery strategy is in place
  md/raid1,raid10: use freeze_array in place of raise_barrier in various places.
  md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it.
  md: md_stop_writes() should always freeze recovery.
</pre>
</div>
</content>
</entry>
<entry>
<title>md: md_stop_writes() should always freeze recovery.</title>
<updated>2013-06-13T03:18:15+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2013-05-08T23:48:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=6b6204ee92adb53bfd6a77cb5679282ec3820c4b'/>
<id>6b6204ee92adb53bfd6a77cb5679282ec3820c4b</id>
<content type='text'>
__md_stop_writes() will currently sometimes freeze recovery.
So any caller must be ready for that to happen, and indeed they are.

However if __md_stop_writes() doesn't freeze_recovery, then
a recovery could start before mddev_suspend() is called, which
could be awkward.  This can particularly cause problems or dm-raid.

So change __md_stop_writes() to always freeze recovery.  This is safe
and more predicatable.

Reported-by: Brassow Jonathan &lt;jbrassow@redhat.com&gt;
Tested-by: Brassow Jonathan &lt;jbrassow@redhat.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__md_stop_writes() will currently sometimes freeze recovery.
So any caller must be ready for that to happen, and indeed they are.

However if __md_stop_writes() doesn't freeze_recovery, then
a recovery could start before mddev_suspend() is called, which
could be awkward.  This can particularly cause problems or dm-raid.

So change __md_stop_writes() to always freeze recovery.  This is safe
and more predicatable.

Reported-by: Brassow Jonathan &lt;jbrassow@redhat.com&gt;
Tested-by: Brassow Jonathan &lt;jbrassow@redhat.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
