All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH v4 1/2] dm: prevent table type changes after initial table load
Date: Tue, 29 Jun 2010 11:07:21 -0400	[thread overview]
Message-ID: <20100629150721.GC29894@redhat.com> (raw)
In-Reply-To: <20100629141920.GF23989@agk-dp.fab.redhat.com>

On Tue, Jun 29 2010 at 10:19am -0400,
Alasdair G Kergon <agk@redhat.com> wrote:

> On Tue, Jun 29, 2010 at 09:52:17AM -0400, Mike Snitzer wrote:
> > As we talked about on irc.  There is potential for do_resume() to
> > destage the "inactive" table slot, in the process of making the table
> > "live", and in parallel another table load can arrive to stage another
> > "inactive" table (which can have a conflicting type).  
> 
> But the type already got set earlier and, once set, is an immutable table
> property.  There cannot be conflicts with do_resume - it doesn't touch
> this.

Yes, do_resume doesn't operate with any concern for md->type or
md->queue changing because table_load safely sets these immutable
properties.

That safety comes at the expense of protecting a critical section in
table_load.  And that protection must span the access to both md->type
and md->queue.

Would you rather I ignore do_resume entirely?  I'm not understanding why
you keep going back to this notion that do_resume doesn't matter.  The
only reason it doesn't matter is because table_load takes care to make
it that way.

Without appropriate table_load serialization do_resume would be prone to
the races I explained above.  That's all I've been trying to convey.

Mike

  reply	other threads:[~2010-06-29 15:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 12:47 [PATCH v4 0/2] dm: restrict conflicting table loads and improve queue initialization Mike Snitzer
2010-05-27 12:47 ` [PATCH v4 1/2] dm: prevent table type changes after initial table load Mike Snitzer
2010-06-29 11:40   ` Alasdair G Kergon
2010-06-29 13:52     ` Mike Snitzer
2010-06-29 14:19       ` Alasdair G Kergon
2010-06-29 15:07         ` Mike Snitzer [this message]
2010-05-27 12:47 ` [PATCH v4 2/2 "v11"] dm: only initialize full request_queue for request-based device Mike Snitzer
2010-06-04 20:15   ` [PATCH 3/2] dm: table load must always try dm_setup_md_queue Mike Snitzer
2010-06-09  5:38     ` Kiyoshi Ueda
2010-06-09  8:53       ` Mike Snitzer
2010-06-10  2:54         ` Kiyoshi Ueda

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=20100629150721.GC29894@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.