Skip to contentSkip to conversation

block: keep bitmap if incremental backup job is cancelled

PATCH In review Stefan Hajnoczi 5 participants 5 messages Jun 25, 2015 – Jun 26, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: keep bitmap if incremental backup job is cancelled

Reclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.

---
 block/backup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/backup.c +1 -1
index 4a1af68..ddf8424 100644
@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)
 
     if (job->sync_bitmap) {
         BdrvDirtyBitmap *bm;
-        if (ret < 0) {
+        if (ret < 0 || block_job_is_cancelled(&job->common)) {
             /* Merge the successor back into the parent, delete nothing. */
             bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL);
             assert(bm);
Signature · 1 line
2.4.3
#1 lore raw
Quoted 17 lines · Stefan Hajnoczi

Reclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.

---
 block/backup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/backup.c +0 -0
index 4a1af68..ddf8424 100644

block/backup.c static void coroutine_fn backup_run(void *opaque) · line 437

Quoted 8 lines
block/backup.c +1 -1
@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)
 
     if (job->sync_bitmap) {
         BdrvDirtyBitmap *bm;
-        if (ret < 0) {
+        if (ret < 0 || block_job_is_cancelled(&job->common)) {
             /* Merge the successor back into the parent, delete nothing. */
             bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL);
             assert(bm);

Didn't Jeff Cody already stage this?

#2 lore raw
Quoted 20 lines · John Snow
Quoted 17 lines · Stefan Hajnoczi

Reclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.

---
 block/backup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/backup.c +0 -0
index 4a1af68..ddf8424 100644
@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)
 
Quoted 10 lines

block/backup.c static void coroutine_fn backup_run(void *opaque) · line 437

Quoted 8 lines
block/backup.c +1 -1
     if (job->sync_bitmap) {
         BdrvDirtyBitmap *bm;
-        if (ret < 0) {
+        if (ret < 0 || block_job_is_cancelled(&job->common)) {
             /* Merge the successor back into the parent, delete nothing. */
             bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL);
             assert(bm);

Didn't Jeff Cody already stage this?

Yes

#3 lore raw
Quoted 32 lines · Jeff Cody
Quoted 20 lines · John Snow
Quoted 17 lines · Stefan Hajnoczi

Reclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.

---
 block/backup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/backup.c +0 -0
index 4a1af68..ddf8424 100644
@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)
 
Quoted 10 lines

block/backup.c static void coroutine_fn backup_run(void *opaque) · line 437

Quoted 8 lines
block/backup.c +1 -1
     if (job->sync_bitmap) {
         BdrvDirtyBitmap *bm;
-        if (ret < 0) {
+        if (ret < 0 || block_job_is_cancelled(&job->common)) {
             /* Merge the successor back into the parent, delete nothing. */
             bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL);
             assert(bm);

Didn't Jeff Cody already stage this?

Quoted 1 line

Yes

Thanks!

#4 lore raw
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Jeff Cody
Quoted 28 lines · John Snow
Quoted 17 lines · Stefan Hajnoczi

Reclaim the dirty bitmap if an incremental backup block job is cancelled. The ret variable may be 0 when the job is cancelled so it's not enough to check ret < 0.

---
  block/backup.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
block/backup.c +0 -0
index 4a1af68..ddf8424 100644

block/backup.c static void coroutine_fn backup_run(void *opaque) · line 437

Quoted 8 lines
block/backup.c +1 -1
@@ -431,7 +431,7 @@ static void coroutine_fn backup_run(void *opaque)
 
      if (job->sync_bitmap) {
          BdrvDirtyBitmap *bm;
-        if (ret < 0) {
+        if (ret < 0 || block_job_is_cancelled(&job->common)) {
              /* Merge the successor back into the parent, delete nothing. */
              bm = bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL);
              assert(bm);

Didn't Jeff Cody already stage this?

Quoted 2 lines
Quoted 1 line

Yes

Thanks!

It appears like I successfully confused Stefan, thanks to John not wanting to embarrass me in public. :-)