Skip to contentSkip to conversation

libceph: initialize ack_stamp to avoid unnecessary connection reset

PATCH New Jim Schutt 1 participant 1 message Sep 16, 2011 Ceph common code (libceph)

lore
Share & tools
lore

Jim Schutt

author
#0 lore raw

PATCH 1/1 libceph: initialize ack_stamp to avoid unnecessary connection reset

Commit 4cf9d544631c recorded when an outgoing ceph message was ACKed, in order to avoid unnecessary connection resets when an OSD is busy.

However, ack_stamp is uninitialized, so there is a window between when the message is sent and when it is ACKed in which handle_timeout() interprets the unitialized value as an expired timeout, and resets the connection unnecessarily.

Close the window by initializing ack_stamp.

---
 net/ceph/messenger.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ceph/messenger.c +1 -0
index e6d4857..f56aca3 100644
@@ -2308,6 +2308,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
 	m->front_max = front_len;
 	m->front_is_vmalloc = false;
 	m->more_to_follow = false;
+	m->ack_stamp = 0;
 	m->pool = NULL;
 
 	/* middle */
Signature · 1 line
1.7.1