All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
To: linux-bluetooth@vger.kernel.org
Cc: George Kiagiadakis <george.kiagiadakis@collabora.com>
Subject: [PATCH BlueZ 4/5] player: Report EBUSY from a busy Search()
Date: Fri, 21 Aug 2026 22:34:48 +0300	[thread overview]
Message-ID: <20260821193449.1336263-5-george.kiagiadakis@collabora.com> (raw)
In-Reply-To: <20260821193449.1336263-1-george.kiagiadakis@collabora.com>

media_folder_search() answered a request that arrived while another one
was still pending with EINVAL, while media_folder_list_items(),
media_folder_change_folder() and media_item_play() all answer EBUSY for
the very same condition.

The commit that added Search copied the error code from the argument
check sitting directly above it, rather than from ChangeFolder, which
had gained the identical busy check four days earlier and used EBUSY.

Fixes: 0a232a434d4b ("audio/player: Add implementation of MediaFolder.Search")

Assisted-by: Claude:claude-opus-5 valgrind
---
 profiles/audio/player.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index 7c5ea5b62..4c94dcab4 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -826,7 +826,7 @@ static DBusMessage *media_folder_search(DBusConnection *conn, DBusMessage *msg,
 		return btd_error_not_supported(msg);
 
 	if (mp->msg != NULL)
-		return btd_error_failed(msg, strerror(EINVAL));
+		return btd_error_failed(msg, strerror(EBUSY));
 
 	err = cb->cbs->search(mp, string, cb->user_data);
 	if (err < 0)
-- 
2.54.0 (Apple Git-157)


  parent reply	other threads:[~2026-08-21 19:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 19:34 [PATCH BlueZ 0/5] player: Fix crash and related defects around the pending request George Kiagiadakis
2026-08-21 19:34 ` [PATCH BlueZ 1/5] player: Fix crash on MediaItem1.Play() without a browsing scope George Kiagiadakis
2026-08-21 20:38   ` player: Fix crash and related defects around the pending request bluez.test.bot
2026-08-21 19:34 ` [PATCH BlueZ 2/5] player: Answer pending request when the player is destroyed George Kiagiadakis
2026-08-21 19:34 ` [PATCH BlueZ 3/5] player: Fix NumberOfItems never being updated on SetBrowsedPlayer George Kiagiadakis
2026-08-21 19:34 ` George Kiagiadakis [this message]
2026-08-21 19:34 ` [PATCH BlueZ 5/5] unit/test-media-player: Add media player tests George Kiagiadakis
2026-08-24 20:40 ` [PATCH BlueZ 0/5] player: Fix crash and related defects around the pending request patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260821193449.1336263-5-george.kiagiadakis@collabora.com \
    --to=george.kiagiadakis@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.