[3.19.y-ckt stable] Patch "rbd: don't put snap_context twice in rbd_queue_workfn()" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Dec 15 23:17:03 UTC 2015


This is a note to let you know that I have just added a patch titled

    rbd: don't put snap_context twice in rbd_queue_workfn()

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue

This patch is scheduled to be released in version 3.19.8-ckt12.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 4fe0df71af20ab1214fb0f160b1fd2ad6490df83 Mon Sep 17 00:00:00 2001
From: Ilya Dryomov <idryomov at gmail.com>
Date: Fri, 27 Nov 2015 19:23:24 +0100
Subject: rbd: don't put snap_context twice in rbd_queue_workfn()

commit 70b16db86f564977df074072143284aec2cb1162 upstream.

Commit 4e752f0ab0e8 ("rbd: access snapshot context and mapping size
safely") moved ceph_get_snap_context() out of rbd_img_request_create()
and into rbd_queue_workfn(), adding a ceph_put_snap_context() to the
error path in rbd_queue_workfn().  However, rbd_img_request_create()
consumes a ref on snapc, so calling ceph_put_snap_context() after
a successful rbd_img_request_create() leads to an extra put.  Fix it.

Signed-off-by: Ilya Dryomov <idryomov at gmail.com>
Reviewed-by: Josh Durgin <jdurgin at redhat.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/block/rbd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d72954b..9e6960f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3400,6 +3400,7 @@ static void rbd_handle_request(struct rbd_device *rbd_dev, struct request *rq)
 		goto err_rq;
 	}
 	img_request->rq = rq;
+	snapc = NULL; /* img_request consumes a ref */

 	if (op_type == OBJ_OP_DISCARD)
 		result = rbd_img_request_fill(img_request, OBJ_REQUEST_NODATA,
--
1.9.1





More information about the kernel-team mailing list