[Devel] [PATCH RH9] dm-qcow2: Do not return EIO on ENOMEM after alloc_and_insert_md_page() fail

Kirill Tkhai ktkhai at virtuozzo.com
Mon Feb 7 17:10:09 MSK 2022


dm layer may requeue a request after ENOMEM, but EIO means immediately to fail.

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 bff0f5b545643..8ec67d2b10c99 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