[Devel] [PATCH RHEL8 COMMIT] dm-qcow2: Avoid reading R1R2 pages if cluster is not COW

Konstantin Khorenko khorenko at virtuozzo.com
Thu Aug 5 19:09:11 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-305.3.1.vz8.7.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-305.3.1.vz8.7.2
------>
commit 9b17869549ea9c83e6dfd1402673bd4a38ed59a7
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Aug 5 19:09:11 2021 +0300

    dm-qcow2: Avoid reading R1R2 pages if cluster is not COW
    
    This had been enabled before COW clusters became supported
    for debug purposes (to introduce R1R2 support initially).
    Now, it is not needed, since that code is tested on real
    compressed or internal snapshot clusters COW.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-qcow2-map.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 263a43a67108..64bb185ac7e9 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -1919,12 +1919,10 @@ static int parse_metadata(struct qcow2 *qcow2, struct qio **qio,
 		return pos;
 
 	map->data_clu_pos = pos;
-	if (!write)
+	if (!write || !map->clu_is_cow)
 		return 0;
 
 	/* Now refcounters table/block */
-	if (!qcow2->hdr.nb_snapshots && !map->compressed)
-		return 0;
 	ret = handle_r1r2_maps(qcow2, pos, qio, &map->r1,
 			       &map->r2, map->compressed);
 	return ret < 0 ? ret : 0;


More information about the Devel mailing list