]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: fix another livelock caused by non-aligned writes.
authorNeilBrown <neilb@suse.de>
Sun, 1 Feb 2015 23:44:29 +0000 (10:44 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 2 Feb 2015 05:57:17 +0000 (16:57 +1100)
commit18c702a3a1252641e967b35d2025e3d869165356
tree62450049509e3f8413f2e3dbe52bd1f29d747e7f
parent2b8bf1b5ab2a1cd58e9797d7a3c2afea1d6cfda3
md/raid5: fix another livelock caused by non-aligned writes.

If a non-page-aligned write is destined for a device which
is missing/faulty, we can deadlock.

As the target device is missing, a read-modify-write cycle
is not possible.
As the write is not for a full-page, a recontruct-write cycle
is not possible.

This should be handled by logic in fetch_block() which notices
there is a non-R5_OVERWRITE write to a missing device, and so
loads all blocks.

However since commit 2a7abb3c16fa08, that code requires
STRIPE_PREREAD_ACTIVE before it will active, and those circumstances
never set STRIPE_PREREAD_ACTIVE.

So: in handle_stripe_dirtying, if neither rmw or rcw was possible,
set STRIPE_DELAYED, which will cause STRIPE_PREREAD_ACTIVE be set
after a suitable delay.

Fixes: 2a7abb3c16fa08ba5a38c8cb1ca235738951b9c9
Cc: stable@vger.kernel.org (v3.16+)
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c