* [PATCH] make vg_mark_partial_lvs more robust and export it
@ 2011-02-16 8:37 Petr Rockai
2011-02-16 8:57 ` Petr Rockai
[not found] ` <36088.72482223$1297846647@news.gmane.org>
0 siblings, 2 replies; 4+ messages in thread
From: Petr Rockai @ 2011-02-16 8:37 UTC (permalink / raw)
To: lvm-devel
Hi,
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.
This will be useful in a vgreduce --removemissing --force refactor
later.
The patch is simple and straightforward.
Yours,
Petr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vg-mark-partial.diff
Type: text/x-diff
Size: 2200 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20110216/6521ca64/attachment.bin>
-------------- next part --------------
--
id' Ash = Ash; id' Dust = Dust; id' _ = undefined
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] make vg_mark_partial_lvs more robust and export it
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>
1 sibling, 0 replies; 4+ messages in thread
From: Petr Rockai @ 2011-02-16 8:57 UTC (permalink / raw)
To: lvm-devel
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vg-mark-partial.diff
Type: text/x-diff
Size: 3607 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20110216/a3f0eefa/attachment.bin>
-------------- next part --------------
--
id' Ash = Ash; id' Dust = Dust; id' _ = undefined
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] make vg_mark_partial_lvs more robust and export it
[not found] ` <36088.72482223$1297846647@news.gmane.org>
@ 2011-02-16 14:42 ` Zdenek Kabelac
2011-03-19 22:41 ` Petr Rockai
0 siblings, 1 reply; 4+ messages in thread
From: Zdenek Kabelac @ 2011-02-16 14:42 UTC (permalink / raw)
To: lvm-devel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] make vg_mark_partial_lvs more robust and export it
2011-02-16 14:42 ` Zdenek Kabelac
@ 2011-03-19 22:41 ` Petr Rockai
0 siblings, 0 replies; 4+ messages in thread
From: Petr Rockai @ 2011-03-19 22:41 UTC (permalink / raw)
To: lvm-devel
Re,
I am attaching an updated patch (since the CVS went conflicting with the
last version). It still does a scan of the LVs for the clear, but you
obviously can't do any better without a major rework of the status flag
system (where the flags would be sets of LVs instead of bits in the
LVs). So we don't.
The patch applies to current CVS and passes tests. Please review (it is
very simple and prerequisite for other patches)...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vg-mark-partial.diff
Type: text/x-diff
Size: 3475 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20110319/209cc751/attachment.bin>
-------------- next part --------------
Yours,
Petr
--
id' Ash = Ash; id' Dust = Dust; id' _ = undefined
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-19 22:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-03-19 22:41 ` Petr Rockai
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.