Skip to contentSkip to conversation

shared/att: Simplify logic of DB out of sync recovery

PATCH Applied Luiz Augusto von Dentz 4 participants 5 messages Feb 24 – Feb 25 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 shared/att: Simplify logic of DB out of sync recovery

From: Luiz Augusto von Dentz <[email protected]>

This removes struct pending_db_sync since it is not really necessary to record all the field in bt_att_pdu_error_rsp, most of them can be directly recovered from the original request and the ecode is meant to be only BT_ATT_ERROR_DB_OUT_OF_SYNC.

---
 src/shared/att.c | 101 ++++++++++++++---------------------------------
 1 file changed, 30 insertions(+), 71 deletions(-)
src/shared/att.c +30 -71
index f6236248874c..3d3c8cfa262a 100644
@@ -35,7 +35,6 @@
 #define BT_ATT_SIGNATURE_LEN		12
 
 struct att_send_op;
-struct pending_db_sync;
 
 struct bt_att_chan {
 	struct bt_att *att;
@@ -48,7 +47,7 @@ struct bt_att_chan {
 
 	struct att_send_op *pending_req;
 	struct att_send_op *pending_ind;
-	struct pending_db_sync *pending_db_sync;
+	struct att_send_op *pending_db_sync;
 	bool writer_active;
 
 	bool in_req;			/* There's a pending incoming request */
@@ -205,11 +204,6 @@ struct att_send_op {
 	void *user_data;
 };
 
-struct pending_db_sync {
-	struct att_send_op *op;
-	struct bt_att_pdu_error_rsp error;
-};
-
 static void destroy_att_send_op(void *data)
 {
 	struct att_send_op *op = data;
@@ -655,10 +649,8 @@ static void bt_att_chan_free(void *data)
 	if (chan->pending_ind)
 		destroy_att_send_op(chan->pending_ind);
 
-	if (chan->pending_db_sync) {
-		destroy_att_send_op(chan->pending_db_sync->op);
-		free(chan->pending_db_sync);
-	}
+	if (chan->pending_db_sync)
+		destroy_att_send_op(chan->pending_db_sync);
 
 	queue_destroy(chan->queue, destroy_att_send_op);
 
@@ -699,8 +691,7 @@ static bool disconnect_cb(struct io *io, void *user_data)
 	}
 
 	if (chan->pending_db_sync) {
-		disc_att_send_op(chan->pending_db_sync->op);
-		free(chan->pending_db_sync);
+		disc_att_send_op(chan->pending_db_sync);
 		chan->pending_db_sync = NULL;
 	}
 
@@ -828,15 +819,6 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
 	/* Check if this is DB_OUT_OF_SYNC and we have a callback */
 	if (rsp->ecode == BT_ATT_ERROR_DB_OUT_OF_SYNC &&
 				att->db_sync_callback) {
-		struct pending_db_sync *pending;
-
-		pending = new0(struct pending_db_sync, 1);
-		if (!pending)
-			return false;
-
-		pending->op = op;
-		pending->error = *rsp;
-
 		/* Remove timeout since we're waiting for approval */
 		if (op->timeout_id) {
 			timeout_remove(op->timeout_id);
@@ -844,13 +826,13 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
 		}
 
 		/* Move to pending_db_sync */
-		chan->pending_db_sync = pending;
+		chan->pending_db_sync = op;
 		chan->pending_req = NULL;
 
 		DBG(att, "(chan %p) DB out of sync for operation %p", chan, op);
 
 		/* Notify upper layer */
-		att->db_sync_callback(&pending->error, op->pdu + 1, op->len - 1,
+		att->db_sync_callback(rsp, op->pdu + 1, op->len - 1,
 				      op->id, att->db_sync_data);
 
 		return true;
@@ -1726,7 +1708,6 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 {
 	const struct queue_entry *entry;
 	struct att_send_op *op;
-	bool from_db_sync = false;
 	bool result;
 
 	if (!att || !id)
@@ -1741,40 +1722,18 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 			break;
 
 		/* Also check pending_db_sync */
-		if (chan->pending_db_sync &&
-				chan->pending_db_sync->op->id == id) {
-			from_db_sync = true;
-			break;
+		if (chan->pending_db_sync && chan->pending_db_sync->id == id) {
+			op = chan->pending_db_sync;
+			chan->pending_db_sync = NULL;
+			DBG(att, "(chan %p) Resending DB out of sync operation"
+				" %p", chan, op);
+			goto done;
 		}
 	}
 
 	if (!entry)
 		return -ENOENT;
 
-	/* If from pending_db_sync, extract operation details if not provided */
-	if (from_db_sync) {
-		struct bt_att_chan *chan = entry->data;
-		struct pending_db_sync *pending = chan->pending_db_sync;
-		struct att_send_op *stored_op = pending->op;
-
-		/* Auto-extract from stored operation if pdu is NULL */
-		if (!pdu) {
-			opcode = stored_op->opcode;
-			pdu = stored_op->pdu + 1;
-			length = stored_op->len - 1;
-			callback = stored_op->callback;
-			user_data = stored_op->user_data;
-			destroy = stored_op->destroy;
-		}
-
-		DBG(att, "(chan %p) Resending DB out of sync operation %p",
-			chan, stored_op);
-
-		/* Clear pending_db_sync state */
-		chan->pending_db_sync = NULL;
-		free(pending);
-	}
-
 	/* Only allow requests to be resend */
 	if (get_op_type(opcode) != ATT_OP_TYPE_REQ)
 		return -EOPNOTSUPP;
@@ -1786,6 +1745,7 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 
 	op->id = id;
 
+done:
 	switch (opcode) {
 	/* Only prepend requests that could be a continuation */
 	case BT_ATT_OP_READ_BLOB_REQ:
@@ -1873,30 +1833,29 @@ bool bt_att_chan_cancel(struct bt_att_chan *chan, unsigned int id)
 
 static bool bt_att_db_sync_cancel(struct bt_att_chan *chan, unsigned int id)
 {
-	if (chan->pending_db_sync && chan->pending_db_sync->op->id == id) {
-		struct pending_db_sync *pending = chan->pending_db_sync;
-		struct att_send_op *op = pending->op;
-		uint8_t error_pdu[sizeof(struct bt_att_pdu_error_rsp)];
+	struct att_send_op *op = chan->pending_db_sync;
+	struct bt_att_pdu_error_rsp rsp;
 
-		/* Build error response PDU */
-		memcpy(error_pdu, &pending->error, sizeof(pending->error));
+	if (!op || op->id != id)
+		return false;
 
-		/* Clear pending state */
-		chan->pending_db_sync = NULL;
-		free(pending);
+	/* Build error response PDU */
+	memset(&rsp, 0, sizeof(rsp));
+	rsp.opcode = op->opcode;
+	rsp.ecode = BT_ATT_ERROR_DB_OUT_OF_SYNC;
 
-		/* Notify callback with error */
-		if (op->callback)
-			op->callback(BT_ATT_OP_ERROR_RSP, error_pdu,
-				     sizeof(error_pdu), op->user_data);
+	/* Clear pending state */
+	chan->pending_db_sync = NULL;
 
-		destroy_att_send_op(op);
-		wakeup_chan_writer(chan, NULL);
+	/* Notify callback with error */
+	if (op->callback)
+		op->callback(BT_ATT_OP_ERROR_RSP, &rsp, sizeof(rsp),
+						op->user_data);
 
-		return true;
-	}
+	destroy_att_send_op(op);
+	wakeup_chan_writer(chan, NULL);
 
-	return false;
+	return true;
 }
 
 static bool bt_att_disc_cancel(struct bt_att *att, unsigned int id)
Signature · 1 line
2.52.0
author maintainer
#1 lore raw

Hi Mengshi,

Quoted 211 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This removes struct pending_db_sync since it is not really necessary to record all the field in bt_att_pdu_error_rsp, most of them can be directly recovered from the original request and the ecode is meant to be only BT_ATT_ERROR_DB_OUT_OF_SYNC.

---
 src/shared/att.c | 101 ++++++++++++++---------------------------------
 1 file changed, 30 insertions(+), 71 deletions(-)
src/shared/att.c +30 -72
index f6236248874c..3d3c8cfa262a 100644
@@ -35,7 +35,6 @@
 #define BT_ATT_SIGNATURE_LEN           12
 
 struct att_send_op;
-struct pending_db_sync;
 
 struct bt_att_chan {
        struct bt_att *att;
@@ -48,7 +47,7 @@ struct bt_att_chan {
 
        struct att_send_op *pending_req;
        struct att_send_op *pending_ind;
-       struct pending_db_sync *pending_db_sync;
+       struct att_send_op *pending_db_sync;
        bool writer_active;
 
        bool in_req;                    /* There's a pending incoming request */
@@ -205,11 +204,6 @@ struct att_send_op {
        void *user_data;
 };
 
-struct pending_db_sync {
-       struct att_send_op *op;
-       struct bt_att_pdu_error_rsp error;
-};
-
 static void destroy_att_send_op(void *data)
 {
        struct att_send_op *op = data;
@@ -655,10 +649,8 @@ static void bt_att_chan_free(void *data)
        if (chan->pending_ind)
                destroy_att_send_op(chan->pending_ind);
 
-       if (chan->pending_db_sync) {
-               destroy_att_send_op(chan->pending_db_sync->op);
-               free(chan->pending_db_sync);
-       }
+       if (chan->pending_db_sync)
+               destroy_att_send_op(chan->pending_db_sync);
 
        queue_destroy(chan->queue, destroy_att_send_op);
 
@@ -699,8 +691,7 @@ static bool disconnect_cb(struct io *io, void *user_data)
        }
 
        if (chan->pending_db_sync) {
-               disc_att_send_op(chan->pending_db_sync->op);
-               free(chan->pending_db_sync);
+               disc_att_send_op(chan->pending_db_sync);
                chan->pending_db_sync = NULL;
        }
 
@@ -828,15 +819,6 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
        /* Check if this is DB_OUT_OF_SYNC and we have a callback */
        if (rsp->ecode == BT_ATT_ERROR_DB_OUT_OF_SYNC &&
                                att->db_sync_callback) {
-               struct pending_db_sync *pending;
-
-               pending = new0(struct pending_db_sync, 1);
-               if (!pending)
-                       return false;
-
-               pending->op = op;
-               pending->error = *rsp;
-
                /* Remove timeout since we're waiting for approval */
                if (op->timeout_id) {
                        timeout_remove(op->timeout_id);
@@ -844,13 +826,13 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
                }
 
                /* Move to pending_db_sync */
-               chan->pending_db_sync = pending;
+               chan->pending_db_sync = op;
                chan->pending_req = NULL;
 
                DBG(att, "(chan %p) DB out of sync for operation %p", chan, op);
 
                /* Notify upper layer */
-               att->db_sync_callback(&pending->error, op->pdu + 1, op->len - 1,
+               att->db_sync_callback(rsp, op->pdu + 1, op->len - 1,
                                      op->id, att->db_sync_data);
 
                return true;
@@ -1726,7 +1708,6 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 {
        const struct queue_entry *entry;
        struct att_send_op *op;
-       bool from_db_sync = false;
        bool result;
 
        if (!att || !id)
@@ -1741,40 +1722,18 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
                        break;
 
                /* Also check pending_db_sync */
-               if (chan->pending_db_sync &&
-                               chan->pending_db_sync->op->id == id) {
-                       from_db_sync = true;
-                       break;
+               if (chan->pending_db_sync && chan->pending_db_sync->id == id) {
+                       op = chan->pending_db_sync;
+                       chan->pending_db_sync = NULL;
+                       DBG(att, "(chan %p) Resending DB out of sync operation"
+                               " %p", chan, op);
+                       goto done;
                }
        }
 
        if (!entry)
                return -ENOENT;
 
-       /* If from pending_db_sync, extract operation details if not provided */
-       if (from_db_sync) {
-               struct bt_att_chan *chan = entry->data;
-               struct pending_db_sync *pending = chan->pending_db_sync;
-               struct att_send_op *stored_op = pending->op;
-
-               /* Auto-extract from stored operation if pdu is NULL */
-               if (!pdu) {
-                       opcode = stored_op->opcode;
-                       pdu = stored_op->pdu + 1;
-                       length = stored_op->len - 1;
-                       callback = stored_op->callback;
-                       user_data = stored_op->user_data;
-                       destroy = stored_op->destroy;
-               }
-
-               DBG(att, "(chan %p) Resending DB out of sync operation %p",
-                       chan, stored_op);
-
-               /* Clear pending_db_sync state */
-               chan->pending_db_sync = NULL;
-               free(pending);
-       }
-
        /* Only allow requests to be resend */
        if (get_op_type(opcode) != ATT_OP_TYPE_REQ)
                return -EOPNOTSUPP;
@@ -1786,6 +1745,7 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 
        op->id = id;
 
+done:
        switch (opcode) {
        /* Only prepend requests that could be a continuation */
        case BT_ATT_OP_READ_BLOB_REQ:
@@ -1873,30 +1833,29 @@ bool bt_att_chan_cancel(struct bt_att_chan *chan, unsigned int id)
 
 static bool bt_att_db_sync_cancel(struct bt_att_chan *chan, unsigned int id)
 {
-       if (chan->pending_db_sync && chan->pending_db_sync->op->id == id) {
-               struct pending_db_sync *pending = chan->pending_db_sync;
-               struct att_send_op *op = pending->op;
-               uint8_t error_pdu[sizeof(struct bt_att_pdu_error_rsp)];
+       struct att_send_op *op = chan->pending_db_sync;
+       struct bt_att_pdu_error_rsp rsp;
 
-               /* Build error response PDU */
-               memcpy(error_pdu, &pending->error, sizeof(pending->error));
+       if (!op || op->id != id)
+               return false;
 
-               /* Clear pending state */
-               chan->pending_db_sync = NULL;
-               free(pending);
+       /* Build error response PDU */
+       memset(&rsp, 0, sizeof(rsp));
+       rsp.opcode = op->opcode;
+       rsp.ecode = BT_ATT_ERROR_DB_OUT_OF_SYNC;
 
-               /* Notify callback with error */
-               if (op->callback)
-                       op->callback(BT_ATT_OP_ERROR_RSP, error_pdu,
-                                    sizeof(error_pdu), op->user_data);
+       /* Clear pending state */
+       chan->pending_db_sync = NULL;
 
-               destroy_att_send_op(op);
-               wakeup_chan_writer(chan, NULL);
+       /* Notify callback with error */
+       if (op->callback)
+               op->callback(BT_ATT_OP_ERROR_RSP, &rsp, sizeof(rsp),
+                                               op->user_data);
 
-               return true;
-       }
+       destroy_att_send_op(op);
+       wakeup_chan_writer(chan, NULL);
 
-       return false;
+       return true;
 }
 
 static bool bt_att_disc_cancel(struct bt_att *att, unsigned int id)
--
Quoted 1 line

2.52.0

Can you verify these changes don't break anything you were testing?

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

Hi Luiz,

Quoted 213 lines · Luiz Augusto von Dentz

Hi Mengshi,

Quoted 209 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This removes struct pending_db_sync since it is not really necessary to record all the field in bt_att_pdu_error_rsp, most of them can be directly recovered from the original request and the ecode is meant to be only BT_ATT_ERROR_DB_OUT_OF_SYNC.

---
 src/shared/att.c | 101 ++++++++++++++---------------------------------
 1 file changed, 30 insertions(+), 71 deletions(-)
src/shared/att.c +30 -71
index f6236248874c..3d3c8cfa262a 100644
@@ -35,7 +35,6 @@
 #define BT_ATT_SIGNATURE_LEN           12
 
 struct att_send_op;
-struct pending_db_sync;
 
 struct bt_att_chan {
        struct bt_att *att;
@@ -48,7 +47,7 @@ struct bt_att_chan {
 
        struct att_send_op *pending_req;
        struct att_send_op *pending_ind;
-       struct pending_db_sync *pending_db_sync;
+       struct att_send_op *pending_db_sync;
        bool writer_active;
 
        bool in_req;                    /* There's a pending incoming request */
@@ -205,11 +204,6 @@ struct att_send_op {
        void *user_data;
 };
 
-struct pending_db_sync {
-       struct att_send_op *op;
-       struct bt_att_pdu_error_rsp error;
-};
-
 static void destroy_att_send_op(void *data)
 {
        struct att_send_op *op = data;
@@ -655,10 +649,8 @@ static void bt_att_chan_free(void *data)
        if (chan->pending_ind)
                destroy_att_send_op(chan->pending_ind);
 
-       if (chan->pending_db_sync) {
-               destroy_att_send_op(chan->pending_db_sync->op);
-               free(chan->pending_db_sync);
-       }
+       if (chan->pending_db_sync)
+               destroy_att_send_op(chan->pending_db_sync);
 
        queue_destroy(chan->queue, destroy_att_send_op);
 
@@ -699,8 +691,7 @@ static bool disconnect_cb(struct io *io, void *user_data)
        }
 
        if (chan->pending_db_sync) {
-               disc_att_send_op(chan->pending_db_sync->op);
-               free(chan->pending_db_sync);
+               disc_att_send_op(chan->pending_db_sync);
                chan->pending_db_sync = NULL;
        }
 
@@ -828,15 +819,6 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
        /* Check if this is DB_OUT_OF_SYNC and we have a callback */
        if (rsp->ecode == BT_ATT_ERROR_DB_OUT_OF_SYNC &&
                                att->db_sync_callback) {
-               struct pending_db_sync *pending;
-
-               pending = new0(struct pending_db_sync, 1);
-               if (!pending)
-                       return false;
-
-               pending->op = op;
-               pending->error = *rsp;
-
                /* Remove timeout since we're waiting for approval */
                if (op->timeout_id) {
                        timeout_remove(op->timeout_id);
@@ -844,13 +826,13 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
                }
 
                /* Move to pending_db_sync */
-               chan->pending_db_sync = pending;
+               chan->pending_db_sync = op;
                chan->pending_req = NULL;
 
                DBG(att, "(chan %p) DB out of sync for operation %p", chan, op);
 
                /* Notify upper layer */
-               att->db_sync_callback(&pending->error, op->pdu + 1, op->len - 1,
+               att->db_sync_callback(rsp, op->pdu + 1, op->len - 1,
                                      op->id, att->db_sync_data);
 
                return true;
@@ -1726,7 +1708,6 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 {
        const struct queue_entry *entry;
        struct att_send_op *op;
-       bool from_db_sync = false;
        bool result;
 
        if (!att || !id)
@@ -1741,40 +1722,18 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
                        break;
 
                /* Also check pending_db_sync */
-               if (chan->pending_db_sync &&
-                               chan->pending_db_sync->op->id == id) {
-                       from_db_sync = true;
-                       break;
+               if (chan->pending_db_sync && chan->pending_db_sync->id == id) {
+                       op = chan->pending_db_sync;
+                       chan->pending_db_sync = NULL;
+                       DBG(att, "(chan %p) Resending DB out of sync operation"
+                               " %p", chan, op);
+                       goto done;
                }
        }
 
        if (!entry)
                return -ENOENT;
 
-       /* If from pending_db_sync, extract operation details if not provided */
-       if (from_db_sync) {
-               struct bt_att_chan *chan = entry->data;
-               struct pending_db_sync *pending = chan->pending_db_sync;
-               struct att_send_op *stored_op = pending->op;
-
-               /* Auto-extract from stored operation if pdu is NULL */
-               if (!pdu) {
-                       opcode = stored_op->opcode;
-                       pdu = stored_op->pdu + 1;
-                       length = stored_op->len - 1;
-                       callback = stored_op->callback;
-                       user_data = stored_op->user_data;
-                       destroy = stored_op->destroy;
-               }
-
-               DBG(att, "(chan %p) Resending DB out of sync operation %p",
-                       chan, stored_op);
-
-               /* Clear pending_db_sync state */
-               chan->pending_db_sync = NULL;
-               free(pending);
-       }
-
        /* Only allow requests to be resend */
        if (get_op_type(opcode) != ATT_OP_TYPE_REQ)
                return -EOPNOTSUPP;
@@ -1786,6 +1745,7 @@ int bt_att_resend(struct bt_att *att, unsigned int id, uint8_t opcode,
 
        op->id = id;
 
+done:
        switch (opcode) {
        /* Only prepend requests that could be a continuation */
        case BT_ATT_OP_READ_BLOB_REQ:
@@ -1873,30 +1833,29 @@ bool bt_att_chan_cancel(struct bt_att_chan *chan, unsigned int id)
 
 static bool bt_att_db_sync_cancel(struct bt_att_chan *chan, unsigned int id)
 {
-       if (chan->pending_db_sync && chan->pending_db_sync->op->id == id) {
-               struct pending_db_sync *pending = chan->pending_db_sync;
-               struct att_send_op *op = pending->op;
-               uint8_t error_pdu[sizeof(struct bt_att_pdu_error_rsp)];
+       struct att_send_op *op = chan->pending_db_sync;
+       struct bt_att_pdu_error_rsp rsp;
 
-               /* Build error response PDU */
-               memcpy(error_pdu, &pending->error, sizeof(pending->error));
+       if (!op || op->id != id)
+               return false;
 
-               /* Clear pending state */
-               chan->pending_db_sync = NULL;
-               free(pending);
+       /* Build error response PDU */
+       memset(&rsp, 0, sizeof(rsp));
+       rsp.opcode = op->opcode;
+       rsp.ecode = BT_ATT_ERROR_DB_OUT_OF_SYNC;
 
-               /* Notify callback with error */
-               if (op->callback)
-                       op->callback(BT_ATT_OP_ERROR_RSP, error_pdu,
-                                    sizeof(error_pdu), op->user_data);
+       /* Clear pending state */
+       chan->pending_db_sync = NULL;
 
-               destroy_att_send_op(op);
-               wakeup_chan_writer(chan, NULL);
+       /* Notify callback with error */
+       if (op->callback)
+               op->callback(BT_ATT_OP_ERROR_RSP, &rsp, sizeof(rsp),
+                                               op->user_data);
 
-               return true;
-       }
+       destroy_att_send_op(op);
+       wakeup_chan_writer(chan, NULL);
 
-       return false;
+       return true;
 }
 
Quoted 6 lines
Quoted 3 lines
src/shared/att.c +0 -1
 static bool bt_att_disc_cancel(struct bt_att *att, unsigned int id)
--

2.52.0

Can you verify these changes don't break anything you were testing?

I have verified these changes, and they work as expected. Thank you for kindly helping to simplify and improve the implementation.

Hash Match Case:
------------------
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 7

      ATT: Read Request (0x0a) len 2
        Handle: 0x000d
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read Request (0x0a)
        Handle: 0x000d
        Error: Database Out of Sync (0x12)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Database Hash (0x2b2a)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 24

      ATT: Read By Type Response (0x09) len 19
        Attribute data length: 18
        Attribute data list: 1 entry
        Handle: 0x000f
        Value: f74347d19eef647d97f0b2f7af502e33
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0010-0xffff
        Attribute type: Database Hash (0x2b2a)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0010
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 7
      ATT: Read Request (0x0a) len 2
        Handle: 0x000d
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 6

      ATT: Read Response (0x0b) len 1

-------------

Hash differ case:
-------------
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 7

      ATT: Read Request (0x0a) len 2
        Handle: 0x000d
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read Request (0x0a)
        Handle: 0x000d
        Error: Database Out of Sync (0x12)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Database Hash (0x2b2a)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 24

      ATT: Read By Type Response (0x09) len 19
        Attribute data length: 18
        Attribute data list: 1 entry
        Handle: 0x000f
        Value: 3a6ba4cd08cf5b7f96e542822cb1b4e5
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0010-0xffff
        Attribute type: Database Hash (0x2b2a)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0010
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 24

      ATT: Read By Group Type Response (0x11) len 19
        Attribute data length: 6
        Attribute group list: 3 entries
        Handle range: 0x0001-0x0007
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0008-0x0011
        UUID: Generic Attribute Profile (0x1801)
        Handle range: 0x0012-0x0014
        UUID: Device Information (0x180a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0015-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 26

      ATT: Read By Group Type Response (0x11) len 21
        Attribute data length: 20
        Attribute group list: 1 entry
        Handle range: 0x0025-0x0028
        UUID: Vendor specific (12345678-1234-5678-1234-56789abcdef0)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0029-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x0029
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Secondary Service (0x2801)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x0001
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0015-0x0028
        Attribute type: Include (0x2802)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0015
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0015-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 27

      ATT: Read By Type Response (0x09) len 22
        Attribute data length: 21
        Attribute data list: 1 entry
        Handle: 0x0026
        Value: 1a2700f1debc9a785634127856341278563412
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0027-0x0028
        Attribute type: Characteristic (0x2803)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0027
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0001-0xffff
        Attribute type: Database Hash (0x2b2a)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 24

      ATT: Read By Type Response (0x09) len 19
        Attribute data length: 18
        Attribute data list: 1 entry
        Handle: 0x000f
        Value: 3a6ba4cd08cf5b7f96e542822cb1b4e5
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0010-0xffff
        Attribute type: Database Hash (0x2b2a)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 9

      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0010
        Error: Attribute Not Found (0x0a)
bluetoothd[17265]: < ACL Data TX: Handle 4 flags 0x00 dlen 9
      ATT: Write Request (0x12) len 4
        Handle: 0x000b
          Data: 0200
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 4
Count: 1

Quoted 1 line

ACL Data RX: Handle 4 flags 0x02 dlen 5

      ATT: Write Response (0x13) len 0
#3 lore raw
In reply to Luiz Augusto von Dentz

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1057371

---Test result---

Test Summary:

CheckPatch                    PENDING   0.31 seconds
GitLint                       PENDING   0.33 seconds
BuildEll                      PASS      20.67 seconds
BluezMake                     PASS      651.10 seconds
MakeCheck                     PASS      18.39 seconds
MakeDistcheck                 PASS      247.57 seconds
CheckValgrind                 PASS      295.74 seconds
CheckSmatch                   PASS      351.00 seconds
bluezmakeextell               PASS      181.56 seconds
IncrementalBuild              PENDING   0.35 seconds
ScanBuild                     PASS      1036.62 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#4 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Tue, 24 Feb 2026 13:55:24 -0500 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

This removes struct pending_db_sync since it is not really necessary to record all the field in bt_att_pdu_error_rsp, most of them can be directly recovered from the original request and the ecode is meant to be only BT_ATT_ERROR_DB_OUT_OF_SYNC.

[...]

Here is the summary with links:
- [BlueZ,v1] shared/att: Simplify logic of DB out of sync recovery

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a96f5f4eba9a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html