[Devel] [PATCH RHEL9 COMMIT] dm-qcow2: Use handle_md_page() instead of md_page_find_or_postpone()

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 24 00:23:58 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-42.vz9.14.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-42.vz9.14.4
------>
commit 963c06b619be49cb755fa08e08d7b93289535fb0
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Mar 24 00:23:58 2022 +0300

    dm-qcow2: Use handle_md_page() instead of md_page_find_or_postpone()
    
    This is to make further modifications easier.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Feature: dm-qcow2: block device over QCOW2 files driver
---
 drivers/md/dm-qcow2-map.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 6a600b1c870f..0bfcd5716908 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -2282,8 +2282,8 @@ static int relocate_refcount_table(struct qcow2 *qcow2, struct qio **qio)
 			WARN_ON_ONCE(1);
 			goto err_free_r2_pages;
 		}
-		md = md_page_find_or_postpone(qcow2, r1.page_id, NULL);
-		if (WARN_ON_ONCE(!md))
+		ret = handle_md_page(qcow2, r1.page_id, NULL, &md);
+		if (WARN_ON_ONCE(ret <= 0))
 			goto err_free_r2_pages;
 		spin_lock_irq(&qcow2->md_pages_lock);
 		set_u64_to_be_page(md->page, r1.index_in_page, i);
@@ -2311,8 +2311,8 @@ static int relocate_refcount_table(struct qcow2 *qcow2, struct qio **qio)
 
 err_free_r2_pages:
 	for (i = end; i < r2_end; i += clu_size) {
-		md = md_page_find_or_postpone(qcow2, i >> PAGE_SHIFT, NULL);
-		if (!md)
+		ret = handle_md_page(qcow2, i >> PAGE_SHIFT, NULL, &md);
+		if (ret <= 0)
 			break;
 		spin_lock_irq(&qcow2->md_pages_lock);
 		md_page_erase(qcow2, md);


More information about the Devel mailing list