All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 3/4] Use allog_vg for _free_vg in _pvsegs_sub_single
Date: Tue, 08 Mar 2011 23:30:16 +0100	[thread overview]
Message-ID: <4D76ADF8.1090901@redhat.com> (raw)
In-Reply-To: <20110308170931.GH10767@agk-dp.fab.redhat.com>

Dne 8.3.2011 18:09, Alasdair G Kergon napsal(a):
> On Wed, Mar 02, 2011 at 07:20:25PM +0100, Zdenek Kabelac wrote:
>> Switch to use alloc_vg function for allocation of VG struct.
>  
> This code looks wrong.  Maybe it suffered from some previous global change.
> 
>> -	struct volume_group _free_vg = {
>> -		.cmd = cmd,
>> -		.name = "",
>> -	};
> 
> I think that should stay as it is.

Peter already spend quite some time debuging bug in missing initialization (he
was not using this patchset in his code) of some VG list structure - because
there were 5 copies of VG alloc code and some of them were not all properly
setting all values to some defined state.

> 
>> -        if (!(_free_vg.vgmem = dm_pool_create("_free_vg", 10240)))
>> -		return ECMD_FAILED;
> 
> Why is vgmem being allocated?  If something really is using it, why?

I've in my tree already slightly better patch which allocates and free
_free_vg only if '!vg'.


The major purpose if the patch is to keep also reference count setting in one
place (needed in my vg sharing patch) - also whenever someone adds any new
member to VG structure - only one place needs to be updated for proper
initialization.  So I'd still prefer to have this code running through
standard allocation procedure.

Zdenek



  reply	other threads:[~2011-03-08 22:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 18:20 [PATCH 0/4] Alloc VG Zdenek Kabelac
2011-03-02 18:20 ` [PATCH 1/4] Refactor vg allocation code Zdenek Kabelac
2011-03-02 18:20 ` [PATCH 2/4] Use alloc_vg for _pool_vg_read Zdenek Kabelac
2011-03-02 18:20 ` [PATCH 3/4] Use allog_vg for _free_vg in _pvsegs_sub_single Zdenek Kabelac
2011-03-08 17:09   ` Alasdair G Kergon
2011-03-08 22:30     ` Zdenek Kabelac [this message]
2011-03-09  3:01       ` Alasdair G Kergon
2011-03-09  8:51         ` Zdenek Kabelac
2011-03-02 18:20 ` [PATCH 4/4] Use alloc_vg for forma1_vg_read Zdenek Kabelac

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=4D76ADF8.1090901@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.