mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Zach Brown <zach.brown@oracle.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>,
	linux-kernel@vger.kernel.org, linux-aio@kvack.org,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [RFC][PATCH] Fix lock inversion aio_kick_handler()
Date: Thu, 09 Nov 2006 17:41:47 -0500	[thread overview]
Message-ID: <x49velokztg.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <44CAC1AF.6010505@oracle.com>

==> On Fri, 28 Jul 2006 19:02:23 -0700, Zach Brown <zach.brown@oracle.com> said:

Zach> Benjamin LaHaise wrote:
Zach> > On Fri, Jul 28, 2006 at 05:10:32PM -0700, Zach Brown wrote:
Zach> >> Fix lock inversion aio_kick_handler()
Zach> > 
Zach> > Doh.  Unfortunately, this patch isn't entirely correct as it
Zach> could race with > __put_ioctx() which sets ioctx->mm = NULL.

Zach> Aha, yeah, that's what I was missing.  Thanks.

Zach> > Something like the following should do the trick:

Zach> Cool, I'll respin and send it out.

Did you ever resend this patch, Zach?  It doesn't appear to be in
current kernels.  I'm still running into the lockdep warnings.

-Jeff

--- linux-2.6.19-rc5-mm1/fs/aio.c.orig	2006-11-09 17:28:43.000000000 -0500
+++ linux-2.6.19-rc5-mm1/fs/aio.c	2006-11-09 17:29:29.000000000 -0500
@@ -864,13 +864,15 @@ static void aio_kick_handler(void *data)
 	struct kioctx *ctx = data;
 	mm_segment_t oldfs = get_fs();
 	int requeue;
+	struct mm_struct *mm;
 
 	set_fs(USER_DS);
 	use_mm(ctx->mm);
 	spin_lock_irq(&ctx->ctx_lock);
 	requeue =__aio_run_iocbs(ctx);
- 	unuse_mm(ctx->mm);
+	mm = ctx->mm;
 	spin_unlock_irq(&ctx->ctx_lock);
+ 	unuse_mm(mm);
 	set_fs(oldfs);
 	/*
 	 * we're in a worker thread already, don't use queue_delayed_work,

  reply	other threads:[~2006-11-09 22:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-29  0:10 Zach Brown
2006-07-29  1:34 ` Benjamin LaHaise
2006-07-29  2:02   ` Zach Brown
2006-11-09 22:41     ` Jeff Moyer [this message]
2006-11-09 22:51       ` Zach Brown
2006-11-09 22:57         ` Jeff Moyer

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=x49velokztg.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=arjan@infradead.org \
    --cc=bcrl@kvack.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zach.brown@oracle.com \
    /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

all inboxes | Powered by JetHome®