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

Maxim Patlasov mpatlasov at virtuozzo.com
Thu Oct 8 17:30:51 PDT 2015


For ordinary processes ioc is released by do_exit(). Ploop must do it itself.

https://jira.sw.ru/browse/PSBM-39956
---
 block/blk-ioc.c           |    1 +
 drivers/block/ploop/dev.c |    3 +++
 2 files changed, 4 insertions(+)
-------------- next part --------------
For ordinary processes ioc is released by do_exit(). Ploop must do it itself.

https://jira.sw.ru/browse/PSBM-39956
---
 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