linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] vgchange -a n --sysinit hangs without udevd
@ 2021-09-22  7:19 Arkadiusz Miśkiewicz
  2021-09-22  7:40 ` Arkadiusz Miśkiewicz
  2021-09-23 13:49 ` Zdenek Kabelac
  0 siblings, 2 replies; 3+ messages in thread
From: Arkadiusz Miśkiewicz @ 2021-09-22  7:19 UTC (permalink / raw)
  To: linux-lvm


Hello.

Linux 5.10.67, glibc 2.34, lvm 2.03.13, udevd 246, simple init script
run on shutdown which does

vgchange -a n --sysinit

no other processes are running (just init, my script and vgchange),
vgstorage is vg on md raid 10 on 4 hdd disks.

it hangs with

+ /sbin/vgchange -a n --sysinit --verbose --debug
  Failed to find sysfs mount point
  No proc filesystem found: skipping sysfs filter
  No proc filesystem found: skipping multipath filter
  File locking initialisation failed.
  Deactivating logical volume vgstorage/lvhome.
  Removing vgstorage-lvhome (253:0)
  Deactivated 1 logical volumes in volume group vgstorage.

Note that running
vgchange -a n --sysinit --verbose --debug
on fully running system just works fine:

# vgchange -a n --sysinit --verbose --debug
  Deactivating logical volume vgstorage/lvhome.
  Removing vgstorage-lvhome (253:0)
  Deactivated 1 logical volumes in volume group vgstorage.
  0 logical volume(s) in volume group "vgstorage" now active
#


so I've restarted udevd just before vgchange call in my script and it
works.

Other test:

fully running system
# udevd --version
246
# killall udevd
# vgchange -a n --sysinit --verbose --debug
  Deactivating logical volume vgstorage/lvhome.
  Removing vgstorage-lvhome (253:0)
  Deactivated 1 logical volumes in volume group vgstorage.
and hangs


Why is udevd needed for vgchange there? It wasn't needed to deactivate
vg before AFAIK.


strace


