[linux-lvm] Segmentation fault in LVM2 latest version.

Alasdair G Kergon agk at redhat.com
Tue Mar 18 04:04:02 UTC 2014

On Fri, Mar 14, 2014 at 09:05:09AM +0800, xiaowei wrote:
> That's great you reproduced this bug:)

> So the fix could be easy?

No.  Once you know what's wrong, you can find several more classes
of lvextend that misbehave.

I do have a prototype fix that deals with the case you hit, but it's not
complete yet.

There are two ways you can extend an LV: 
  1. By pairing up newly-allocated areas of disk with existing ones 
     as you go along.
     (A simple example would be extending each existing stripe on the same
  2. By finding possible areas of disk to fit the required
     number of areas then selecting the most appropriate ones.
     (The general case.)
You can also have a combination of the two, with some areas from 1
and some from 2.

The first is 'PREFERRED' in the code, and the second is 'USE_AREA'.
The path through the code that you hit tried to use the first
method when it should have used the second.
(If the number of stripes is changing there's no trivial way to 
'pair up' the new areas with the existing ones.)
Minor structural changes are needed (code clean up) so that the
cling policy can sometimes use the second method.
The default 'allocation/maximise_cling' option fails.


More information about the linux-lvm mailing list