public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: steve@chygwyn.com
Cc: Steven Whitehouse <swhiteho@redhat.com>,
	Gregory Haskins <ghaskins@novell.com>,
	linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: Re: [PATCH v4] slow-work: add (module*)work->ops->owner to fix races with module clients
Date: Tue, 30 Jun 2009 13:30:01 +0300	[thread overview]
Message-ID: <20090630103001.GA30065@redhat.com> (raw)
In-Reply-To: <20090630091832.GA14767@fogou.chygwyn.com>

On Tue, Jun 30, 2009 at 10:18:32AM +0100, steve@chygwyn.com wrote:
> Hi,
> 
> On Tue, Jun 30, 2009 at 12:07:15PM +0300, Michael S. Tsirkin wrote:
> > On Tue, Jun 30, 2009 at 09:43:03AM +0100, Steven Whitehouse wrote:
> > > Hi,
> > > 
> > > I'm happy to ACK this, but the race doesn't exist in GFS2's case because
> > > we wait for all work related to each GFS2 fs at umount time and the
> > > module unload cannot happen until all GFS2 fs are umounted,
> > > 
> > > Steve.
> > 
> > I wonder whether the following holds:
> > 
> > static void gfs2_recover_put_ref(struct slow_work *work)
> > {
> >         struct gfs2_jdesc *jd = container_of(work, struct gfs2_jdesc, jd_work);
> >         clear_bit(JDF_RECOVERY, &jd->jd_flags);
> >         smp_mb__after_clear_bit();
> >         wake_up_bit(&jd->jd_flags, JDF_RECOVERY);
> > 
> > <- umount can complete here?
> > 
> > }
> > 
> > 
> > If yes, .text of the module could go away between the point marked by <-
> > and return from gfs2_recover_put_ref.
> > 
> >
> Well in theory, yes. In reality I don't think it could ever happen

Right. IIUC, that's all Gregory's patch is trying to address: a
theoretical race condition.

-- 
MST

  reply	other threads:[~2009-06-30 10:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29 19:24 [PATCH v4] slow-work: add (module*)work->ops->owner to fix races with module clients Gregory Haskins
2009-06-29 19:30 ` Gregory Haskins
2009-06-30  8:43 ` Steven Whitehouse
2009-06-30  9:07   ` Michael S. Tsirkin
2009-06-30  9:18     ` steve
2009-06-30 10:30       ` Michael S. Tsirkin [this message]
2009-06-30 12:09         ` Gregory Haskins
2009-07-07 13:21 ` David Howells
2009-07-07 13:29   ` Gregory Haskins
2009-07-07 16:52     ` David Howells

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=20090630103001.GA30065@redhat.com \
    --to=mst@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=ghaskins@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steve@chygwyn.com \
    --cc=swhiteho@redhat.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