OpenCloudOS-Kernel/drivers/block/drbd
Lars Ellenberg 82f59cc635 drbd: fix potential deadlock on detach
If we have contention in drbd_al_begin_iod (heavy randon IO),
an administrative request to detach the disk may deadlock
for similar reasons as the recently fixed deadlock if detaching
because of IO-error.

The approach taken here is to either go through the intermediate
cleanup state D_FAILED, or first lock out application io,
don't just go directly to D_DISKLESS.

We need an additional state bit (WAS_IO_ERROR) to distinguish
the -> D_FAILED because of IO-error from other failures.

Sanitize D_ATTACHING -> D_FAILED to D_ATTACHING -> D_DISKLESS.
If only attaching, ldev may be missing still, but would be referenced
from within the after_state_ch for -> D_FAILED, potentially
dereferencing a NULL pointer.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2010-10-22 15:46:11 +02: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
drbd_actlog.c drbd: reduce code duplication when receiving data requests 2010-10-14 18:38:19 +02:00
drbd_bitmap.c drbd: Disable activity log updates when the whole device is out of sync 2010-10-14 18:38:26 +02:00
drbd_int.h drbd: fix potential deadlock on detach 2010-10-22 15:46:11 +02:00
drbd_main.c drbd: fix potential deadlock on detach 2010-10-22 15:46:11 +02:00
drbd_nl.c drbd: fix potential deadlock on detach 2010-10-22 15:46:11 +02:00
drbd_proc.c drbd: cleanup: change "<= 0" to "== 0" 2010-10-14 19:17:23 +02:00
drbd_receiver.c drbd: fix potential deadlock on detach 2010-10-22 15:46:11 +02:00
drbd_req.c drbd: Track the reasons to suspend IO in dedicated state bits 2010-10-14 18:38:40 +02:00
drbd_req.h drbd: Disable activity log updates when the whole device is out of sync 2010-10-14 18:38:26 +02:00
drbd_strings.c drbd: don't start a resync without access to up-to-date Data 2010-05-18 01:08:18 +02:00
drbd_vli.h The DRBD driver 2009-10-01 21:17:49 +02:00
drbd_worker.c drbd: add explicit drbd_md_sync to drbd_resync_finished 2010-10-14 18:38:52 +02:00
drbd_wrappers.h drbd: Allow drbd_epoch_entries to use multiple bios. 2010-05-18 02:01:23 +02:00