aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-12-26 15:31:40 -0500
committerAlex Elder <elder@inktank.com>2012-12-27 21:27:04 -0500
commite6d50f67a6b1a6252a616e6e629473b5c4277218 (patch)
treeff0ca019ba50a5f65d12d628af0aee2695d5219b /net/ceph/osd_client.c
parentab60b16d3c31b9bd9fd5b39f97dc42c52a50b67d (diff)
libceph: always reset osds when kicking
When ceph_osdc_handle_map() is called to process a new osd map, kick_requests() is called to ensure all affected requests are updated if necessary to reflect changes in the osd map. This happens in two cases: whenever an incremental map update is processed; and when a full map update (or the last one if there is more than one) gets processed. In the former case, the kick_requests() call is followed immediately by a call to reset_changed_osds() to ensure any connections to osds affected by the map change are reset. But for full map updates this isn't done. Both cases should be doing this osd reset. Rather than duplicating the reset_changed_osds() call, move it into the end of kick_requests(). Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 0174c04edac0..eb9a44478764 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1270,7 +1270,7 @@ static void reset_changed_osds(struct ceph_osd_client *osdc)
1270 * Requeue requests whose mapping to an OSD has changed. If requests map to 1270 * Requeue requests whose mapping to an OSD has changed. If requests map to
1271 * no osd, request a new map. 1271 * no osd, request a new map.
1272 * 1272 *
1273 * Caller should hold map_sem for read and request_mutex. 1273 * Caller should hold map_sem for read.
1274 */ 1274 */
1275static void kick_requests(struct ceph_osd_client *osdc, int force_resend) 1275static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
1276{ 1276{
@@ -1345,6 +1345,7 @@ static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
1345 dout("%d requests for down osds, need new map\n", needmap); 1345 dout("%d requests for down osds, need new map\n", needmap);
1346 ceph_monc_request_next_osdmap(&osdc->client->monc); 1346 ceph_monc_request_next_osdmap(&osdc->client->monc);
1347 } 1347 }
1348 reset_changed_osds(osdc);
1348} 1349}
1349 1350
1350 1351
@@ -1401,7 +1402,6 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
1401 osdc->osdmap = newmap; 1402 osdc->osdmap = newmap;
1402 } 1403 }
1403 kick_requests(osdc, 0); 1404 kick_requests(osdc, 0);
1404 reset_changed_osds(osdc);
1405 } else { 1405 } else {
1406 dout("ignoring incremental map %u len %d\n", 1406 dout("ignoring incremental map %u len %d\n",
1407 epoch, maplen); 1407 epoch, maplen);