ceph: check return value for start_request in writepages
authorSage Weil <sage@newdream.net>
Thu, 12 May 2011 22:48:16 +0000 (15:48 -0700)
committerSage Weil <sage@newdream.net>
Thu, 19 May 2011 18:25:05 +0000 (11:25 -0700)
Since we pass the nofail arg, we should never get an error; BUG if we do.
(And fix the function to not return an error if __map_request fails.)

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/addr.c
net/ceph/osd_client.c

index 5496726..33da49d 100644 (file)
@@ -848,7 +848,8 @@ get_more_pages:
                op->payload_len = cpu_to_le32(len);
                req->r_request->hdr.data_len = cpu_to_le32(len);
 
-               ceph_osdc_start_request(&fsc->client->osdc, req, true);
+               rc = ceph_osdc_start_request(&fsc->client->osdc, req, true);
+               BUG_ON(rc);
                req = NULL;
 
                /* continue? */
index 9adbb01..caa092e 100644 (file)
@@ -1677,8 +1677,14 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
         */
        if (req->r_sent == 0) {
                rc = __map_request(osdc, req);
-               if (rc < 0)
+               if (rc < 0) {
+                       if (nofail) {
+                               dout("osdc_start_request failed map, "
+                                    " will retry %lld\n", req->r_tid);
+                               rc = 0;
+                       }
                        goto out_unlock;
+               }
                if (req->r_osd == NULL) {
                        dout("send_request %p no up osds in pg\n", req);
                        ceph_monc_request_next_osdmap(&osdc->client->monc);