All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 1/3] lvm2app: Implementation of pv resize (v4)
Date: Tue, 08 Jan 2013 11:37:09 +0100	[thread overview]
Message-ID: <50EBF6D5.200@redhat.com> (raw)
In-Reply-To: <1357592534-14672-1-git-send-email-tasleson@redhat.com>

Dne 7.1.2013 22:02, Tony Asleson napsal(a):
> Patch correctly checks for update lock before allowing
> resize to process and also requires lvm_vg_write to
> make changes persistent.  As the API does not allow the
> re-size of a orphaned pv this is accomplished through
> the existing vg_write, vg_commit sequence which is done
> in lvm_vg_write.
>
> Signed-off-by: Tony Asleson <tasleson@redhat.com>
> ---
>   lib/metadata/metadata-exported.h |  8 +++++--
>   lib/metadata/pv_manip.c          | 48 +++++++++++++++++++++++++++++++++++++++-
>   liblvm/lvm2app.h                 |  5 +++--
>   liblvm/lvm_pv.c                  | 21 ++++++++++++++----
>   tools/pvresize.c                 | 26 +---------------------
>   5 files changed, 74 insertions(+), 34 deletions(-)
>
> diff --git a/tools/pvresize.c b/tools/pvresize.c
> index 2f0693a..abf8432 100644
> --- a/tools/pvresize.c
> +++ b/tools/pvresize.c
> @@ -30,7 +30,6 @@ static int _pv_resize_single(struct cmd_context *cmd,
>   			     const uint64_t new_size)
>   {
>   	struct pv_list *pvl;
> -	uint64_t size = 0;
>   	int r = 0;
>   	const char *pv_name = pv_dev_name(pv);
>   	const char *vg_name = pv_vg_name(pv);
> @@ -70,33 +69,10 @@ static int _pv_resize_single(struct cmd_context *cmd,
>   			goto out;
>   	}
>
> -	if (!(pv->fmt->features & FMT_RESIZE_PV)) {
> -		log_error("Physical volume %s format does not support resizing.",
> -			  pv_name);
> -		goto out;
> -	}
> -
> -	/* Get new size */
> -	if (!dev_get_size(pv_dev(pv), &size)) {
> -		log_error("%s: Couldn't get size.", pv_name);
> +	if( !pv_resize(cmd, vg, pv, new_size)) {
>   		goto out;
>   	}
>

To get nicer backtrace logging -  goto_out;

Zdenek




  parent reply	other threads:[~2013-01-08 10:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 21:02 [PATCH 1/3] lvm2app: Implementation of pv resize (v4) Tony Asleson
2013-01-07 21:02 ` [PATCH 2/3] lvm2app: Implementation of lv resize (v1) Tony Asleson
2013-01-08 10:44   ` Zdenek Kabelac
2013-01-09  6:25     ` Tony Asleson
2013-01-07 21:02 ` [PATCH 3/3] python-lvm: Add ability to disable vg auto write (v1) Tony Asleson
2013-01-08 10:37 ` Zdenek Kabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-04 22:51 [PATCH 1/3] lvm2app: Implementation of pv resize (v4) Tony Asleson

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=50EBF6D5.200@redhat.com \
    --to=zkabelac@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.