summaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 1fbb000c4..988f3d337 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -1294,7 +1294,7 @@ int loopcxt_setup_device(struct loopdev_cxt *lc)
err:
if (file_fd >= 0)
close(file_fd);
- if (dev_fd >= 0)
+ if (dev_fd >= 0 && rc != -EBUSY)
ioctl(dev_fd, LOOP_CLR_FD, 0);
DBG(lc, loopdev_debug("setup failed [rc=%d]", rc));