linux/drivers/block/drbd
Lars Ellenberg a2a3c74f24 drbd: always write bitmap on detach
If we detach due to local read-error (which sets a bit in the bitmap),
stay Primary, and then re-attach (which re-reads the bitmap from disk),
we potentially lost the "out-of-sync" (or, "bad block") information in
the bitmap.

Always (try to) write out the changed bitmap pages before going diskless.

That way, we don't lose the bit for the bad block,
the next resync will fetch it from the peer, and rewrite
it locally, which may result in block reallocation in some
lower layer (or the hardware), and thereby "heal" the bad blocks.

If the bitmap writeout errors out as well, we will (again: try to)
mark the "we need a full sync" bit in our super block,
if it was a READ error; writes are covered by the activity log already.

If that superblock does not make it to disk either, we are sorry.

Maybe we just lost an entire disk or controller (or iSCSI connection),
and there actually are no bad blocks at all, so we don't need to
re-fetch from the peer, there is no "auto-healing" necessary.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2012-10-30 08:39:18 +01:00
..
drbd_actlog.c drbd: prepare for more than 32 bit flags 2012-10-30 08:39:18 +01:00
drbd_bitmap.c drbd: wait for meta data IO completion even with failed disk, unless force-detached 2012-10-30 08:39:18 +01:00
drbd_int.h drbd: always write bitmap on detach 2012-10-30 08:39:18 +01:00
drbd_main.c drbd: always write bitmap on detach 2012-10-30 08:39:18 +01:00
drbd_nl.c drbd: always write bitmap on detach 2012-10-30 08:39:18 +01:00
drbd_proc.c drbd: prepare for more than 32 bit flags 2012-10-30 08:39:18 +01:00
drbd_receiver.c drbd: prepare for more than 32 bit flags 2012-10-30 08:39:18 +01:00
drbd_req.c drbd: always write bitmap on detach 2012-10-30 08:39:18 +01:00
drbd_req.h drbd: Immediately allow completion of IOs, that wait for IO completions on a failed disk 2012-05-09 10:16:04 +02:00
drbd_strings.c drbd: Rename enum drbd_state_ret_codes to enum drbd_state_rv 2011-03-10 11:36:18 +01:00
drbd_vli.h Fix common misspellings 2011-03-31 11:26:23 -03:00
drbd_worker.c drbd: always write bitmap on detach 2012-10-30 08:39:18 +01:00
drbd_wrappers.h drbd: Get rid of unnecessary macros (2) 2011-03-10 11:36:15 +01:00
Kconfig drbd: Kconfig fix 2009-12-29 17:38:28 +01:00
Makefile drbd: remove tracing bits 2009-10-01 21:17:58 +02:00