[Devel] [PATCH VZ10 3/6] drivers/md/dm-qcow2: fix seek constant comparison

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Mon Aug 10 15:29:57 MSK 2026


This is just an enum, not a mask.

https://virtuozzo.atlassian.net/browse/VSTOR-139407
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 drivers/md/dm-qcow2-map.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 342e4af688509..d6d15b04215c6 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -4520,7 +4520,7 @@ static int qcow2_llseek_hole_qio(struct qio *qio, int whence, loff_t *result)
 			}
 		}
 
-		if (whence & SEEK_HOLE) {
+		if (whence == SEEK_HOLE) {
 			if (arg.zeroes || arg.unmapped) {
 				*result = to_bytes(qio->bi_iter.bi_sector);
 				ret = 0;
@@ -4536,7 +4536,7 @@ static int qcow2_llseek_hole_qio(struct qio *qio, int whence, loff_t *result)
 			}
 		}
 
-		if (whence & SEEK_DATA) {
+		if (whence == SEEK_DATA) {
 			if (!arg.zeroes && !arg.unmapped) {
 				*result = to_bytes(qio->bi_iter.bi_sector);
 				ret = 0;
-- 
2.43.5



More information about the Devel mailing list