All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: lvm-devel@redhat.com
Subject: [PATCH] make vg_mark_partial_lvs more robust and export it
Date: Wed, 16 Feb 2011 15:42:00 +0100	[thread overview]
Message-ID: <4D5BE238.9070806@redhat.com> (raw)
In-Reply-To: <36088.72482223$1297846647@news.gmane.org>

Dne 16.2.2011 09:57, Petr Rockai napsal(a):
> Hey again,
> 
> Petr Rockai <prockai@redhat.com> writes:
>> > the following patch makes vg_mark_partial_lvs also clear existing
>> > PARTIAL_LV flags, so it can be issued repeatedly on the same VG, keeping
>> > the PARTIAL_LV flags up to date.
>> >
>> > The patch is simple and straightforward.
> scratch that. It introduces a bug nevertheless. Attaching a fixed
> version.
> 
> 
> 
> vg-mark-partial.diff
> 
> 
> -int vg_mark_partial_lvs(struct volume_group *vg)
> +int vg_mark_partial_lvs(struct volume_group *vg, int clear)
>  {
> -	struct logical_volume *lv;
>  	struct lv_list *lvl;
>  
> -	dm_list_iterate_items(lvl, &vg->lvs) {
> -		lv = lvl->lv;
> -		if (!_lv_mark_if_partial(lv))
> +	if (clear)
> +		dm_list_iterate_items(lvl, &vg->lvs)
> +			lvl->lv->status &= ~PARTIAL_LV;
> +
> +	dm_list_iterate_items(lvl, &vg->lvs)
> +		if (!_lv_mark_if_partial(lvl->lv))
>  			return_0;
> -	}
> +
>  	return 1;

Probably nothing against the patch itself - but maybe we can we find a better
solution for this list scanning?

We are often going through the whole list to find the information we could
comfortable store in other places - like list of partial lvs maybe,
or we may already know there is not partial LV in the whole VG (vg flag ?)

This kind of code adds O(n) complexity for lots of operations.
(When you have 10000LVs it has some measurable impact).

I think similar is the 'unknown' segment which requires full scan.

Zdenek



  parent reply	other threads:[~2011-02-16 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16  8:37 [PATCH] make vg_mark_partial_lvs more robust and export it Petr Rockai
2011-02-16  8:57 ` Petr Rockai
     [not found] ` <36088.72482223$1297846647@news.gmane.org>
2011-02-16 14:42   ` Zdenek Kabelac [this message]
2011-03-19 22:41     ` Petr Rockai

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=4D5BE238.9070806@redhat.com \
    --to=zdenek.kabelac@gmail.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.