提交 cbb4f264 编写于 作者: L Li Zefan 提交者: Jens Axboe

io context: fix ref counting

Commit d9c7d394
("block: prevent possible io_context->refcount overflow") mistakenly
changed atomic_inc(&ioc->nr_tasks) to atomic_long_inc(&ioc->refcount).
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
Acked-by: NNikanth Karthikesan <knikanth@suse.de>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 56ad1740
...@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc) ...@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
* a race). * a race).
*/ */
if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
atomic_long_inc(&ioc->refcount); atomic_inc(&ioc->nr_tasks);
return ioc; return ioc;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册