Bug 1388962

Summary: Prevent activation of RAID4 with kernels not supporting proper mapping
Product: Red Hat Enterprise Linux 7 Reporter: Heinz Mauelshagen <heinzm>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: urgent    
Priority: high CC: agk, cluster-qe, cmarthal, heinzm, jbrassow, msnitzer, mthacker, prajnoha, prockai, rbednar, slevine, yizhan, zkabelac
Version: 7.3Keywords: ZStream
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.169-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1386184
: 1395563 (view as bug list) Environment:
Last Closed: 2017-08-01 21:49:49 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:
Bug Depends On: 1385149, 1386184, 1386194    
Bug Blocks: 1395563    

Comment 1 Heinz Mauelshagen 2016-10-26 15:04:39 UTC
This bz is coping with rejecting raid4 activation and conversion to/from on dm-raid target 1.[89].0 which does not provide correct raid4 mapping.

Comment 2 Heinz Mauelshagen 2016-10-27 09:43:03 UTC
Upstream commit ff05ed7afd16

Comment 3 Heinz Mauelshagen 2016-11-15 18:03:04 UTC
Corey,

test with creating a raid4 LV with raid target versions 1.[89].0 (e.g. kernel-3.10.0-515.el7) or converting to raid4 which gets rejected with
"RAID module does not support RAID4.".

Comment 7 Corey Marthaler 2016-11-17 23:56:34 UTC
Filed bug 1396309 for the raid10 version of this issue that was originally mentioned in bug 1385149.

Comment 9 Roman Bednář 2017-05-16 08:47:24 UTC
Marking verified. Raid 4 volume activation is prevented when using
incompatible versions of raid dm target and lvm2.

=============================================

Initial packages (RHEL7.2):
	3.10.0-327.el7.x86_64
	lvm2-2.02.130-5.el7.x86_64

# dmsetup targets|grep raid
raid             v1.7.0


# lvs -a -o lv_name,segtype,devices -S vg_name=vg
  LV               Type   Devices                                                                
  raid4            raid4  raid4_rimage_0(0),raid4_rimage_1(0),raid4_rimage_2(0),raid4_rimage_3(0)
  [raid4_rimage_0] linear /dev/sda(1)                                                            
  [raid4_rimage_1] linear /dev/sdb(1)                                                            
  [raid4_rimage_2] linear /dev/sdc(1)                                                            
  [raid4_rimage_3] linear /dev/sdd(1)                                                            
  [raid4_rmeta_0]  linear /dev/sda(0)                                                            
  [raid4_rmeta_1]  linear /dev/sdb(0)                                                            
  [raid4_rmeta_2]  linear /dev/sdc(0)                                                            
  [raid4_rmeta_3]  linear /dev/sdd(0)      

# vgchange -an vg

BEFORE PATCH:
Upgrade to 3.10.0-514.el7 and lvm2-2.02.166-1.el7

# dmsetup targets|grep raid
raid             v1.9.0

# pvscan --cache

# pvscan
  PV /dev/sdi    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdg    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdf    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sda    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdh    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdc    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdb    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdd    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sde    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdj    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/vda2   VG rhel_virt-369   lvm2 [7.51 GiB / 40.00 MiB free]
  Total: 11 [407.43 GiB] / in use: 11 [407.43 GiB] / in no VG: 0 [0   ]

# lvchange -ay vg/raid4
  device-mapper: reload ioctl on (253:22) failed: Invalid argument


May 16 10:31:10 virt-369 kernel: device-mapper: raid: Reshaping/takeover raid sets not yet supported. (raid level/stripes/size change)
May 16 10:31:10 virt-369 kernel: device-mapper: table: 253:22: raid: Unable to assemble array: Invalid superblocks
May 16 10:31:10 virt-369 kernel: device-mapper: ioctl: error adding target to table
May 16 10:31:10 virt-369 multipathd: dm-22: remove map (uevent)
May 16 10:31:10 virt-369 multipathd: dm-22: remove map (uevent)


AFTER PATCH:
Upgrade to lvm2-2.02.171-1.el7.x86_64

# dmsetup targets|grep raid
raid             v1.9.0

# uname -r
3.10.0-514.el7.x86_64

# pvscan --cache

# pvscan
  PV /dev/sdi    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdg    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdf    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sda    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdh    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdc    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdb    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdd    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sde    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/sdj    VG vg              lvm2 [39.99 GiB / 39.88 GiB free]
  PV /dev/vda2   VG rhel_virt-369   lvm2 [7.51 GiB / 40.00 MiB free]
  Total: 11 [407.43 GiB] / in use: 11 [407.43 GiB] / in no VG: 0 [0   ]

# lvchange -ay vg/raid4
  RAID module does not support RAID4.
  Failed to activate raid4 LV vg/raid4

=============================================

Comment 10 errata-xmlrpc 2017-08-01 21:49:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2222