* [linux-lvm] Fixes for vgcreate bugs.
@ 2000-02-10 10:12 Simon Green
0 siblings, 0 replies; only message in thread
From: Simon Green @ 2000-02-10 10:12 UTC (permalink / raw)
To: linux-lvm
Hi,
I just joined this list, so forgive me if I say something which has
already been said. The latest 0.8i vgcreate has a bug in it where the
first volume group created will cause a seg. fault if the /etc/lvmtab
file is 1 byte long, as it is after a vgscan has been run. I note
several comments in the changelog about this being fixed, but it still
happened to me every time I tried it. Once at least one volume group has
been created, vgcreate is fine.
The work-around is to create a 0-byte /etc/lvmtab. Vgcreate will then
give an error, but a vgscan will recover the volume group. The fix (as
far as I can see) is as follows.
In the files:
****************** lvm_tab_vg_insert.c
lvm_tab_vg_insert_end:
if ( vg_name_ptr != NULL) free ( vg_name_ptr);
if ( vg_name_ptr_sav != NULL) free ( vg_name_ptr_sav);
if ( data != NULL) free ( data);
BECOMES
lvm_tab_vg_insert_end:
if ( vg_name_ptr != NULL) free ( vg_name_ptr);
if ( vg_name_ptr_sav != NULL) free ( vg_name_ptr_sav);
if ( data != NULL) {
free ( data);
data = NULL;
}
*******************lvm_tab_vg_check_exist.c
if ( i >= size || size < 2) ret = FALSE;
free ( data);
BECOMES
if ( i >= size || size < 2) ret = FALSE;
free ( data);
data = NULL;
Basically, in lvm_tab_vg_check_exist_all_vg.c, there is a if (data !=
NULL) {free(data); data = NULL;} statement. When "data" is freed in one
of the other two functions above, it is not reset to NULL, leading to an
attempt to free it a second time, which causes the seg. fault. I can
send in the diffs tomorrow if anyone's interested.
Please cc any replies to greencs@logica.com.
Cheers
Simon
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-02-10 10:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-10 10:12 [linux-lvm] Fixes for vgcreate bugs Simon Green
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.