linux/drivers/block/drbd
Lars Ellenberg 6a9a92f4ef drbd: fix harmless race to not trigger an ASSERT
We have one pre-allocated page to do certain synchronous meta data IO with,
using it is serialized like so:
	drbd_md_get_buffer();
	drbd_md_sync_page_io();
	drbd_md_sync_page_io();
	...
	drbd_md_put_buffer();

In drbd_md_sync_page_io() there is an
	ASSERT(atomic_read(&mdev->md_io_in_use) == 1);

We want to be able to timeout on unresponsive lower level devices, so we
can "detach" in that case. Inside drbd_md_sync_page_io() we grab an extra
reference, to not have a dangling pointer in case a delayed IO eventually
does still complete, even after we "detached" already.

We need to put the extra reference before we signal completion from the
completion handler, or the second drbd_md_sync_page_io() above may
trigger the assert (reference count still 2).

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
2012-05-09 15:15:52 +02:00
..
drbd_actlog.c drbd: Hold a reference to ldev while doing meta-data IO 2012-05-09 10:31:11 +02:00
drbd_bitmap.c drbd: change some GFP_KERNEL to GFP_NOIO 2012-05-09 15:10:47 +02:00
drbd_int.h drbd: Allow new IOs while the local disk in in FAILED state 2012-05-09 15:10:34 +02:00
drbd_main.c drbd: Derive sync-UUIDs only from the bitmap-uuid if it is non-zero 2012-05-09 15:15:50 +02:00
drbd_nl.c drbd: drbd_nl_resize(): Fix missing put_ldev() on error path 2012-05-09 15:15:49 +02:00
drbd_proc.c drbd: cosmetic: fix accidental division instead of modulo when pretty printing 2012-05-09 10:01:39 +02:00
drbd_receiver.c drbd: fix "stalled" empty resync 2012-05-09 15:15:47 +02:00
drbd_req.c drbd: Implemented the disk-timeout option 2012-05-09 15:10:45 +02: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: fix harmless race to not trigger an ASSERT 2012-05-09 15:15:52 +02: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