Prev: [009/111] PCI: disable MSI on VIA K8M800
Next: [01/11] nvram: Fix write beyond end condition; prove to gcc copy is safe
From: Greg KH on 11 Aug 2010 20:00
2.6.27-stable review patch. If anyone has any objections, please let us know.
From: NeilBrown <neilb(a)suse.de>
commit 51e9ac77035a3dfcb6fc0a88a0d80b6f99b5edb1 upstream.
If the 'bio_split' path in raid10-read is used while
resync/recovery is happening it is possible to deadlock.
Fix this be elevating ->nr_waiting for the duration of both
parts of the split request.
This fixes a bug that has been present since 2.6.22
but has only started manifesting recently for unknown reasons.
It is suitable for and -stable since then.
Reported-by: Justin Bronder <jsbronder(a)gentoo.org>
Tested-by: Justin Bronder <jsbronder(a)gentoo.org>
Signed-off-by: NeilBrown <neilb(a)suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de>
drivers/md/raid10.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -818,11 +818,29 @@ static int make_request(struct request_q
bp = bio_split(bio, bio_split_pool,
chunk_sects - (bio->bi_sector & (chunk_sects - 1)) );
+ /* Each of these 'make_request' calls will call 'wait_barrier'.
+ * If the first succeeds but the second blocks due to the resync
+ * thread raising the barrier, we will deadlock because the
+ * IO to the underlying device will be queued in generic_make_request
+ * and will never complete, so will never reduce nr_pending.
+ * So increment nr_waiting here so no new raise_barriers will
+ * succeed, and so the second wait_barrier cannot block.
if (make_request(q, &bp->bio1))
if (make_request(q, &bp->bio2))
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/