public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@kvack.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Kent Overstreet <kmo@daterainc.com>,
	axboe@kernel.dk, Andrew Morton <akpm@linux-foundation.org>,
	torvalds@linux-foundation.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-aio@kvack.org, trinity@vger.kernel.org
Subject: Re: [PATCH aio-next] aio: fix error handling and rcu usage in "convert the ioctx list to table lookup v3"
Date: Tue, 6 Aug 2013 20:52:04 -0400	[thread overview]
Message-ID: <20130807005204.GF8043@kvack.org> (raw)
In-Reply-To: <5201714C.8000100@oracle.com>

On Tue, Aug 06, 2013 at 05:57:32PM -0400, Sasha Levin wrote:
> Old error is gone, but now seeing this, which seems related.
> 
>         ctx = table->table[id];
>         if (ctx->user_id == ctx_id) { <--- here
>                 percpu_ref_get(&ctx->users);
>                 ret = ctx;
>         }
...

Why am I not surprised.  That should be fixed with the patch below.  I'll 
post some patches for the libaio test suite tomorrow to check these cases 
explicitly and scan for any others that need to be added.  Thanks again, 
Sasha.

		-ben
-- 
"Thought is the essence of where you are now."

diff --git a/fs/aio.c b/fs/aio.c
index 3bc068c..c3f005d 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -812,7 +812,7 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id)
 		goto out;
 
 	ctx = table->table[id];
-	if (ctx->user_id == ctx_id) {
+	if (ctx && ctx->user_id == ctx_id) {
 		percpu_ref_get(&ctx->users);
 		ret = ctx;
 	}

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

      reply	other threads:[~2013-08-07  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 13:57 aio: kernel BUG at fs/aio.c:646! Sasha Levin
2013-08-05 16:08 ` Benjamin LaHaise
2013-08-05 17:20   ` [PATCH aio-next] aio: fix error handling and rcu usage in "convert the ioctx list to table lookup v3" Benjamin LaHaise
2013-08-06 21:57     ` Sasha Levin
2013-08-07  0:52       ` Benjamin LaHaise [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130807005204.GF8043@kvack.org \
    --to=bcrl@kvack.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=kmo@daterainc.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=torvalds@linux-foundation.org \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox