Skip to content

Commit 086e8dd

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull two Ceph fixes from Sage Weil: "These fix an issue with the RBD notifications when there are topology changes in the cluster" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: Revert "libceph: clear r_req_lru_item in __unregister_linger_request()" libceph: request a new osdmap if lingering request maps to no osd
2 parents 7ce14f6 + 521a04d commit 086e8dd

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

net/ceph/osd_client.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,8 +1306,6 @@ static void __unregister_linger_request(struct ceph_osd_client *osdc,
13061306
if (list_empty(&req->r_osd_item))
13071307
req->r_osd = NULL;
13081308
}
1309-
1310-
list_del_init(&req->r_req_lru_item); /* can be on notarget */
13111309
ceph_osdc_put_request(req);
13121310
}
13131311

@@ -2017,20 +2015,29 @@ static void kick_requests(struct ceph_osd_client *osdc, bool force_resend,
20172015
err = __map_request(osdc, req,
20182016
force_resend || force_resend_writes);
20192017
dout("__map_request returned %d\n", err);
2020-
if (err == 0)
2021-
continue; /* no change and no osd was specified */
20222018
if (err < 0)
20232019
continue; /* hrm! */
2024-
if (req->r_osd == NULL) {
2025-
dout("tid %llu maps to no valid osd\n", req->r_tid);
2026-
needmap++; /* request a newer map */
2027-
continue;
2028-
}
2020+
if (req->r_osd == NULL || err > 0) {
2021+
if (req->r_osd == NULL) {
2022+
dout("lingering %p tid %llu maps to no osd\n",
2023+
req, req->r_tid);
2024+
/*
2025+
* A homeless lingering request makes
2026+
* no sense, as it's job is to keep
2027+
* a particular OSD connection open.
2028+
* Request a newer map and kick the
2029+
* request, knowing that it won't be
2030+
* resent until we actually get a map
2031+
* that can tell us where to send it.
2032+
*/
2033+
needmap++;
2034+
}
20292035

2030-
dout("kicking lingering %p tid %llu osd%d\n", req, req->r_tid,
2031-
req->r_osd ? req->r_osd->o_osd : -1);
2032-
__register_request(osdc, req);
2033-
__unregister_linger_request(osdc, req);
2036+
dout("kicking lingering %p tid %llu osd%d\n", req,
2037+
req->r_tid, req->r_osd ? req->r_osd->o_osd : -1);
2038+
__register_request(osdc, req);
2039+
__unregister_linger_request(osdc, req);
2040+
}
20342041
}
20352042
reset_changed_osds(osdc);
20362043
mutex_unlock(&osdc->request_mutex);

0 commit comments

Comments
 (0)