]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
loop-util: apparently opening a loop device sometimes results in ENXIO, handle this 17166/head
authorLennart Poettering <lennart@poettering.net>
Thu, 24 Sep 2020 13:08:22 +0000 (15:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 25 Sep 2020 14:03:05 +0000 (16:03 +0200)
src/shared/loop-util.c

index 8760cc89d978909b9f5d61e67166084ffce4f423..4843cbcaabc40467ce3d4924e2c8d0f5b6b9e7dd 100644 (file)
@@ -198,7 +198,7 @@ int loop_device_make(
                 if (loop < 0) {
                         /* Somebody might've gotten the same number from the kernel, used the device,
                          * and called LOOP_CTL_REMOVE on it. Let's retry with a new number. */
-                        if (errno != ENOENT)
+                        if (!IN_SET(errno, ENOENT, ENXIO))
                                 return -errno;
                 } else {
                         r = loop_configure(loop, &config);