diff mbox series

[BlueZ] device: Remove GATT Attribute when device is removed

Message ID 20210824225202.826941-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ] device: Remove GATT Attribute when device is removed | expand

Commit Message

Luiz Augusto von Dentz Aug. 24, 2021, 10:52 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This makes the GATT Attribute cache to be removed when device is removed
just like SDP ServiceRecords.

Fixes: https://github.com/bluez/bluez/issues/191
---
 src/device.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Lechner Aug. 25, 2021, 5:44 p.m. UTC | #1
On 8/24/21 5:52 PM, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This makes the GATT Attribute cache to be removed when device is removed
> just like SDP ServiceRecords.
> 
> Fixes: https://github.com/bluez/bluez/issues/191
> ---
Tested-by: David Lechner <david@lechnology.com>

But wouldn't it be better to just delete the file altogether?
This would prevent any future sections from being forgotten to
be removed as well.

I sent an alternative patch that does this: "device: delete
cache file when device is removed"
Luiz Augusto von Dentz Aug. 25, 2021, 10:13 p.m. UTC | #2
Hi,

On Tue, Aug 24, 2021 at 4:35 PM <bluez.test.bot@gmail.com> wrote:
>
> 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=536773
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      0.26 seconds
> GitLint                       PASS      0.10 seconds
> Prep - Setup ELL              PASS      39.79 seconds
> Build - Prep                  PASS      0.10 seconds
> Build - Configure             PASS      6.95 seconds
> Build - Make                  PASS      173.06 seconds
> Make Check                    PASS      8.48 seconds
> Make Distcheck                PASS      204.33 seconds
> Build w/ext ELL - Configure   PASS      7.06 seconds
> Build w/ext ELL - Make        PASS      163.01 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Distcheck - PASS
> Desc: Run distcheck to check the distribution
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Pushed.
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 807106812..998485be7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4511,6 +4511,7 @@  static void device_remove_stored(struct btd_device *device)
 	key_file = g_key_file_new();
 	g_key_file_load_from_file(key_file, filename, 0, NULL);
 	g_key_file_remove_group(key_file, "ServiceRecords", NULL);
+	g_key_file_remove_group(key_file, "Attributes", NULL);
 
 	data = g_key_file_to_data(key_file, &length, NULL);
 	if (length > 0) {