summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorLars Ellenberg2010-10-16 12:13:47 +0200
committerPhilipp Reisner2010-10-22 15:46:11 +0200
commit82f59cc6353889b426cf13b6596d5a3d100fa09e (patch)
tree6d5a678516334f0a37a56a509b84322a0352719b /drivers/block/drbd/drbd_req.c
parentdrbd: tag a few error messages with "assert failed" (diff)
downloadkernel-qcow2-linux-82f59cc6353889b426cf13b6596d5a3d100fa09e.tar.gz
kernel-qcow2-linux-82f59cc6353889b426cf13b6596d5a3d100fa09e.tar.xz
kernel-qcow2-linux-82f59cc6353889b426cf13b6596d5a3d100fa09e.zip
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>
Diffstat (limited to 'drivers/block/drbd/drbd_req.c')
0 files changed, 0 insertions, 0 deletions