All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: [PATCH] dm: also check for conflicting table type in dm_table_set_type
Date: Fri, 21 May 2010 18:01:06 +0900	[thread overview]
Message-ID: <4BF64BD2.1090108@ct.jp.nec.com> (raw)
In-Reply-To: <20100520222625.GA19250@redhat.com>

Hi Mike,

On 05/21/2010 07:26 AM +0900, Mike Snitzer wrote:
> Factorize live table type compatibility check into
> dm_table_type_matches_live_table().  Catching a conflicting table type
> early, during table load, avoids failing during resume -- which always
> leaves the DM device suspended.
> 
> So also check type during dm_table_set_type() -- which happens as part
> of a table load.  But preserve the existing check during resume, in
> dm_swap_table(), because a racing table load could stage an inactive
> table that conflicts with the table type that dm_swap_table() is about
> to make live:

As you noted, the additional check in dm_table_set_type() is racy and
has no guarantee to detect problematic table loading in some cases.
Although I'm not sure such a duplicated racy check is really needed,
it will detect most cases and users may be happy with that.

So I have no objection, but at least, please put some comments that
it's racy in the code below.

> +finish:
> +	if (!dm_table_type_matches_live_table(t))
> +		return -EINVAL;
> +

Thanks,
Kiyoshi Ueda

      reply	other threads:[~2010-05-21  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 22:26 [PATCH] dm: also check for conflicting table type in dm_table_set_type Mike Snitzer
2010-05-21  9:01 ` Kiyoshi Ueda [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=4BF64BD2.1090108@ct.jp.nec.com \
    --to=k-ueda@ct.jp.nec.com \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@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.