drbd: fix potential kernel BUG (NULL deref)
authorLars Ellenberg <lars.ellenberg@linbit.com>
Sat, 4 Sep 2010 23:13:24 +0000 (01:13 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 14 Oct 2010 16:38:34 +0000 (18:38 +0200)
commit1d53f09e170e477de67babd7a10e277479260d51
treec795de9e5aeaf8324eeb25ea20c7b94f573bca83
parent435f07402b3165b90592073bc0f8c6f8fa160ff9
drbd: fix potential kernel BUG (NULL deref)

BUG trace would look like:
 lc_find
 drbd_rs_complete_io
 got_OVResult
 drbd_asender

Could be triggered by explicit, or IO-error policy based,
detach during online-verify.

We may only dereference mdev->resync, if we first get_ldev(), as the
disk may break any time, causing mdev->resync to disappear once all
ldev references have been returned.
Already in flight online-verify requests or replies may still come in,
which we then need to ignore.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_worker.c