[Devel] [PATCH RHEL9 COMMIT] dm-qcow2: Do not return EIO on ENOMEM after alloc_and_insert_md_page() fail
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Feb 9 13:09:57 MSK 2022
The commit is pushed to "branch-rh9-5.14.0-4.vz9.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.12.6
------>
commit 0695e1ece80b1902be9f5ccc0fb261ae188cc663
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Wed Feb 9 13:09:57 2022 +0300
dm-qcow2: Do not return EIO on ENOMEM after alloc_and_insert_md_page() fail
dm layer may requeue a request after ENOMEM, but EIO means immediately to fail.
Fixes: 4623783368b0 ("dm-qcow2: Introduce driver to create block devices over
QCOW2 files")
Signed-off-by: Kirill Tkhai <ktkhai 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 bff0f5b54564..8ec67d2b10c9 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -1527,7 +1527,7 @@ static int submit_read_md_page(struct qcow2 *qcow2, struct qio **qio,
ret = alloc_and_insert_md_page(qcow2, page_id, &md);
if (ret < 0) {
pr_err("Can't alloc: ret=%d, page_id=%llu\n", ret, page_id);
- return -EIO;
+ return ret;
}
spin_lock_irq(&qcow2->md_pages_lock);
@@ -1994,7 +1994,7 @@ static int place_r2(struct qcow2 *qcow2, struct qcow2_map_item *r1,
ret = alloc_and_insert_md_page(qcow2, page_id, &r2->md);
if (ret < 0) {
pr_err("Can't alloc: ret=%d, page_id=%llu\n", ret, page_id);
- return -EIO;
+ return ret;
}
zero_fill_page_from(r2->md->page, 0);
More information about the Devel
mailing list