migration: Unlock mutex in error case
PATCH 1/1 migration: Unlock mutex in error case
We were not unlocking bitmap mutex on the error case. Coverity discovered the problem.
--- migration/ram.c | 1 + 1 file changed, 1 insertion(+)
migration/ram.c +1 -0
@@ -3040,6 +3040,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) ret =rdma_registration_start (f,RAM_CONTROL_ROUND );if (ret <0 ) {qemu_file_set_error (f, ret); +qemu_mutex_unlock (&rs->bitmap_mutex); goto out; }
Signature · 1 line
2.41.0
Quoted 14 lines · Juan Quintela
We were not unlocking bitmap mutex on the error case. Coverity discovered the problem.
Fixes a2326705e5 ("migration: Stop migration immediately in RDMA error paths")Signed-off-by Juan Quintela <[email protected]>--- migration/ram.c | 1 + 1 file changed, 1 insertion(+)migration/ram.c +0
-0
migration/ram.c static int ram_save_iterate(QEMUFile *f, void *opaque) · line 3043
Quoted 4 lines
migration/ram.c +1
-0@@ -3040,6 +3040,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) ret =rdma_registration_start (f,RAM_CONTROL_ROUND );if (ret <0 ) {qemu_file_set_error (f, ret); +qemu_mutex_unlock (&rs->bitmap_mutex);
I see the function uses the WITH_RCU_READ_LOCK_GUARD() macro to autofree the RCU lock so why not use WITH_QEMU_LOCK_GUARD() instead of manually checking the error cases?
Quoted 2 lines
migration/ram.c +0
-0goto out; }
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Quoted 11 lines · Alex Bennée
Quoted 9 lines · Juan Quintela
We were not unlocking bitmap mutex on the error case. Coverity discovered the problem.
Fixes a2326705e5 ("migration: Stop migration immediately in RDMA error paths")Signed-off-by Juan Quintela <[email protected]>--- migration/ram.c | 1 + 1 file changed, 1 insertion(+)
Quoted 13 lines
migration/ram.c static int ram_save_iterate(QEMUFile *f, void *opaque) · line 3043
Quoted 9 lines
migration/ram.c +1
-0@@ -3040,6 +3040,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) ret =rdma_registration_start (f,RAM_CONTROL_ROUND );if (ret <0 ) {qemu_file_set_error (f, ret); +qemu_mutex_unlock (&rs->bitmap_mutex);I see the function uses the
WITH_RCU_READ_LOCK_GUARD()macro to autofree the RCU lock so why not useWITH_QEMU_LOCK_GUARD()instead of manually checking the error cases?
You are right.
Changing to that.
Later, Juan.
Quoted 6 lines · Juan Quintela
We were not unlocking bitmap mutex on the error case. Coverity discovered the problem.
Fixes a2326705e5 ("migration: Stop migration immediately in RDMA error paths")Signed-off-by Juan Quintela <[email protected]>
CID 1523750.
thanks
-- PMM
Quoted 14 lines · Juan Quintela
We were not unlocking bitmap mutex on the error case. Coverity discovered the problem.
Fixes a2326705e5 ("migration: Stop migration immediately in RDMA error paths")Signed-off-by Juan Quintela <[email protected]>--- migration/ram.c | 1 + 1 file changed, 1 insertion(+)migration/ram.c +0
-0
migration/ram.c static int ram_save_iterate(QEMUFile *f, void *opaque) · line 3045
Quoted 6 lines
migration/ram.c +1
-0@@ -3040,6 +3040,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) ret =rdma_registration_start (f,RAM_CONTROL_ROUND );if (ret <0 ) {qemu_file_set_error (f, ret); +qemu_mutex_unlock (&rs->bitmap_mutex); goto out; }
Signature · 1 line
Peter Xu