diff options
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 02212ed50852..50af02737a3d 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -837,8 +837,7 @@ static void __unregister_request(struct ceph_osd_client *osdc, | |||
837 | dout("moving osd to %p lru\n", req->r_osd); | 837 | dout("moving osd to %p lru\n", req->r_osd); |
838 | __move_osd_to_lru(osdc, req->r_osd); | 838 | __move_osd_to_lru(osdc, req->r_osd); |
839 | } | 839 | } |
840 | if (list_empty(&req->r_osd_item) && | 840 | if (list_empty(&req->r_linger_item)) |
841 | list_empty(&req->r_linger_item)) | ||
842 | req->r_osd = NULL; | 841 | req->r_osd = NULL; |
843 | } | 842 | } |
844 | 843 | ||
@@ -883,7 +882,8 @@ static void __unregister_linger_request(struct ceph_osd_client *osdc, | |||
883 | dout("moving osd to %p lru\n", req->r_osd); | 882 | dout("moving osd to %p lru\n", req->r_osd); |
884 | __move_osd_to_lru(osdc, req->r_osd); | 883 | __move_osd_to_lru(osdc, req->r_osd); |
885 | } | 884 | } |
886 | req->r_osd = NULL; | 885 | if (list_empty(&req->r_osd_item)) |
886 | req->r_osd = NULL; | ||
887 | } | 887 | } |
888 | } | 888 | } |
889 | 889 | ||
@@ -917,7 +917,7 @@ EXPORT_SYMBOL(ceph_osdc_set_request_linger); | |||
917 | /* | 917 | /* |
918 | * Pick an osd (the first 'up' osd in the pg), allocate the osd struct | 918 | * Pick an osd (the first 'up' osd in the pg), allocate the osd struct |
919 | * (as needed), and set the request r_osd appropriately. If there is | 919 | * (as needed), and set the request r_osd appropriately. If there is |
920 | * no up osd, set r_osd to NULL. Move the request to the appropiate list | 920 | * no up osd, set r_osd to NULL. Move the request to the appropriate list |
921 | * (unsent, homeless) or leave on in-flight lru. | 921 | * (unsent, homeless) or leave on in-flight lru. |
922 | * | 922 | * |
923 | * Return 0 if unchanged, 1 if changed, or negative on error. | 923 | * Return 0 if unchanged, 1 if changed, or negative on error. |
@@ -1602,11 +1602,11 @@ void handle_watch_notify(struct ceph_osd_client *osdc, struct ceph_msg *msg) | |||
1602 | cookie, ver, event); | 1602 | cookie, ver, event); |
1603 | if (event) { | 1603 | if (event) { |
1604 | event_work = kmalloc(sizeof(*event_work), GFP_NOIO); | 1604 | event_work = kmalloc(sizeof(*event_work), GFP_NOIO); |
1605 | INIT_WORK(&event_work->work, do_event_work); | ||
1606 | if (!event_work) { | 1605 | if (!event_work) { |
1607 | dout("ERROR: could not allocate event_work\n"); | 1606 | dout("ERROR: could not allocate event_work\n"); |
1608 | goto done_err; | 1607 | goto done_err; |
1609 | } | 1608 | } |
1609 | INIT_WORK(&event_work->work, do_event_work); | ||
1610 | event_work->event = event; | 1610 | event_work->event = event; |
1611 | event_work->ver = ver; | 1611 | event_work->ver = ver; |
1612 | event_work->notify_id = notify_id; | 1612 | event_work->notify_id = notify_id; |
@@ -1672,7 +1672,7 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, | |||
1672 | if (req->r_sent == 0) { | 1672 | if (req->r_sent == 0) { |
1673 | rc = __map_request(osdc, req); | 1673 | rc = __map_request(osdc, req); |
1674 | if (rc < 0) | 1674 | if (rc < 0) |
1675 | return rc; | 1675 | goto out_unlock; |
1676 | if (req->r_osd == NULL) { | 1676 | if (req->r_osd == NULL) { |
1677 | dout("send_request %p no up osds in pg\n", req); | 1677 | dout("send_request %p no up osds in pg\n", req); |
1678 | ceph_monc_request_next_osdmap(&osdc->client->monc); | 1678 | ceph_monc_request_next_osdmap(&osdc->client->monc); |
@@ -1689,6 +1689,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, | |||
1689 | } | 1689 | } |
1690 | } | 1690 | } |
1691 | } | 1691 | } |
1692 | |||
1693 | out_unlock: | ||
1692 | mutex_unlock(&osdc->request_mutex); | 1694 | mutex_unlock(&osdc->request_mutex); |
1693 | up_read(&osdc->map_sem); | 1695 | up_read(&osdc->map_sem); |
1694 | return rc; | 1696 | return rc; |