[Devel] [PATCH rh7 2/2] ploop: push_backup: implement auto destroy

Maxim Patlasov mpatlasov at virtuozzo.com
Tue May 10 16:15:52 PDT 2016


If userspace backup tool dies unexpectedly (or killed intentionally),
ploop catches that last reference to /dev/ploop has gone, aborts
push_backup, and releases associated resorces (pbd and friends).

https://jira.sw.ru/browse/PSBM-45000

Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 drivers/block/ploop/dev.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index a560734..c4d2bc1 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2869,6 +2869,7 @@ static void ploop_release(struct gendisk *disk, fmode_t fmode)
 
 	mutex_lock(&plo->ctl_mutex);
 	if (atomic_dec_and_test(&plo->open_count)) {
+		ploop_pb_destroy(plo, NULL);
 		ploop_tracker_stop(plo, 1);
 		plo->bdev = NULL;
 	}



More information about the Devel mailing list