Skip to content

Commit

Permalink
io context: fix ref counting
Browse files Browse the repository at this point in the history
Commit d9c7d39
("block: prevent possible io_context->refcount overflow") mistakenly
changed atomic_inc(&ioc->nr_tasks) to atomic_long_inc(&ioc->refcount).

Signed-off-by: Li Zefan <[email protected]>
Acked-by: Nikanth Karthikesan <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Li Zefan authored and Jens Axboe committed Jul 31, 2009
1 parent 56ad174 commit cbb4f26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/iocontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cbb4f26

Please sign in to comment.