[PATCH 4.19 251/639] rbd: clear ->xferred on error from rbd_obj_issue_copyup()
From: Greg Kroah-Hartman
Date: Fri Jan 24 2020 - 06:13:59 EST
From: Ilya Dryomov <idryomov@xxxxxxxxx>
[ Upstream commit 356889c49d84f11f446ec235bd52ca1a7d581aa0 ]
Otherwise the assert in rbd_obj_end_request() is triggered.
Fixes: 3da691bf4366 ("rbd: new request handling code")
Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/block/rbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 585378bc988cd..b942f4c8cea8c 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2506,6 +2506,7 @@ again:
ret = rbd_obj_issue_copyup(obj_req, obj_req->xferred);
if (ret) {
obj_req->result = ret;
+ obj_req->xferred = 0;
return true;
}
return false;
--
2.20.1