public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: wysochanski@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/format_pool import_export.c Date: Tue, 13 Apr 2010 17:25:00 -0000 [thread overview] Message-ID: <20100413172526.10599.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-04-13 17:25:26 Modified files: lib/format_pool: import_export.c Log message: Move increment of vg->pv_count from import_pool_vg() to import_pool_pvs(). Move the increment of vg->pv_count next to the place where we add to vg->pvs. It looks safe to do this since the only caller of import_pool_vg() calls import_pool_pvs() immediately afterward, and there is no way import_pool_vg() can fail (always returns 1). However, if there's a memory allocation failure inside import_pool_pvs(), we will end up with a different count in vg->pv_count that with the original code. In any case, vg->pv_count should be as close to dm_list_size(&vg->pvs) as possible, as is the case everywhere else in the code. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31 --- LVM2/lib/format_pool/import_export.c 2010/04/13 17:25:13 1.30 +++ LVM2/lib/format_pool/import_export.c 2010/04/13 17:25:26 1.31 @@ -37,7 +37,6 @@ ((pl->pd.pl_blocks) / POOL_PE_SIZE); vg->free_count = vg->extent_count; - vg->pv_count++; if (vg->name) continue; @@ -120,6 +119,7 @@ pl->pv = pvl->pv; pvl->mdas = NULL; pvl->pe_ranges = NULL; + vg->pv_count++; dm_list_add(&vg->pvs, &pvl->list); }
reply other threads:[~2010-04-13 17:25 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20100413172526.10599.qmail@sourceware.org \ --to=wysochanski@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).