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-08 13:06:53 +01:00
parent a07e962549
commit b1806441bb
+5 -5
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;