summaryrefslogtreecommitdiff
path: root/include/linux/iocontext.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-07-31 08:55:48 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-07-31 08:55:48 +0200
commitcbb4f2646d77b536ed2b1500ef6641083228ed8f (patch)
treee238098c2239ca1a2ec978858f63566d0281d49a /include/linux/iocontext.h
parent56ad1740d9a8dc271e71fee234be662638c64458 (diff)
downloadlwn-cbb4f2646d77b536ed2b1500ef6641083228ed8f.tar.gz
lwn-cbb4f2646d77b536ed2b1500ef6641083228ed8f.zip
io context: fix ref counting
Commit d9c7d394a8ebacb60097b192939ae9f15235225e ("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 <lizf@cn.fujitsu.com> Acked-by: Nikanth Karthikesan <knikanth@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/iocontext.h')
-rw-r--r--include/linux/iocontext.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index dd05434fa45f..4da4a75c3f1e 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -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;
}