Linux LVM users
 help / color / mirror / Atom feed
From: Simon Green <s_green@bigpond.com>
To: linux-lvm@msede.com
Subject: [linux-lvm] Fixes for vgcreate bugs.
Date: Thu, 10 Feb 2000 21:12:00 +1100	[thread overview]
Message-ID: <38A28EF0.6D1C8570@bigpond.com> (raw)

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

                 reply	other threads:[~2000-02-10 10:12 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=38A28EF0.6D1C8570@bigpond.com \
    --to=s_green@bigpond.com \
    --cc=linux-lvm@msede.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox