[RHEL8,COMMIT] ploop: Cancel backup timer before target destruction

Submitted by Konstantin Khorenko on Oct. 18, 2019, 11:36 a.m.

Details

Message ID 201910181136.x9IBauHo020452@finist_el8beta.work.ct
State New
Series "ploop: Cancel backup timer before target destruction"
Headers show

Commit Message

Konstantin Khorenko Oct. 18, 2019, 11:36 a.m.
The commit is pushed to "branch-rh8-4.18.0-80.1.2.vz8.2.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-80.1.2.vz8.2.2
------>
commit 3dfab2aa292da8c101167ba2c3165ea4211796da
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Oct 18 14:36:56 2019 +0300

    ploop: Cancel backup timer before target destruction
    
    ... and also queue delayed bios back. Otherwise, it fires
    after memory is freed.
    
    Fixes: 398e0c85e871 ("dm: Interpreter of ploop1 format (ploop driver)")
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/md/dm-ploop-target.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 69c215e1bc66..a5abcac11c14 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -46,8 +46,10 @@  static void ploop_destroy(struct ploop *ploop)
 {
 	int i;
 
-	if (ploop->pb)
+	if (ploop->pb) {
+		cleanup_backup(ploop);
 		ploop_free_pb(ploop->pb);
+	}
 	if (ploop->wq) {
 		ploop_flush_workqueue(ploop);
 		destroy_workqueue(ploop->wq);