All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takahiro Yasui <tyasui@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 10 of 10] LVM: rework lvconvert_mirrors
Date: Mon, 08 Mar 2010 00:33:31 -0500	[thread overview]
Message-ID: <4B948C2B.6030702@redhat.com> (raw)
In-Reply-To: <201003052359.o25Nxeg5012728@hydrogen.msp.redhat.com>

Jonathan Brassow wrote:
> +static int _lvconvert_mirrors_parse_params(struct cmd_context *cmd,
> +					   struct logical_volume *lv,
> +					   struct lvconvert_params *lp,
> +					   uint32_t *old_mimage_count,
> +					   uint32_t *old_log_count,
> +					   uint32_t *new_mimage_count,
> +					   uint32_t *new_log_count)
> +{
...
> +
> +	/*
> +	 * Adjust log type
> +	 */
> +	*new_log_count = *old_log_count;
> +	if (!arg_count(cmd, corelog_ARG) && !arg_count(cmd, mirrorlog_ARG))
> +		return 1;
> +
> +	if (arg_count(cmd, corelog_ARG))
> +		*new_log_count = 0;
> +
> +	mirrorlog = arg_str_value(cmd, mirrorlog_ARG,
> +				  !*new_log_count ? "core" : DEFAULT_MIRRORLOG);
> +
> +	if (strcmp("core", mirrorlog) && !*new_log_count) {
> +		log_error("--mirrorlog and --corelog are incompatible");
> +		return 0;
> +	}

This check should be done after *new_log_count is properly set. At this point,
*new_log_count hasn't been set yet and *new_log_count could be "0" even if
the new log type is "disk" or "mirrored."

> +	if (!strcmp("mirrored", mirrorlog))
> +		*new_log_count = 2;
> +	else if (!strcmp("disk", mirrorlog))
> +		*new_log_count = 1;
> +	else if (!strcmp("core", mirrorlog))
> +		*new_log_count = 0;
> +	else {
> +		log_error("Unknown mirrorlog type: %s", mirrorlog);
> +		return 0;
> +	}

        *** I think the above check should here ***

You can reproduce this by converting a "core" log to a "disk" or "mirrored"
log.

Thanks,
Taka




  reply	other threads:[~2010-03-08  5:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 23:59 [PATCH 10 of 10] LVM: rework lvconvert_mirrors Jonathan Brassow
2010-03-08  5:33 ` Takahiro Yasui [this message]
2010-03-08  5:54 ` [PATCH 10 of 10] LVM: rework lvconvert_mirrorsuil Takahiro Yasui

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=4B948C2B.6030702@redhat.com \
    --to=tyasui@redhat.com \
    --cc=lvm-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.