linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: xiaowei <xiaowei.hu@oracle.com>
To: linux-lvm@redhat.com, zkabelac@redhat.com
Cc: Joe Jin <joe.jin@oracle.com>
Subject: [linux-lvm] Segmentation fault in LVM2 latest version.
Date: Tue, 11 Mar 2014 16:34:38 +0800	[thread overview]
Message-ID: <531ECA9E.6080602@oracle.com> (raw)

Hi all,

I can reproduce one segmentation fault in 
lvm2(lvm2-2.02.100-8.el6.x86_64) with below steps:

1. create PV,VG with 9 disk, 4GB each:
     pvcreate /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg 
/dev/sdh /dev/sdi /dev/sdj
     vgcreate vgmlpap /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf 
/dev/sdg /dev/sdh /dev/sdi /dev/sdj
2.create a LV , say 2G initial, 6 strips.
    lvcreate -L 2G -n lvpap007 -i 6 -I 128k vgmlpap
3.extend this LV several times with 1 strip:
    lvextend -L +600M -i 1 /dev/mapper/vgmlpap-lvpap007   (repeat this 
several times)
4.segmentation fault appear when the first physical volume can't meet 
the required extends.


I tracked this a little more, and found that it's due to the strip 1 
parameter and when the first PV leaves no enough extends, it need 2 area 
to do the space allocation, but the area number was not extend , so when 
it try to access the aa array in function _alloc_parallel_area of file 
lib/metadata/lv_manip.c with a non exist index it segment fault! This lines:

                 aa[s].len = (ah->alloc_and_split_meta) ? len - 
ah->log_len : len;
                 /* Skip empty allocations */
                 if (!aa[s].len)
                         continue;

                 aa[s].pv = pva->map->pv;
                 aa[s].pe = pva->start;

I am not an expert of LVM code , could you please give a quick fix of  
this? It should be not hard:)


Please reply me with my email , I am not in the mail list.

Thanks,
Xiaowei

             reply	other threads:[~2014-03-11  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11  8:34 xiaowei [this message]
2014-03-12 15:58 ` [linux-lvm] Segmentation fault in LVM2 latest version Alasdair G Kergon
2014-03-14  1:05   ` xiaowei
2014-03-18  4:04     ` Alasdair G Kergon
2014-04-11  1:14       ` xiaowei
2014-04-15 14:43         ` Alasdair G Kergon
2014-04-17  7:47           ` xiaowei

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=531ECA9E.6080602@oracle.com \
    --to=xiaowei.hu@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=linux-lvm@redhat.com \
    --cc=zkabelac@redhat.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;
as well as URLs for NNTP newsgroup(s).