aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ceph/osd_client.h4
-rw-r--r--net/ceph/osd_client.c21
2 files changed, 12 insertions, 13 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 85650b415e73..ef630ebd1169 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -148,6 +148,8 @@ struct ceph_osd_request_target {
148 unsigned int flags; /* CEPH_OSD_FLAG_* */ 148 unsigned int flags; /* CEPH_OSD_FLAG_* */
149 bool paused; 149 bool paused;
150 150
151 u32 last_force_resend;
152
151 int osd; 153 int osd;
152}; 154};
153 155
@@ -193,7 +195,6 @@ struct ceph_osd_request {
193 unsigned long r_stamp; /* jiffies, send or check time */ 195 unsigned long r_stamp; /* jiffies, send or check time */
194 unsigned long r_start_stamp; /* jiffies */ 196 unsigned long r_start_stamp; /* jiffies */
195 int r_attempts; 197 int r_attempts;
196 u32 r_last_force_resend;
197 u32 r_map_dne_bound; 198 u32 r_map_dne_bound;
198 199
199 struct ceph_osd_req_op r_ops[]; 200 struct ceph_osd_req_op r_ops[];
@@ -221,7 +222,6 @@ struct ceph_osd_linger_request {
221 struct list_head pending_lworks; 222 struct list_head pending_lworks;
222 223
223 struct ceph_osd_request_target t; 224 struct ceph_osd_request_target t;
224 u32 last_force_resend;
225 u32 map_dne_bound; 225 u32 map_dne_bound;
226 226
227 struct timespec mtime; 227 struct timespec mtime;
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 924f07c36ddb..aca6319b99b6 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -384,6 +384,8 @@ static void target_copy(struct ceph_osd_request_target *dest,
384 dest->flags = src->flags; 384 dest->flags = src->flags;
385 dest->paused = src->paused; 385 dest->paused = src->paused;
386 386
387 dest->last_force_resend = src->last_force_resend;
388
387 dest->osd = src->osd; 389 dest->osd = src->osd;
388} 390}
389 391
@@ -1311,7 +1313,6 @@ enum calc_target_result {
1311 1313
1312static enum calc_target_result calc_target(struct ceph_osd_client *osdc, 1314static enum calc_target_result calc_target(struct ceph_osd_client *osdc,
1313 struct ceph_osd_request_target *t, 1315 struct ceph_osd_request_target *t,
1314 u32 *last_force_resend,
1315 bool any_change) 1316 bool any_change)
1316{ 1317{
1317 struct ceph_pg_pool_info *pi; 1318 struct ceph_pg_pool_info *pi;
@@ -1332,11 +1333,10 @@ static enum calc_target_result calc_target(struct ceph_osd_client *osdc,
1332 } 1333 }
1333 1334
1334 if (osdc->osdmap->epoch == pi->last_force_request_resend) { 1335 if (osdc->osdmap->epoch == pi->last_force_request_resend) {
1335 if (last_force_resend && 1336 if (t->last_force_resend < pi->last_force_request_resend) {
1336 *last_force_resend < pi->last_force_request_resend) { 1337 t->last_force_resend = pi->last_force_request_resend;
1337 *last_force_resend = pi->last_force_request_resend;
1338 force_resend = true; 1338 force_resend = true;
1339 } else if (!last_force_resend) { 1339 } else if (t->last_force_resend == 0) {
1340 force_resend = true; 1340 force_resend = true;
1341 } 1341 }
1342 } 1342 }
@@ -1645,7 +1645,7 @@ static void __submit_request(struct ceph_osd_request *req, bool wrlocked)
1645 dout("%s req %p wrlocked %d\n", __func__, req, wrlocked); 1645 dout("%s req %p wrlocked %d\n", __func__, req, wrlocked);
1646 1646
1647again: 1647again:
1648 ct_res = calc_target(osdc, &req->r_t, &req->r_last_force_resend, false); 1648 ct_res = calc_target(osdc, &req->r_t, false);
1649 if (ct_res == CALC_TARGET_POOL_DNE && !wrlocked) 1649 if (ct_res == CALC_TARGET_POOL_DNE && !wrlocked)
1650 goto promote; 1650 goto promote;
1651 1651
@@ -2441,7 +2441,7 @@ static void linger_submit(struct ceph_osd_linger_request *lreq)
2441 struct ceph_osd_client *osdc = lreq->osdc; 2441 struct ceph_osd_client *osdc = lreq->osdc;
2442 struct ceph_osd *osd; 2442 struct ceph_osd *osd;
2443 2443
2444 calc_target(osdc, &lreq->t, &lreq->last_force_resend, false); 2444 calc_target(osdc, &lreq->t, false);
2445 osd = lookup_create_osd(osdc, lreq->t.osd, true); 2445 osd = lookup_create_osd(osdc, lreq->t.osd, true);
2446 link_linger(osd, lreq); 2446 link_linger(osd, lreq);
2447 2447
@@ -3059,7 +3059,7 @@ recalc_linger_target(struct ceph_osd_linger_request *lreq)
3059 struct ceph_osd_client *osdc = lreq->osdc; 3059 struct ceph_osd_client *osdc = lreq->osdc;
3060 enum calc_target_result ct_res; 3060 enum calc_target_result ct_res;
3061 3061
3062 ct_res = calc_target(osdc, &lreq->t, &lreq->last_force_resend, true); 3062 ct_res = calc_target(osdc, &lreq->t, true);
3063 if (ct_res == CALC_TARGET_NEED_RESEND) { 3063 if (ct_res == CALC_TARGET_NEED_RESEND) {
3064 struct ceph_osd *osd; 3064 struct ceph_osd *osd;
3065 3065
@@ -3130,8 +3130,7 @@ static void scan_requests(struct ceph_osd *osd,
3130 n = rb_next(n); /* unlink_request(), check_pool_dne() */ 3130 n = rb_next(n); /* unlink_request(), check_pool_dne() */
3131 3131
3132 dout("%s req %p tid %llu\n", __func__, req, req->r_tid); 3132 dout("%s req %p tid %llu\n", __func__, req, req->r_tid);
3133 ct_res = calc_target(osdc, &req->r_t, 3133 ct_res = calc_target(osdc, &req->r_t, false);
3134 &req->r_last_force_resend, false);
3135 switch (ct_res) { 3134 switch (ct_res) {
3136 case CALC_TARGET_NO_ACTION: 3135 case CALC_TARGET_NO_ACTION:
3137 force_resend_writes = cleared_full || 3136 force_resend_writes = cleared_full ||
@@ -3240,7 +3239,7 @@ static void kick_requests(struct ceph_osd_client *osdc,
3240 erase_request(need_resend, req); /* before link_request() */ 3239 erase_request(need_resend, req); /* before link_request() */
3241 3240
3242 WARN_ON(req->r_osd); 3241 WARN_ON(req->r_osd);
3243 calc_target(osdc, &req->r_t, NULL, false); 3242 calc_target(osdc, &req->r_t, false);
3244 osd = lookup_create_osd(osdc, req->r_t.osd, true); 3243 osd = lookup_create_osd(osdc, req->r_t.osd, true);
3245 link_request(osd, req); 3244 link_request(osd, req);
3246 if (!req->r_linger) { 3245 if (!req->r_linger) {