chiark / gitweb /
nspawn: work around kernel bug with partition table probing on loopback devices
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Jan 2015 19:36:19 +0000 (20:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Jan 2015 19:40:45 +0000 (20:40 +0100)
commitc09ef2e4e8331ddc7ee063d295c322a0939ea851
tree6540e647e03d9c33b091f464bfdc37222125ccfa
parentc660bb094288d89762cdbedd08661127988e5548
nspawn: work around kernel bug with partition table probing on loopback devices

When we set up a loopback device with partition probing, the udev
"change" event about the configured device is first passed on to
userspace, only the the in-kernel partition prober is started. Since
partition probing fails with EBUSY when somebody has the device open,
the probing frequently fails since udev starts probing/opening the
device as soon as it gets the notification about it, and it might do so
earlier than the kernel probing.

This patch adds a (hopefully temporary) work-around for this, that
compares the number of probed partitions of the kernel with those of
blkid and synchronously asks for reprobing until the numebrs are in
sync.

This really deserves a proper kernel fix.
src/nspawn/nspawn.c