Skip to contentSkip to conversation

rbd: fix image request leak on parent read

PATCH In review Alex Elder 2 participants 2 messages May 2, 2013

Subsystems (2)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

PATCH 1/1 rbd: fix image request leak on parent read

When a read for a layered image object finds the target object doesn't exist, a read image request for the parent image is created and submitted. When that completes, the callback routine was not releasing that parent image request. Fix that.

The slab allocation stuff just added has greatly simplified the search for the source of this memory leak.

This resolves:

    http://tracker.ceph.com/issues/4803
---
 drivers/block/rbd.c |    1 +
 1 file changed, 1 insertion(+)
drivers/block/rbd.c +0 -0
index 8d9aeef..d669f71 100644
@@ -2547,6 +2547,7 @@ static void rbd_img_parent_read_callback(struct

rbd_img_request *img_request)
obj_request->xferred = img_request->xferred;
}
out:
+ rbd_img_request_put(img_request);
rbd_img_obj_request_read_callback(obj_request); rbd_obj_request_complete(obj_request);
}

Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Alex Elder

When a read for a layered image object finds the target object doesn't exist, a read image request for the parent image is created and submitted. When that completes, the callback routine was not releasing that parent image request. Fix that.

The slab allocation stuff just added has greatly simplified the search for the source of this memory leak.

This resolves:

     http://tracker.ceph.com/issues/4803
---
  drivers/block/rbd.c |    1 +
  1 file changed, 1 insertion(+)
drivers/block/rbd.c +1 -0
index 8d9aeef..d669f71 100644
@@ -2547,6 +2547,7 @@ static void rbd_img_parent_read_callback(struct
 rbd_img_request *img_request)
  		obj_request->xferred = img_request->xferred;
  	}
  out:
+	rbd_img_request_put(img_request);
  	rbd_img_obj_request_read_callback(obj_request);
  	rbd_obj_request_complete(obj_request);
  }