aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-09-16 14:13:17 -0400
committerSage Weil <sage@newdream.net>2011-09-16 14:13:17 -0400
commit935b639a049053d0ccbcf7422f2f9cd221642f58 (patch)
treecee4fa3f82256314393b26bd5857d9564513ee04 /net
parent1cad78932a0d139dceff78e68808e160a224d57a (diff)
libceph: fix linger request requeuing
The r_req_lru_item list node moves between several lists, and that cycle is not directly related (and does not begin) with __register_request(). Initialize it in the request constructor, not __register_request(). This fixes later badness (below) when OSDs restart underneath an rbd mount. Crashes we've seen due to this include: [ 213.974288] kernel BUG at net/ceph/messenger.c:2193! and [ 144.035274] BUG: unable to handle kernel NULL pointer dereference at 0000000000000048 [ 144.035278] IP: [<ffffffffa036c053>] con_work+0x1463/0x2ce0 [libceph] Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/osd_client.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 16836a7df7a6..88ad8a2501b5 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -217,6 +217,7 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
217 INIT_LIST_HEAD(&req->r_unsafe_item); 217 INIT_LIST_HEAD(&req->r_unsafe_item);
218 INIT_LIST_HEAD(&req->r_linger_item); 218 INIT_LIST_HEAD(&req->r_linger_item);
219 INIT_LIST_HEAD(&req->r_linger_osd); 219 INIT_LIST_HEAD(&req->r_linger_osd);
220 INIT_LIST_HEAD(&req->r_req_lru_item);
220 req->r_flags = flags; 221 req->r_flags = flags;
221 222
222 WARN_ON((flags & (CEPH_OSD_FLAG_READ|CEPH_OSD_FLAG_WRITE)) == 0); 223 WARN_ON((flags & (CEPH_OSD_FLAG_READ|CEPH_OSD_FLAG_WRITE)) == 0);
@@ -816,13 +817,10 @@ static void __register_request(struct ceph_osd_client *osdc,
816{ 817{
817 req->r_tid = ++osdc->last_tid; 818 req->r_tid = ++osdc->last_tid;
818 req->r_request->hdr.tid = cpu_to_le64(req->r_tid); 819 req->r_request->hdr.tid = cpu_to_le64(req->r_tid);
819 INIT_LIST_HEAD(&req->r_req_lru_item);
820
821 dout("__register_request %p tid %lld\n", req, req->r_tid); 820 dout("__register_request %p tid %lld\n", req, req->r_tid);
822 __insert_request(osdc, req); 821 __insert_request(osdc, req);
823 ceph_osdc_get_request(req); 822 ceph_osdc_get_request(req);
824 osdc->num_requests++; 823 osdc->num_requests++;
825
826 if (osdc->num_requests == 1) { 824 if (osdc->num_requests == 1) {
827 dout(" first request, scheduling timeout\n"); 825 dout(" first request, scheduling timeout\n");
828 __schedule_osd_timeout(osdc); 826 __schedule_osd_timeout(osdc);