Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 947263

Summary: sys-fs/lvm2-2.03.22-r7 lvcreate fails to create second mirrored volume in a row
Product: Gentoo Linux Reporter: godlike64
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: normal CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description godlike64 2024-12-31 08:58:44 UTC
When attempting to create the second LVM mirrored volume in a row, lvcreate fails with a weird error. Normal volume creation seems to be fine:

root@localhost ~ # zcat /proc/config.gz |grep UEVENT
# CONFIG_UEVENT_HELPER is not set
CONFIG_DM_UEVENT=y
root@localhost ~ # lvcreate -L10G -n test1 vgtest
  Logical volume "test1" created.
root@localhost ~ # lvcreate -L10G -n test2 vgtest
  Logical volume "test2" created.

Creating the first mirrored LV sems to work, albeit there are some weird semaphore/cookie errors:

root@localhost ~ # lvcreate -m1 --type raid1 -L10G --nosync -n test3 vgtest
  WARNING: New raid1 won't be synchronized. Don't read what you didn't write!
  semid 32794: semop failed for cookie 0xd4d1098: incorrect semaphore state
  Failed to set a proper state for notification semaphore identified by cookie value 223154328 (0xd4d1098) to initialize waiting for incoming notifications.
  semid 32795: semop failed for cookie 0xd4d43ca: incorrect semaphore state
  Failed to set a proper state for notification semaphore identified by cookie value 223167434 (0xd4d43ca) to initialize waiting for incoming notifications.
  Logical volume "test3" created.
root@localhost ~ # lvs
  LV         VG                  Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert                                                 
  test1      vgtest        -wi-a-----   10.00g                                                    
  test2      vgtest        -wi-a-----   10.00g                                                    
  test3      vgtest        Rwi-a-r---   10.00g                                    100.00    

Creating the second mirrored LV fails, with the same warnings printed too:

root@localhost ~ # lvcreate -m1 --type raid1 -L10G --nosync -n test4 vgtest
  WARNING: New raid1 won't be synchronized. Don't read what you didn't write!
  semid 32797: semop failed for cookie 0xd4d6143: incorrect semaphore state
  Failed to set a proper state for notification semaphore identified by cookie value 223174979 (0xd4d6143) to initialize waiting for incoming notifications.
  /dev/vgtest/test4: not found: device not cleared
  Aborting. Failed to wipe start of new LV.
  semid 32799: semop failed for cookie 0xd4df096: incorrect semaphore state
  Failed to set a proper state for notification semaphore identified by cookie value 223211670 (0xd4df096) to initialize waiting for incoming notifications.
root@localhost ~ # lvs
  LV         VG                  Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert                                                  
  test1      vgtest        -wi-a-----   10.00g                                                    
  test2      vgtest        -wi-a-----   10.00g                                                    
  test3      vgtest        Rwi-a-r---   10.00g  


At this point, the only way to create the second mirrored volume is to either reboot the system or use -Zn:

root@localhost ~ # lvcreate -m1 --type raid1 -L10G --nosync -Zn -n test4 vgtest
  WARNING: New raid1 won't be synchronized. Don't read what you didn't write!
  semid 32801: semop failed for cookie 0xd4dff01: incorrect semaphore state
  Failed to set a proper state for notification semaphore identified by cookie value 223215361 (0xd4dff01) to initialize waiting for incoming notifications.
  WARNING: Logical volume vgtest/test4 not zeroed.
  Logical volume "test4" created.
root@localhost ~ # lvs
  LV         VG                  Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert                                                   
  test1      vgtest        -wi-a-----   10.00g                                                    
  test2      vgtest        -wi-a-----   10.00g                                                    
  test3      vgtest        Rwi-a-r---   10.00g                                    100.00          
  test4      vgtest        Rwi-a-r---   10.00g                                    100.00                                                            
root@localhost ~ # 

Rebooting the system would allow me to create one mirrored LV, but if I need another one, it would also fail.

Note: those semaphore/cookie errors are also present when removing volumes, but the removal seems to work fine.

Things I've tried:

- It would seem this issue does not happen at all on RHEL 9 (neither the warnings nor the actual error). So first I grabbed the exact same upstream lvm2 version (2.03.24) and applied the exact same patches as the RHEL version. Rebooted. Issue still present.
- Then it was suggested by sam on IRC to try with the same kernel config that RHEL uses. After some fiddling around, I was able to boot into a Gentoo kernel (6.6.62) using the config from the RHEL 9 (5.14-ish). Issue still there. Note that I was back to using Gentoo's LVM at this point (2.03.22-r7, with only Gentoo patches).