public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io context: fix ref counting
@ 2009-07-31  5:28 Li Zefan
  2009-07-31  5:38 ` Nikanth Karthikesan
  2009-07-31  6:54 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Li Zefan @ 2009-07-31  5:28 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Nikanth Karthikesan, LKML

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] io context: fix ref counting
  2009-07-31  5:28 [PATCH] io context: fix ref counting Li Zefan
@ 2009-07-31  5:38 ` Nikanth Karthikesan
  2009-07-31  6:54 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Nikanth Karthikesan @ 2009-07-31  5:38 UTC (permalink / raw)
  To: Li Zefan; +Cc: Jens Axboe, LKML

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 <lizf@cn.fujitsu.com>

Acked-by: Nikanth Karthikesan <knikanth@suse.de>

Thanks
Nikanth

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] io context: fix ref counting
  2009-07-31  5:28 [PATCH] io context: fix ref counting Li Zefan
  2009-07-31  5:38 ` Nikanth Karthikesan
@ 2009-07-31  6:54 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2009-07-31  6:54 UTC (permalink / raw)
  To: Li Zefan; +Cc: Nikanth Karthikesan, LKML

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 <lizf@cn.fujitsu.com>
> ---
>  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-31  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-31  5:28 [PATCH] io context: fix ref counting Li Zefan
2009-07-31  5:38 ` Nikanth Karthikesan
2009-07-31  6:54 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox