]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/loopdev: perform retry on EAGAIN
authorKarel Zak <kzak@redhat.com>
Tue, 15 Jun 2021 08:34:46 +0000 (10:34 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 15 Jun 2021 08:34:46 +0000 (10:34 +0200)
Suggested-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/losetup.c

index f082fab41881b761cca1537ae8d5b0b96ae803d7..56de4ccba1dc14a09de7e0befc9c23c67c7ce159 100644 (file)
@@ -573,7 +573,7 @@ static int create_loop(struct loopdev_cxt *lc,
                if (rc == 0)
                        break;                  /* success */
 
-               if (errno == EBUSY && !hasdev && ntries < 64) {
+               if ((errno == EBUSY || errno == EAGAIN) && !hasdev && ntries < 64) {
                        xusleep(200000);
                        ntries++;
                        continue;