summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-01-30 11:13:33 -0600
committerSage Weil <sage@inktank.com>2013-02-13 18:29:11 -0800
commit1e32d34cfa6759df58b5f4002664241f2a0fef6a (patch)
treeadec3c6652116c64ec295b35cac03f3fb255a6eb /net
parent72fe25e3460c8673984370208e0e6261101372d6 (diff)
downloadlinux-1e32d34cfa6759df58b5f4002664241f2a0fef6a.tar.gz
linux-1e32d34cfa6759df58b5f4002664241f2a0fef6a.tar.bz2
linux-1e32d34cfa6759df58b5f4002664241f2a0fef6a.zip
rbd: don't take extra bio reference for osd client
Currently, if the OSD client finds an osd request has had a bio list attached to it, it drops a reference to it (or rather, to the first entry on that list) when the request is released. The code that added that reference (i.e., the rbd client) is therefore required to take an extra reference to that first bio structure. The osd client doesn't really do anything with the bio pointer other than transfer it from the osd request structure to outgoing (for writes) and ingoing (for reads) messages. So it really isn't the right place to be taking or dropping references. Furthermore, the rbd client already holds references to all bio structures it passes to the osd client, and holds them until the request is completed. So there's no need for this extra reference whatsoever. So remove the bio_put() call in ceph_osdc_release_request(), as well as its matching bio_get() call in rbd_osd_req_create(). This change could lead to a crash if old libceph.ko was used with new rbd.ko. Add a compatibility check at rbd initialization time to avoid this possibilty. This resolves: http://tracker.ceph.com/issues/3798 and http://tracker.ceph.com/issues/3799 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/ceph_common.c2
-rw-r--r--net/ceph/osd_client.c4
2 files changed, 1 insertions, 5 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index a98c03ff853f..c236c235c4a2 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -39,7 +39,7 @@
*/
bool libceph_compatible(void *data)
{
- return false;
+ return true;
}
EXPORT_SYMBOL(libceph_compatible);
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 500ae8b49321..ba03648533c0 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -147,10 +147,6 @@ void ceph_osdc_release_request(struct kref *kref)
if (req->r_own_pages)
ceph_release_page_vector(req->r_pages,
req->r_num_pages);
-#ifdef CONFIG_BLOCK
- if (req->r_bio)
- bio_put(req->r_bio);
-#endif
ceph_put_snap_context(req->r_snapc);
ceph_pagelist_release(&req->r_trail);
if (req->r_mempool)