Re: [PATCH] Update SDP storage records when a record is deleted.

Jaikumar Ganesh
2009-10-29T00:02:35Z

Hi Johan:

On Wed, Oct 28, 2009 at 4:54 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi,
>
> On Wed, Oct 28, 2009, Jaikumar Ganesh wrote:
>> The SDP cache is  removed when the device is removed. In fact, you
>> fixed this a few days back.
>
> Which commit are you referring to?

Commit number:

4bec43039626e853489e72149014868f8c8afedc

http://git.kernel.org/?p=bluetooth/bluez.git;a=commit;h=4bec43039626e853489e72149014868f8c8afedc

>
>> This is the scenario I am referring to:
>> a) Device is paired and SDP records fetched.
>> b) Device is unpaired - device cache records of SDP is freed
>
> Ok, so at this point we don't have anything stored about the device,
> neither on disk nor in runtime memory.

I should have been more clear - we only remove the runtime memory cache
The on disk SDP records are not removed.

>
>> c) On Remote Device - some SDP records are deleted.
>> d) When the device is created again and the SDP records fetched,
>> profiles_removed is empty and so
>>
>>         if (req->profiles_removed)
>>                 device_remove_drivers(device, req->profiles_removed);
>>
>> device_remove_drivers will not be called and hence SDP records will
>> never get deleted.
>
> But what is there to delete if in step b) we already deleted everything?

We can also fix this by removing the on disk SDP records when the
device is freed.
(I think which is what you suggested - by cache I was interpreting it
as in memory cache)
Will submit a new patch. Let me know if I read you wrong.

>
> Johan
>