2009-07-31 05:29:48

by Li Zefan

[permalink] [raw]
Subject: [PATCH] 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 <[email protected]>
---
include/linux/iocontext.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index dd05434..4da4a75 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;
}

--
1.6.3


2009-07-31 05:36:23

by Nikanth Karthikesan

[permalink] [raw]
Subject: Re: [PATCH] io context: fix ref counting

On Friday 31 July 2009 10:58:24 Li Zefan wrote:
> Commit d9c7d394a8ebacb60097b192939ae9f15235225e
> ("block: prevent possible io_context->refcount overflow") mistakenly
> changed atomic_inc(&ioc->nr_tasks) to atomic_long_inc(&ioc->refcount).
>

Ah! Sorry. :(

> Signed-off-by: Li Zefan <[email protected]>

Acked-by: Nikanth Karthikesan <[email protected]>

Thanks
Nikanth

2009-07-31 06:54:37

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] io context: fix ref counting

On Fri, Jul 31 2009, Li Zefan wrote:
> 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 <[email protected]>
> ---
> include/linux/iocontext.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
> index dd05434..4da4a75 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;
> }

Irk, good catch. Applied to immediate upstream branch.

--
Jens Axboe