[Devel] [PATCH RHEL7 COMMIT] ploop: release io_context on ploop_thread() exit

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 12 03:18:57 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.8.5
------>
commit 0afd98ad8ecad1ae50ed3853c0a2ac68ae8aa835
Author: Maxim Patlasov <mpatlasov at virtuozzo.com>
Date:   Mon Oct 12 14:18:57 2015 +0400

    ploop: release io_context on ploop_thread() exit
    
    For ordinary processes ioc is released by do_exit(). Ploop must do it itself.
    
    https://jira.sw.ru/browse/PSBM-39956
    
    Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
    Acked-by: Dmitry Monakhov <dmonakhov at virtuozzo.com>
---
 block/blk-ioc.c           | 1 +
 drivers/block/ploop/dev.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 74491d4..ea60551 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -218,6 +218,7 @@ void exit_io_context(struct task_struct *task)
 	atomic_dec(&ioc->nr_tasks);
 	put_io_context_active(ioc);
 }
+EXPORT_SYMBOL(exit_io_context);
 
 /**
  * ioc_clear_queue - break any ioc association with the specified queue
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 7eb9865..bad539a 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2784,6 +2784,9 @@ wait_more:
 	spin_unlock_irq(&plo->lock);
 	blk_finish_plug(&plug);
 
+	if (current->io_context)
+		exit_io_context(current);
+
 	return 0;
 }
 



More information about the Devel mailing list