summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-24 15:08:22 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-12-08 14:34:28 +0100
commit49fac0bf335bde8489a43cfa9f8dc3f5968f1029 (patch)
treef54277b1e41f2b184d45076d544b6dd300c5fd93 /src/shared
parentdcce7c6ae89e091118ee21a9f0ad86633531e216 (diff)
downloadsystemd-49fac0bf335bde8489a43cfa9f8dc3f5968f1029.tar.gz
loop-util: apparently opening a loop device sometimes results in ENXIO, handle this
(cherry picked from commit 77ad674b51ceb598aae1adaa7abe572ad0262f39)
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/loop-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c
index 4a593b05f3..51a8ef7e21 100644
--- a/src/shared/loop-util.c
+++ b/src/shared/loop-util.c
@@ -116,7 +116,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 {
if (ioctl(loop, LOOP_SET_FD, fd) >= 0) {