[lvm-devel] Re: [PATCH]: unify logical volume structure initialization

Alasdair G Kergon agk at redhat.com
Mon Sep 28 18:17:06 UTC 2009


> > Already initialised AFAICT.
> No, it isn't ... if you look up at this function (import_pool_lvs), 
> there's: lv = dm_pool_zalloc(mem, sizeof(*lv)
 
After applying the patch I got 2 x lv_init() on the same lv and so I
removed the second one.  The pool code began as a copy of the format1 code
so I'm not sure how the duplicate initialisation crept in.

> The requirement is this: there must be a central point where the lv 
> entries are initialized. So that if someone adds new entries, he writes 
> the initialization only in one place. If you want to unify allocation and 
> initialization, it is possible, just do it (but it requires somehow bigger 
> code change than this patch).
 
Indeed - that's what lv_create_empty() was meant to be (and what new code
should be trying to use).

Alasdair




More information about the lvm-devel mailing list