Skip to contentSkip to conversation

libceph: target_copy() fixups

PATCH In review Ilya Dryomov 2 participants 5 messages Jun 16, 2020 Ceph common code (libceph)

lore
Share & tools
lore

Ilya Dryomov

author maintainer
#0 lore raw

cover libceph: target_copy() fixups

Hello,

Split into three commits for backporting reasons: the first two can be picked up by stable, the third should get some soak time in testing.

Thanks,

Ilya

Ilya Dryomov (3):
libceph: don't omit recovery_deletes in target_copy()
libceph: don't omit used_replica in target_copy()
libceph: use target_copy() in send_linger()

 net/ceph/osd_client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.19.2
author maintainer
#1 lore raw

PATCH 1/3 libceph: don't omit recovery_deletes in target_copy()

Currently target_copy() is used only for sending linger pings, so this doesn't come up, but generally omitting recovery_deletes can result in unneeded resends (force_resend in calc_target()).

Fixes ae78dd8139ce ("libceph: make RECOVERY_DELETES feature create a new interval")
---
 net/ceph/osd_client.c | 1 +
 1 file changed, 1 insertion(+)
net/ceph/osd_client.c +1 -0
index a37d159019a0..8f7fbe861dff 100644
@@ -445,6 +445,7 @@ static void target_copy(struct ceph_osd_request_target *dest,
 	dest->size = src->size;
 	dest->min_size = src->min_size;
 	dest->sort_bitwise = src->sort_bitwise;
+	dest->recovery_deletes = src->recovery_deletes;
 
 	dest->flags = src->flags;
 	dest->paused = src->paused;
Signature · 1 line
2.19.2
author maintainer
#2 lore raw

PATCH 2/3 libceph: don't omit used_replica in target_copy()

In reply to Ilya Dryomov

Currently target_copy() is used only for sending linger pings, so this doesn't come up, but generally omitting used_replica can hang the client as we wouldn't notice the acting set change (legacy_change in calc_target()) or trigger a warning in handle_reply().

Fixes 117d96a04f00 ("libceph: support for balanced and localized reads")
---
 net/ceph/osd_client.c | 1 +
 1 file changed, 1 insertion(+)
net/ceph/osd_client.c +1 -0
index 8f7fbe861dff..2db8b44e70c2 100644
@@ -448,6 +448,7 @@ static void target_copy(struct ceph_osd_request_target *dest,
 	dest->recovery_deletes = src->recovery_deletes;
 
 	dest->flags = src->flags;
+	dest->used_replica = src->used_replica;
 	dest->paused = src->paused;
 
 	dest->epoch = src->epoch;
Signature · 1 line
2.19.2
author maintainer
#3 lore raw

PATCH 3/3 libceph: use target_copy() in send_linger()

In reply to Ilya Dryomov

Instead of copying just oloc, oid and flags, copy the entire linger target. This is more for consistency than anything else, as send_linger() -> submit_request() -> __submit_request() sends the request regardless of what calc_target() says (i.e. both on CALC_TARGET_NO_ACTION and CALC_TARGET_NEED_RESEND).

---
 net/ceph/osd_client.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/ceph/osd_client.c +1 -3
index 2db8b44e70c2..db6abb5a5511 100644
@@ -3076,9 +3076,7 @@ static void send_linger(struct ceph_osd_linger_request *lreq)
 		cancel_linger_request(req);
 
 	request_reinit(req);
-	ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid);
-	ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc);
-	req->r_flags = lreq->t.flags;
+	target_copy(&req->r_t, &lreq->t);
 	req->r_mtime = lreq->mtime;
 
 	mutex_lock(&lreq->lock);
Signature · 1 line
2.19.2
Reviewed-by on the v1 series
#4 lore raw
In reply to Ilya Dryomov
Quoted 10 lines · Ilya Dryomov

Hello,

Split into three commits for backporting reasons: the first two can be picked up by stable, the third should get some soak time in testing.

Thanks,

Ilya

Quoted 8 lines

Ilya Dryomov (3):
libceph: don't omit recovery_deletes in target_copy()
libceph: don't omit used_replica in target_copy()
libceph: use target_copy() in send_linger()

 net/ceph/osd_client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

These all look sane to me: