]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/loop-util: add comment
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 30 May 2023 13:56:45 +0000 (15:56 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 30 May 2023 14:04:35 +0000 (16:04 +0200)
Requested in https://github.com/systemd/systemd/commit/afbe20b7d4ed4c3aebbd1b3de00b9b7385dd0ae8#r115653459.

src/shared/loop-util.c

index 5418871093def6ebff8088a6b5fb5e58d8409c01..a70c5509d5675f59db62e92f0e51516bdc44379b 100644 (file)
@@ -818,7 +818,8 @@ static LoopDevice* loop_device_free(LoopDevice *d) {
 
         /* Now that the block device is released, let's also try to remove it */
         if (control >= 0) {
-                useconds_t delay = 5 * USEC_PER_MSEC;
+                useconds_t delay = 5 * USEC_PER_MSEC;  /* A total delay of 5090 ms between 39 attempts,
+                                                        * (4*5 + 5*10 + 5*20 + … + 3*640) = 5090. */
 
                 for (unsigned attempt = 1;; attempt++) {
                         if (ioctl(control, LOOP_CTL_REMOVE, d->nr) >= 0)