From: Alex Elder <elder@inktank.com>
To: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: [PATCH 1/2] rbd: fix reference leak in rbd_do_op()
Date: Fri, 09 Nov 2012 21:06:32 -0600 [thread overview]
Message-ID: <509DC4B8.5020306@inktank.com> (raw)
In-Reply-To: <509DC473.805@inktank.com>
This commit introduced a bug:
4634246d rbd: consolidate rbd_do_op() calls
When a read request is being issued, the snapshot context provided
isn't needed. But that snap context pointer was acquired in
rbd_rq_fn() and it carries with it a reference to that structure.
So before discarding it, the reference needs to be dropped.
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 835153e..b86f5e5 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1333,6 +1333,7 @@ static int rbd_do_op(struct request *rq,
} else {
opcode = CEPH_OSD_OP_READ;
flags = CEPH_OSD_FLAG_READ;
+ ceph_put_snap_context(snapc);
snapc = NULL;
snapid = rbd_dev->spec->snap_id;
payload_len = 0;
--
1.7.9.5
next prev parent reply other threads:[~2012-11-10 3:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-10 3:05 [PATCH 0/2] rbd: snap context references Alex Elder
2012-11-10 3:06 ` Alex Elder [this message]
2012-11-10 3:06 ` [PATCH 2/2] rbd: only get snap context for write requests Alex Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=509DC4B8.5020306@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox