[linux-lvm] lvm operation hangs at semop()

Neutron Sharc neutronsharc at gmail.com
Tue Mar 21 19:07:59 UTC 2017

Hi all,

I'm running very latest lvm2 code and I frequently see lvm command
hangs. gdb shows the code is blocked waiting for semop to complete.

Is there some reference about udev rules I should use?

Below is an example of backtrace of "lvcreate" hanging:
(gdb) bt
#0  0x00007fdd91e64057 in semop () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fdd925829b9 in _udev_wait (cookie=223166712,
nowait=nowait at entry=0x7fff92fd9884) at libdm-common.c:2611
#2  0x00007fdd92584087 in dm_udev_wait (cookie=<optimized out>) at
#3  0x0000560b22a2ca65 in fs_unlock () at activate/fs.c:491
#4  0x0000560b22a36545 in _file_lock_resource (cmd=<optimized out>,
resource=<optimized out>, flags=320, lv=<optimized out>) at
#5  0x0000560b229b9e88 in _lock_vol (cmd=cmd at entry=0x560b249ae000,
resource=<optimized out>, resource at entry=0x7fff92fda950 "#sync_names",
flags=flags at entry=320, lv_op=lv_op at entry=LV_NOOP,
    lv=lv at entry=0x0) at locking/locking.c:275
#6  0x0000560b229ba7f3 in lock_vol (cmd=0x560b249ae000, vol=<optimized
out>, vol at entry=0x560b22a82839 "#sync_names", flags=flags at entry=320,
lv=lv at entry=0x0) at locking/locking.c:355
#7  0x0000560b229bb490 in sync_local_dev_names (cmd=<optimized out>)
at locking/locking.c:529
#8  0x0000560b229d1c7a in wipe_lv (lv=lv at entry=0x560b24a7f4d0, wp=...)
at metadata/lv_manip.c:7064
#9  0x0000560b229d6437 in _lv_create_an_lv
(vg=vg at entry=0x560b24a7d490, lp=lp at entry=0x7fff92fdbfe0,
new_lv_name=<optimized out>) at metadata/lv_manip.c:7842
#10 0x0000560b229d722f in lv_create_single
(vg=vg at entry=0x560b24a7d490, lp=lp at entry=0x7fff92fdbfe0) at
#11 0x0000560b22953b44 in _lvcreate_single
(cmd=cmd at entry=0x560b249ae000, vg_name=vg_name at entry=0x560b249f6a40
"vol3name", vg=vg at entry=0x560b24a7d490,
handle=handle at entry=0x560b249f6998)
    at lvcreate.c:1608
#12 0x0000560b22972530 in _process_vgnameid_list
(process_single_vg=0x560b22952ff0 <_lvcreate_single>,
handle=0x560b249f6998, arg_tags=0x7fff92fdbe40,
    vgnameids_to_process=0x7fff92fdbe70, read_flags=<optimized out>,
cmd=0x560b249ae000) at toollib.c:1964
#13 process_each_vg (cmd=cmd at entry=0x560b249ae000, argc=argc at entry=0,
argv=argv at entry=0x0, one_vgname=<optimized out>,
use_vgnames=use_vgnames at entry=0x0, read_flags=<optimized out>,
    read_flags at entry=1048576, include_internal=0,
handle=0x560b249f6998, process_single_vg=0x560b22952ff0
<_lvcreate_single>) at toollib.c:2277
#14 0x0000560b22956628 in lvcreate (cmd=0x560b249ae000,
argc=<optimized out>, argv=<optimized out>) at lvcreate.c:1647
#15 0x0000560b2295d9d1 in lvm_run_command
(cmd=cmd at entry=0x560b249ae000, argc=1, argc at entry=10,
argv=0x7fff92fdc490, argv at entry=0x7fff92fdc448) at lvmcmdline.c:2880
#16 0x0000560b2295e4d1 in lvm2_main (argc=10, argv=0x7fff92fdc448) at
#17 0x00007fdd91d7c830 in __libc_start_main (main=0x560b2293ea10
<main>, argc=10, argv=0x7fff92fdc448, init=<optimized out>,
fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fff92fdc438) at ../csu/libc-start.c:291
#18 0x0000560b2293ea49 in _start ()

I'm using (almost) latest lvm2 code from Mar 16:
 73d0280 [origin/master] lvmetad: fix bug in snprintf of disable reason

More information about the linux-lvm mailing list