Skip to contentSkip to conversation

block/mirror: Always call block_job_sleep_ns()

PATCH Applied Max Reitz 4 participants 4 messages Apr 27, 2015 Block layer

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 block/mirror: Always call block_job_sleep_ns()

The mirror block job is trying to take a clever shortcut if delay_ns is 0 and skips block_job_sleep_ns() in that case. But that function must be called in every block job iteration, because otherwise it is for example impossible to pause the job.

---
This makes test 129 pass when run in tmpfs (for me, at least).

---
 block/mirror.c | 3 ---
 1 file changed, 3 deletions(-)
block/mirror.c +0 -3
index d53e60e..58f391a 100644
@@ -482,9 +482,6 @@ static void coroutine_fn mirror_run(void *opaque)
                 continue;
             } else if (cnt != 0) {
                 delay_ns = mirror_iteration(s);
-                if (delay_ns == 0) {
-                    continue;
-                }
             }
         }
 
Signature · 1 line
2.3.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Max Reitz

The mirror block job is trying to take a clever shortcut if delay_ns is 0 and skips block_job_sleep_ns() in that case. But that function must be called in every block job iteration, because otherwise it is for example impossible to pause the job.

---
This makes test 129 pass when run in tmpfs (for me, at least).

Reviewed-by on v1 1/1
#2 lore raw
In reply to Max Reitz
Quoted 8 lines · Max Reitz

The mirror block job is trying to take a clever shortcut if delay_ns is 0 and skips block_job_sleep_ns() in that case. But that function must be called in every block job iteration, because otherwise it is for example impossible to pause the job.

---
This makes test 129 pass when run in tmpfs (for me, at least).

Looks good to me. Thanks for debugging the failure!

Quoted 21 lines
---
 block/mirror.c | 3 ---
 1 file changed, 3 deletions(-)
block/mirror.c +0 -3
index d53e60e..58f391a 100644
@@ -482,9 +482,6 @@ static void coroutine_fn mirror_run(void *opaque)
                 continue;
             } else if (cnt != 0) {
                 delay_ns = mirror_iteration(s);
-                if (delay_ns == 0) {
-                    continue;
-                }
             }
         }
 
Signature · 1 line
2.3.5
Applied
#3 lore raw
In reply to Max Reitz

Am 27.04.2015 um 13:07 hat Max Reitz geschrieben:

Quoted 8 lines

The mirror block job is trying to take a clever shortcut if delay_ns is 0 and skips block_job_sleep_ns() in that case. But that function must be called in every block job iteration, because otherwise it is for example impossible to pause the job.

---
This makes test 129 pass when run in tmpfs (for me, at least).

Thanks, applied to the block branch.

Kevin