crypt: Wait for udev to settle before unlocking disk
authorJames Lee <jlee@thestaticvoid.com>
Mon, 29 Jul 2013 20:10:22 +0000 (16:10 -0400)
committerHarald Hoyer <harald@redhat.com>
Tue, 30 Jul 2013 13:28:47 +0000 (15:28 +0200)
commit6e0348f33b351dc7b2b920a63bbeb2a9340e600e
tree38bddf2cf75b46ee5792307f93677699c1743d14
parent27458b10ffdd6f97019a4f466e044b09623d06c0
crypt: Wait for udev to settle before unlocking disk

To eliminate a race condition that occurs when unlocking one device
depends on the result of unlocking a device before it, the crypt
module must wait for udev to settle between each unlock attempt.

Example

/etc/crypttab:

  keyfile /dev/md1 none luks
  sda4_crypt /dev/sda4 /dev/mapper/keyfile luks
  sdb4_crypt /dev/sdb4 /dev/mapper/keyfile luks

Without this patch, sometimes /dev/sda4 fails to unlock because udev
doesn't have time to create /dev/mapper/keyfile before it's needed.
modules.d/90crypt/parse-crypt.sh