> ioctl(3, DM_DEV_STATUS, {version=[4, 0, 0], data_size=2048, uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC-real", flags=DM_EXISTS_FLAG} => {version=[4, 43, 0], data_size=2048, uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC-real", flags=DM_EXISTS_FLAG}) = -1 ENXIO (No such device or address)
> ioctl(3, DM_DEV_STATUS, {version=[4, 0, 0], data_size=2048, uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC-cow", flags=DM_EXISTS_FLAG} => {version=[4, 43, 0], data_size=2048, uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC-cow", flags=DM_EXISTS_FLAG}) = -1 ENXIO (No such device or address)
> ioctl(3, DM_DEV_STATUS, {version=[4, 0, 0], data_size=2048, dev=makedev(0xfd, 0), flags=DM_EXISTS_FLAG|DM_PERSISTENT_DEV_FLAG} => {version=[4, 43, 0], data_size=305, dev=makedev(0xfd, 0), name="vgstorage-lvhome", uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC", target_count=1, open_count=0, event_nr=0, flags=DM_EXISTS_FLAG|DM_PERSISTENT_DEV_FLAG|DM_ACTIVE_PRESENT_FLAG}) = 0
> write(2, "  ", 2  )                       = 2
> write(2, "Removing vgstorage-lvhome (253:0)", 33Removing vgstorage-lvhome (253:0)) = 33
> write(2, "\n", 1
> )                       = 1
> openat(AT_FDCWD, "/dev/urandom", O_RDONLY) = 4
> read(4, "M\277", 2)                     = 2
> semget(0xd4dbf4d, 1, IPC_CREAT|IPC_EXCL|0600) = 1
> semctl(1, 0, SETVAL, 0x1)               = 0
> semctl(1, 0, GETVAL, NULL)              = 1
> close(4)                                = 0
> semtimedop(1, [{sem_num=0, sem_op=1, sem_flg=0}], 1, NULL) = 0
> semctl(1, 0, GETVAL, NULL)              = 2
> ioctl(3, DM_DEV_REMOVE, {version=[4, 0, 0], data_size=2048, dev=makedev(0xfd, 0), event_nr=6340429, flags=DM_EXISTS_FLAG|DM_PERSISTENT_DEV_FLAG|DM_SKIP_BDGET_FLAG} => {version=[4, 43, 0], data_size=305, dev=makedev(0xfd, 0), name="vgstorage-lvhome", uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC", flags=DM_EXISTS_FLAG|DM_PERSISTENT_DEV_FLAG|DM_SKIP_BDGET_FLAG|DM_UEVENT_GENERATED_FLAG}) = 0
> brk(0x55a3f9c90000)                     = 0x55a3f9c90000
> brk(0x55a3f9c88000)                     = 0x55a3f9c88000
> ioctl(3, DM_DEV_STATUS, {version=[4, 0, 0], data_size=2048, uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC", flags=DM_EXISTS_FLAG|DM_SKIP_BDGET_FLAG} => {version=[4, 43, 0], data_size=2048, uuid="LVM-RHsosDyNlYziYbg37wzJcScURBWTgIsLKKLTWRdexUv1xoTudaMvkeXcNyg5JQiC", flags=DM_EXISTS_FLAG|DM_SKIP_BDGET_FLAG}) = -1 ENXIO (No such device or address)
> rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
> rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f00fed2b480}, NULL, 8) = 0
> rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f00fed2b480}, NULL, 8) = 0
> write(2, "  ", 2  )                       = 2
> write(2, "Deactivated 1 logical volumes in volume group vgstorage.", 56Deactivated 1 logical volumes in volume group vgstorage.) = 56
> write(2, "\n", 1
> )                       = 1
> setpriority(PRIO_PROCESS, 0, 0)         = 0
> semget(0xd4dbf4d, 1, 000)               = 1
> semctl(1, 0, GETVAL, NULL)              = 2
> semtimedop(1, [{sem_num=0, sem_op=-1, sem_flg=IPC_NOWAIT}], 1, NULL) = 0
> semtimedop(1, [{sem_num=0, sem_op=0, sem_flg=0}], 1, NULL



-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] vgchange -a n --sysinit hangs without udevd
  2021-09-22  7:19 [linux-lvm] vgchange -a n --sysinit hangs without udevd Arkadiusz Miśkiewicz
@ 2021-09-22  7:40 ` Arkadiusz Miśkiewicz
  2021-09-23 13:49 ` Zdenek Kabelac
  1 sibling, 0 replies; 3+ messages in thread
From: Arkadiusz Miśkiewicz @ 2021-09-22  7:40 UTC (permalink / raw)
  To: linux-lvm

W dniu 22.09.2021 o 09:19, Arkadiusz Miśkiewicz pisze:

> Other test:
> 
> fully running system
> # udevd --version
> 246
> # killall udevd
> # vgchange -a n --sysinit --verbose --debug
>   Deactivating logical volume vgstorage/lvhome.
>   Removing vgstorage-lvhome (253:0)
>   Deactivated 1 logical volumes in volume group vgstorage.
> and hangs
> 
> 
> Why is udevd needed for vgchange there? It wasn't needed to deactivate
> vg before AFAIK.


vgchange -a n --sysinit --noudevsync

also works but I wonder what has changed, so that this option is needed now?

-- 
Arkadiusz Miśkiewicz, arekm / ( maven.pl | pld-linux.org )

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] vgchange -a n --sysinit hangs without udevd
  2021-09-22  7:19 [linux-lvm] vgchange -a n --sysinit hangs without udevd Arkadiusz Miśkiewicz
  2021-09-22  7:40 ` Arkadiusz Miśkiewicz
@ 2021-09-23 13:49 ` Zdenek Kabelac
  1 sibling, 0 replies; 3+ messages in thread
From: Zdenek Kabelac @ 2021-09-23 13:49 UTC (permalink / raw)
  To: LVM general discussion and development, Arkadiusz Miśkiewicz

Dne 22. 09. 21 v 9:19 Arkadiusz Miśkiewicz napsal(a):
> 
> Hello.
> 
> Linux 5.10.67, glibc 2.34, lvm 2.03.13, udevd 246, simple init script
> run on shutdown which does
> 
> vgchange -a n --sysinit
> 
> no other processes are running (just init, my script and vgchange),
> vgstorage is vg on md raid 10 on 4 hdd disks.
> 
> it hangs with
> 
> + /sbin/vgchange -a n --sysinit --verbose --debug
>    Failed to find sysfs mount point
>    No proc filesystem found: skipping sysfs filter
>    No proc filesystem found: skipping multipath filter
>    File locking initialisation failed.
>    Deactivating logical volume vgstorage/lvhome.
>    Removing vgstorage-lvhome (253:0)
>    Deactivated 1 logical volumes in volume group vgstorage.
> 
> Note that running
> vgchange -a n --sysinit --verbose --debug
> on fully running system just works fine:
> 
> # vgchange -a n --sysinit --verbose --debug
>    Deactivating logical volume vgstorage/lvhome.
>    Removing vgstorage-lvhome (253:0)
>    Deactivated 1 logical volumes in volume group vgstorage.
>    0 logical volume(s) in volume group "vgstorage" now active
> #
> 
> 
> so I've restarted udevd just before vgchange call in my script and it
> works.
> 
> Other test:
> 
> fully running system
> # udevd --version
> 246
> # killall udevd
> # vgchange -a n --sysinit --verbose --debug
>    Deactivating logical volume vgstorage/lvhome.
>    Removing vgstorage-lvhome (253:0)
>    Deactivated 1 logical volumes in volume group vgstorage.
> and hangs
> 
> 
> Why is udevd needed for vgchange there? It wasn't needed to deactivate
> vg before AFAIK.
> 
> 
> strace

Hi

It does look like the initial detection of running udev within lvm2 code is 
doing something wrong.

It should recognize there is no udev running and behave like if  --noudevsync 
would be given.

I'll check what has changed.


Regards

Zdenek


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-23 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22  7:19 [linux-lvm] vgchange -a n --sysinit hangs without udevd Arkadiusz Miśkiewicz
2021-09-22  7:40 ` Arkadiusz Miśkiewicz
2021-09-23 13:49 ` Zdenek Kabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).