]> sourceware.org Git - lvm2.git/commit
Move increment of vg->pv_count from import_pool_vg() to import_pool_pvs().
authorDave Wysochanski <dwysocha@redhat.com>
Tue, 13 Apr 2010 17:25:26 +0000 (17:25 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Tue, 13 Apr 2010 17:25:26 +0000 (17:25 +0000)
commita6a494150427c23e09b594be5c7268325a99122a
tree3ec5843382450be63a61de49d563c79582854ef8
parentf6644ff8fe53208455a8b845796dde96f3aee870
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>
lib/format_pool/import_export.c
This page took 0.094669 seconds and 5 git commands to generate.