* [PATCH BlueZ v1] a2dp: Fix removing local cache on restart
@ 2025-03-28 14:44 Luiz Augusto von Dentz
2025-03-28 16:12 ` [BlueZ,v1] " bluez.test.bot
2025-03-28 18:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-03-28 14:44 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Endpoint cache shall only be removed when the device is being removed
not when just because the service is being removed since that is also
done when bluetoothd is being restarted.
Fixes: https://github.com/bluez/bluez/issues/1146
---
profiles/audio/a2dp.c | 40 ----------------------------------------
src/device.c | 1 +
2 files changed, 1 insertion(+), 40 deletions(-)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 81dbbfae39f6..0eac151db29d 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -880,44 +880,6 @@ static void store_remote_seps(struct a2dp_channel *chan)
g_key_file_free(key_file);
}
-static void remove_endpoints_cache(struct btd_service *service)
-{
- struct btd_device *device = btd_service_get_device(service);
- char filename[PATH_MAX];
- char dst_addr[18];
- GKeyFile *key_file;
- GError *gerr = NULL;
- char *data;
- gsize length = 0;
-
- ba2str(device_get_address(device), dst_addr);
-
- create_filename(filename, PATH_MAX, "/%s/cache/%s",
- btd_adapter_get_storage_dir(device_get_adapter(device)),
- dst_addr);
-
- key_file = g_key_file_new();
- if (!g_key_file_load_from_file(key_file, filename, 0, &gerr)) {
- g_error_free(gerr);
- g_key_file_free(key_file);
- return;
- }
- g_key_file_remove_group(key_file, "Endpoints", NULL);
-
- data = g_key_file_to_data(key_file, &length, NULL);
- if (length > 0) {
- create_file(filename, 0600);
- if (!g_file_set_contents(filename, data, length, &gerr)) {
- error("Unable set contents for %s: (%s)", filename,
- gerr->message);
- g_error_free(gerr);
- }
- }
-
- g_free(data);
- g_key_file_free(key_file);
-}
-
static void invalidate_remote_cache(struct a2dp_setup *setup,
struct avdtp_error *err)
{
@@ -3390,7 +3352,6 @@ static int a2dp_source_probe(struct btd_service *service)
static void a2dp_source_remove(struct btd_service *service)
{
source_unregister(service);
- remove_endpoints_cache(service);
}
static int a2dp_sink_probe(struct btd_service *service)
@@ -3405,7 +3366,6 @@ static int a2dp_sink_probe(struct btd_service *service)
static void a2dp_sink_remove(struct btd_service *service)
{
sink_unregister(service);
- remove_endpoints_cache(service);
}
static int a2dp_source_connect(struct btd_service *service)
diff --git a/src/device.c b/src/device.c
index 057d116be6fc..b82a905f9995 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4984,6 +4984,7 @@ static void device_remove_stored(struct btd_device *device)
}
g_key_file_remove_group(key_file, "ServiceRecords", NULL);
g_key_file_remove_group(key_file, "Attributes", NULL);
+ g_key_file_remove_group(key_file, "Endpoints", NULL);
data = g_key_file_to_data(key_file, &length, NULL);
if (length > 0) {
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [BlueZ,v1] a2dp: Fix removing local cache on restart
2025-03-28 14:44 [PATCH BlueZ v1] a2dp: Fix removing local cache on restart Luiz Augusto von Dentz
@ 2025-03-28 16:12 ` bluez.test.bot
2025-03-28 18:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-03-28 16:12 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 2884 bytes --]
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=948097
---Test result---
Test Summary:
CheckPatch PENDING 0.19 seconds
GitLint PENDING 0.22 seconds
BuildEll PASS 20.75 seconds
BluezMake PASS 1527.01 seconds
MakeCheck FAIL 13.16 seconds
MakeDistcheck FAIL 142.30 seconds
CheckValgrind FAIL 215.61 seconds
CheckSmatch PASS 285.99 seconds
bluezmakeextell PASS 101.09 seconds
IncrementalBuild PENDING 0.33 seconds
ScanBuild PASS 883.83 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: MakeCheck - FAIL
Desc: Run Bluez Make Check
Output:
./test-driver: line 107: 32299 Aborted (core dumped) "$@" > $log_file 2>&1
make[3]: *** [Makefile:11780: test-suite.log] Error 1
make[2]: *** [Makefile:11888: check-TESTS] Error 2
make[1]: *** [Makefile:12317: check-am] Error 2
make: *** [Makefile:12319: check] Error 2
##############################
Test: MakeDistcheck - FAIL
Desc: Run Bluez Make Distcheck
Output:
Package cups was not found in the pkg-config search path.
Perhaps you should add the directory containing `cups.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cups' found
../../test-driver: line 107: 55106 Aborted (core dumped) "$@" > $log_file 2>&1
make[4]: *** [Makefile:11780: test-suite.log] Error 1
make[3]: *** [Makefile:11888: check-TESTS] Error 2
make[2]: *** [Makefile:12317: check-am] Error 2
make[1]: *** [Makefile:12319: check] Error 2
make: *** [Makefile:12240: distcheck] Error 1
##############################
Test: CheckValgrind - FAIL
Desc: Run Bluez Make Check with Valgrind
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12907:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12907 | int main(int argc, char *argv[])
| ^~~~
./test-driver: line 107: 75148 Aborted (core dumped) "$@" > $log_file 2>&1
make[3]: *** [Makefile:11780: test-suite.log] Error 1
make[2]: *** [Makefile:11888: check-TESTS] Error 2
make[1]: *** [Makefile:12317: check-am] Error 2
make: *** [Makefile:12319: check] Error 2
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH BlueZ v1] a2dp: Fix removing local cache on restart
2025-03-28 14:44 [PATCH BlueZ v1] a2dp: Fix removing local cache on restart Luiz Augusto von Dentz
2025-03-28 16:12 ` [BlueZ,v1] " bluez.test.bot
@ 2025-03-28 18:00 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-03-28 18:00 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 28 Mar 2025 10:44:05 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> Endpoint cache shall only be removed when the device is being removed
> not when just because the service is being removed since that is also
> done when bluetoothd is being restarted.
>
> Fixes: https://github.com/bluez/bluez/issues/1146
>
> [...]
Here is the summary with links:
- [BlueZ,v1] a2dp: Fix removing local cache on restart
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=78aabd896dbe
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-28 17:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28 14:44 [PATCH BlueZ v1] a2dp: Fix removing local cache on restart Luiz Augusto von Dentz
2025-03-28 16:12 ` [BlueZ,v1] " bluez.test.bot
2025-03-28 18:00 ` [PATCH BlueZ v1] " 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.