diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-10-16 12:13:47 +0200 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-22 15:46:11 +0200 |
commit | 82f59cc6353889b426cf13b6596d5a3d100fa09e (patch) | |
tree | 6d5a678516334f0a37a56a509b84322a0352719b /drivers/block/amiflop.c | |
parent | 3beec1d446fba335f07787636920892dd3b2c658 (diff) | |
download | kernel_samsung_espresso10-82f59cc6353889b426cf13b6596d5a3d100fa09e.zip kernel_samsung_espresso10-82f59cc6353889b426cf13b6596d5a3d100fa09e.tar.gz kernel_samsung_espresso10-82f59cc6353889b426cf13b6596d5a3d100fa09e.tar.bz2 |
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/amiflop.c')
0 files changed, 0 insertions, 0 deletions