Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Apr 2011 02:02:55 +0000 (19:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Apr 2011 02:02:55 +0000 (19:02 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  libceph: fix linger request requeueing

1  2 
net/ceph/osd_client.c

diff --combined net/ceph/osd_client.c
index 50af02737a3d216e0b66c23003172163fbd71bbd,9204de484c2ed02dfec965ec1a76442019e26bd8..5a80f41c0cbaf207cf71310161856b5a31e65b4a
@@@ -579,9 -579,15 +579,15 @@@ static void __kick_osd_requests(struct 
  
        list_for_each_entry_safe(req, nreq, &osd->o_linger_requests,
                                 r_linger_osd) {
-               __unregister_linger_request(osdc, req);
+               /*
+                * reregister request prior to unregistering linger so
+                * that r_osd is preserved.
+                */
+               BUG_ON(!list_empty(&req->r_req_lru_item));
                __register_request(osdc, req);
-               list_move(&req->r_req_lru_item, &osdc->req_unsent);
+               list_add(&req->r_req_lru_item, &osdc->req_unsent);
+               list_add(&req->r_osd_item, &req->r_osd->o_requests);
+               __unregister_linger_request(osdc, req);
                dout("requeued lingering %p tid %llu osd%d\n", req, req->r_tid,
                     osd->o_osd);
        }
@@@ -798,7 -804,7 +804,7 @@@ static void __register_request(struct c
        req->r_request->hdr.tid = cpu_to_le64(req->r_tid);
        INIT_LIST_HEAD(&req->r_req_lru_item);
  
-       dout("register_request %p tid %lld\n", req, req->r_tid);
+       dout("__register_request %p tid %lld\n", req, req->r_tid);
        __insert_request(osdc, req);
        ceph_osdc_get_request(req);
        osdc->num_requests++;
@@@ -917,7 -923,7 +923,7 @@@ EXPORT_SYMBOL(ceph_osdc_set_request_lin
  /*
   * Pick an osd (the first 'up' osd in the pg), allocate the osd struct
   * (as needed), and set the request r_osd appropriately.  If there is
 - * no up osd, set r_osd to NULL.  Move the request to the appropiate list
 + * no up osd, set r_osd to NULL.  Move the request to the appropriate list
   * (unsent, homeless) or leave on in-flight lru.
   *
   * Return 0 if unchanged, 1 if changed, or negative on error.