zblue: Treat -EALREADY as success for ACL connection reply#540
Open
zhongzhijie1 wants to merge 1 commit intoopen-vela:devfrom
Open
zblue: Treat -EALREADY as success for ACL connection reply#540zhongzhijie1 wants to merge 1 commit intoopen-vela:devfrom
zhongzhijie1 wants to merge 1 commit intoopen-vela:devfrom
Conversation
bug: v/81923 zblue now returns -EALREADY when ACL connection reply is sent more than once. SAL layer should not log error for this expected case. Signed-off-by: zhongzhijie1 <[email protected]>
53b5077 to
4079b48
Compare
chengkai15
reviewed
Mar 23, 2026
Contributor
chengkai15
left a comment
There was a problem hiding this comment.
PR #540 Review — Treat -EALREADY as success for ACL connection reply
depends on: open-vela/external_zblue/pull/205
✅ 改动分析:
- 原来用
SAL_CHECK(bt_conn_accept_acl_conn(conn), 0)— 任何非零都报错 - 现在改为显式检查
ret != -EALREADY才打 error log -EALREADY是预期行为(多 app 重复 accept/reject),不应当 error
- PR #205:底层返回
-EALREADY标识重复回复 - PR #540:SAL 层识别
-EALREADY并静默跳过 - 两层配合,既保证了 HCI 命令不重复发送,又不产生误报 error log
if (ret && ret != -EALREADY)
BT_LOGE("%s, accept return:%d", __func__, ret);这里的条件判断是 ret && ret != -EALREADY,即:
ret == 0:首次成功,不打 log(正确)ret == -EALREADY:重复回复被跳过,不打 log(正确,预期行为)ret == 其他负值:真正的错误,打 error log(正确)
逻辑完全正确。
整体评价:✅ LGTM — 和 PR #205 配合完美,修复链路完整。
Contributor
|
@zhongzhijie1 Review 已完成,和 PR #205 配合完整。请确认 comments,确认后我会通知 owner 进行二次 review。 |
chengkai15
approved these changes
Mar 26, 2026
Contributor
chengkai15
left a comment
There was a problem hiding this comment.
PR #540 Review — Treat -EALREADY as success for ACL connection reply
概述: 1 文件 10+/3-,zblue 返回 -EALREADY 时不再记录错误日志。依赖 external_zblue/pull/205。
✅ 优点
- 根因准确:重复 accept/reject 返回 -EALREADY 是预期行为,不是错误
- 修复正确:仅在 ret 非 0 且非 -EALREADY 时记录错误
- 影响最小
⚠️ 关注
- 依赖 external_zblue/pull/205,需确认上游已合并
- 建议:-EALREADY 情况用 BT_LOGD 或 BT_LOGW 记录,便于排查重复调用来源
📋 结论
修复正确。APPROVE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
depends-on: [open-vela/external_zblue/pull/205]
bug: v/81923
zblue now returns -EALREADY when ACL connection reply is sent more
than once. SAL layer should not log error for this expected case.
Signed-off-by: zhongzhijie1 [email protected]