[Bug 802626] Re: vgchange may deadlock in initramfs when VG present that's not used for rootfs

Serge Hallyn 802626 at bugs.launchpad.net
Sun Oct 16 12:19:29 UTC 2011


It seems pretty clear what is happening here:  udev's 85-lvm rule fires
off vgchange (through watershed);  which activates lv, then sends udev a
DM_COOKIE with the address of a semaphore, then waits for that semaphore
to drop to zero;  udev fires off 55-dm, which calls dmsetup udevcomplete
${DM_COOKIE}, which clears the semaphore;  udev sometimes exits before
calling dmsetup udevcomplete, so vgchange never exits, but initramfs'
udev waits for it to exit (until finally being killed after timeout).

Daemonizing watershed worked because it allowed udev to exit while
vgchange continues to wait.  I *believe* the rootfs udev then always
continued to call dmsetup udevcomplete to let vgchange exit, though it
is possible that there were cases of vgchange hanging which I simply
never noticed.

The other possible solution would be to have vgchange not wait for the
semaphore.  Note that theoretically this could cause errors to be hidden
(when vgchange should have hung but didn't), except that vgchange
sticking around is easy to not notice if nothing else goes wrong.
However, I've tried having the vgchange -a y in initramfs use
--ignoremonitoring, and several boots hung completely very early on,
while others succeeded.  It's possible I did something else wrong.

A third solution *could* be for udev to not clear queues and workers so
long as there are non-idle workers.  The code to do so should be pretty
easy (I have a sample patch but haven't tested it)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to udev in Ubuntu.
https://bugs.launchpad.net/bugs/802626

Title:
  vgchange may deadlock in initramfs when VG present that's not used for
  rootfs

Status in “lvm2” package in Ubuntu:
  Triaged
Status in “udev” package in Ubuntu:
  Confirmed
Status in “lvm2” source package in Oneiric:
  Triaged
Status in “udev” source package in Oneiric:
  Confirmed

Bug description:
  The system is now unable to boot.
  I had to boot on previous kernel 3.0.0.
  Symptoms are boot freezes. When debugging, issuing a vgscan works ok.
  doing the vgchange -a y just hangs. I need to reboot the system afterwards.

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: lvm2 2.02.66-4ubuntu2
  ProcVersionSignature: Ubuntu 3.0-0.1-generic 3.0.0-rc2
  Uname: Linux 3.0-0-generic x86_64
  Architecture: amd64
  Date: Mon Jun 27 18:15:46 2011
  ProcEnviron:
   LANGUAGE=fr_FR:en
   PATH=(custom, user)
   LANG=fr_FR.utf8
   LC_MESSAGES=fr_FR.UTF-8
   SHELL=/bin/bash
  SourcePackage: lvm2
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/802626/+subscriptions




More information about the foundations-bugs mailing list