Bug 1459566

Summary: Upconverting linear to RAID1 does not work with older kernels anymore (tested with dm-raid v1.7.0)
Product: [Community] LVM and device-mapper Reporter: Marian Csontos <mcsontos>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: medium CC: agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: 2.02.172Keywords: Triaged
Target Milestone: ---Flags: rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-07 15:30:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marian Csontos 2017-06-07 13:12:18 UTC
Commit acaf3a5d47fd65b2e385a516544f8e6ec8d89b2d caused a regression with older kernels.

https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=acaf3a5d47fd65b2e385a516544f8e6ec8d89b2d

Description of problem:

With this change applied, older kernels (7.2, RHEL6.x, F21) upconverting linear to RAID1 now fails:

#lvchange-raid.sh:132+ lvconvert -y --type raid1 -m 1 @PREFIX@vg/LV1 /dev/mapper/@PREFIX@pv2
device-mapper: raid: Device 1 specified for rebuild: Clearing superblock
device-mapper: raid: 'rebuild' devices cannot be injected into an array with other first-time devices
device-mapper: table: 253:10: raid: Unable to assemble array: Invalid superblocks
device-mapper: ioctl: error adding target to table
device-mapper: reload ioctl on  (253:10) failed: Invalid argument
  Failed to lock logical volume @PREFIX@vg/LV1.

Version-Release number of selected component (if applicable):
upstream LVM2 (future 2.02.172 release)
dm-raid v1.7.0

How reproducible:
100%

Steps to Reproduce:
1. lvcreate -n LV -L 100M VG
2. lvconvert -y -m 1 --type raid1 VG/LV

Comment 1 Jonathan Earl Brassow 2018-04-04 20:18:27 UTC
It is ok if it says "Can't convert, upgrade your kernel!".  It is not ok to attempt and have the kernel fail and be left with an unusable device.

We'll need to add a kernel version check to this type of operation.

Comment 2 Jonathan Earl Brassow 2021-11-22 19:22:44 UTC
How hard to add this check and fix this bug?  I'm very tempted just to close.

Comment 3 Heinz Mauelshagen 2022-07-07 15:30:51 UTC
Closing, it's working on newer RHEL, e.g. 7.7