dm raid1: hold all write bios when leg fails
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 10 Dec 2009 23:52:06 +0000 (23:52 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 10 Dec 2009 23:52:06 +0000 (23:52 +0000)
commit929be8fcb4b4b65d038e73d3bb34715851a95ca2
tree7c008317d90232b5b2d3869b9fa68c1ec023d7f6
parent60f355ead31e2be8d06ac8acb163df91a1c64e3b
dm raid1: hold all write bios when leg fails

Hold all write bios when leg fails and errors are handled

When using a userspace daemon such as dmeventd to handle errors, we must
delay completing  bios until it has done its job.
This patch prevents the following race:
  - primary leg fails
  - write "1" fail, the write is held, secondary leg is set default
  - write "2" goes straight to the secondary leg

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Takahiro Yasui <tyasui@redhat.com>
Tested-by: Takahiro Yasui <tyasui@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-raid1.c