Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbb4f264 authored by Li Zefan's avatar Li Zefan Committed by Jens Axboe
Browse files

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: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarNikanth Karthikesan <knikanth@suse.de>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 56ad1740
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
	 * a race).
	 */
	if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
		atomic_long_inc(&ioc->refcount);
		atomic_inc(&ioc->nr_tasks);
		return ioc;
	}