All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/4] btio: Handle EOPNOTSUPP from accept() to prevent busy loop
@ 2026-06-09 18:53 Luiz Augusto von Dentz
  2026-06-09 18:53 ` [PATCH BlueZ v2 2/4] profile: Check if bearer is enabled on registration Luiz Augusto von Dentz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2026-06-09 18:53 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When accept() returns EOPNOTSUPP on an L2CAP SEQPACKET server socket
(e.g. AVCTP browsing channel, PSM 0x1b), the error is permanent and
retrying will never succeed. Previously, only EBADFD was treated as
fatal, causing server_cb to return TRUE for EOPNOTSUPP. Since the fd
remains readable, this creates an infinite busy loop that hangs
bluetoothd.

Treat EOPNOTSUPP the same as EBADFD by returning FALSE to remove the
GLib IO watch and stop the loop.
---
 btio/btio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btio/btio.c b/btio/btio.c
index 39d4411f790b..4c69d60350f8 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -274,7 +274,7 @@ static gboolean server_cb(GIOChannel *io, GIOCondition cond,
 
 	cli_sock = accept(srv_sock, NULL, NULL);
 	if (cli_sock < 0) {
-		if (errno == EBADFD)
+		if (errno == EBADFD || errno == EOPNOTSUPP)
 			return FALSE;
 		return TRUE;
 	}
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-10 18:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 18:53 [PATCH BlueZ v2 1/4] btio: Handle EOPNOTSUPP from accept() to prevent busy loop Luiz Augusto von Dentz
2026-06-09 18:53 ` [PATCH BlueZ v2 2/4] profile: Check if bearer is enabled on registration Luiz Augusto von Dentz
2026-06-09 18:53 ` [PATCH BlueZ v2 3/4] plugins: Check btd_profile_register return value Luiz Augusto von Dentz
2026-06-09 18:53 ` [PATCH BlueZ v2 4/4] bearer: Check btd_opts.mode on btd_bearer_new Luiz Augusto von Dentz
2026-06-09 21:31 ` [BlueZ,v2,1/4] btio: Handle EOPNOTSUPP from accept() to prevent busy loop bluez.test.bot
2026-06-10 18:30 ` [PATCH BlueZ v2 1/4] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.