]> git.baikalelectronics.ru Git - kernel.git/commit
drbd: make sure disk cleanup happens in worker context
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 11 Feb 2014 08:30:49 +0000 (09:30 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 10 Jul 2014 16:34:55 +0000 (18:34 +0200)
commit0fcabab313f9ed6ab1dbb886d3b36cc4df7740b1
tree00b88836a6eda4beeaea106f50fd423fc02d4043
parentc4befc04f35b7e6d461a4becd5b137cc31933aad
drbd: make sure disk cleanup happens in worker context

The recent fix to put_ldev() (correct ordering of access to local_cnt
and state.disk; memory barrier in __drbd_set_state) guarantees
that the cleanup happens exactly once.

However it does not yet guarantee that the cleanup happens from worker
context, the last put_ldev() may still happen from atomic context,
which must not happen: blkdev_put() may sleep.

Fix this by scheduling the cleanup to the worker instead,
using a couple more bits in device->flags and a new helper,
drbd_device_post_work().

Generalized the "resync progress" work to cover these new work bits.

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