dissect-image: wait for udev for single filesystem images too

Single filesystem images are mounted from the /dev/block/X:Y symlink
rather than /dev/loopZ, so we need to wait for udev to create it or
mounting will be racy and occasionally fail.
This commit is contained in:
Luca Boccassi 2020-06-03 19:47:39 +01:00
parent a07e962549
commit b1806441bb
1 changed files with 5 additions and 5 deletions

View File

@ -424,11 +424,11 @@ int dissect_image(
m->encrypted = streq_ptr(fstype, "crypto_LUKS");
if (!streq(usage, "filesystem")) {
r = loop_wait_for_partitions_to_appear(fd, d, 0, flags, &e);
if (r < 0)
return r;
}
/* Even on a single partition we need to wait for udev to create the
* /dev/block/X:Y symlink to /dev/loopZ */
r = loop_wait_for_partitions_to_appear(fd, d, 0, flags, &e);
if (r < 0)
return r;
*ret = TAKE_PTR(m);
return 0;