]> sourceware.org Git - lvm2.git/commit
Fix vg_read() error paths to properly release upon vg_read_error().
authorDave Wysochanski <dwysocha@redhat.com>
Tue, 7 Jul 2009 01:18:35 +0000 (01:18 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Tue, 7 Jul 2009 01:18:35 +0000 (01:18 +0000)
commit836326f31e8533ac2f29d052399899a47249110a
tree6d99fc33213f1a7abe0971674d3073b543e52525
parent34fe80f9d952c1847e54815d2b6001539ad15599
Fix vg_read() error paths to properly release upon vg_read_error().

Fix vg_read() error paths to properly release upon vg_read_error().
Note that in the iterator paths (process_each_*()), we release
inside the iterator so no individual cleanup is needed.  However there
are a number of other places we missed the cleanup.  Proper cleanup
when vg_read_error() is true should be calling vg_release(vg), since
there should be no locks held if we get an error (except in certain
special cases, which IMO we should work to remove from the code).

Unfortunately the testsuite is unable to detect these types of memory
leaks.  Most of them can be easily seen if you try an operation
(e.g. lvcreate) with a volume group that does not exist.  Error
message looks like this:
  Volume group "vg2" not found
  You have a memory leak (not released memory pool):
   [0x1975eb8]
  You have a memory leak (not released memory pool):
   [0x1975eb8]

Author: Dave Wysochanski <dwysocha@redhat.com>
12 files changed:
tools/lvcreate.c
tools/lvrename.c
tools/lvresize.c
tools/polldaemon.c
tools/pvchange.c
tools/pvmove.c
tools/pvresize.c
tools/toollib.c
tools/vgextend.c
tools/vgmerge.c
tools/vgrename.c
tools/vgsplit.c
This page took 0.043714 seconds and 5 git commands to generate.