Return-Path: MIME-Version: 1.0 In-Reply-To: References: <1256253562-22532-1-git-send-email-jaikumar@google.com> <2d5a2c100910231044u6a6c65e0ka8258a6f65d08f41@mail.gmail.com> <20091028233425.GA13183@jh-x301> <20091028235434.GA13715@jh-x301> <20091029001531.GA14617@jh-x301> From: Jaikumar Ganesh Date: Thu, 29 Oct 2009 13:30:14 -0700 Message-ID: Subject: Re: [PATCH] Update SDP storage records when a record is deleted. To: linux-bluetooth@vger.kernel.org Content-Type: multipart/mixed; boundary=001517740dda88839c047718c8d5 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --001517740dda88839c047718c8d5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Johan: On Thu, Oct 29, 2009 at 11:42 AM, Jaikumar Ganesh wro= te: > Hi Johan: > > On Wed, Oct 28, 2009 at 5:15 PM, Johan Hedberg = wrote: >> Hi, >> >> On Wed, Oct 28, 2009, Jaikumar Ganesh wrote: >>> > On Wed, Oct 28, 2009, Jaikumar Ganesh wrote: >>> >> The SDP cache is =A0removed 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=3Dbluetooth/bluez.git;a=3Dcommit;h=3D4bec43039= 626e853489e72149014868f8c8afedc >> >> Ok, so we're talking about different things here. I was talking about >> removing the records from /var/lib/bluetooth/... >> >>> 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. >> >> No, you're right. I was referring to the disk cache. I'm glad we have th= is >> misunderstanding finally sorted out :) > > =A0 New patch attached. The patch broken into 2 patches are attached. > >> >> Johan >> > --001517740dda88839c047718c8d5 Content-Type: text/x-diff; charset=US-ASCII; name="0001-When-a-device-is-removed-delete-the-SDP-records.patch" Content-Disposition: attachment; filename="0001-When-a-device-is-removed-delete-the-S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kZWxldGVfYWxsX3JlY29yZHMoYmRhZGRyX3QgKnNyYywgYmRhZGRyX3Qg KmRzdCk7CiBzZHBfbGlzdF90ICpyZWFkX3JlY29yZHMoYmRhZGRyX3QgKnNyYywgYmRhZGRyX3Qg KmRzdCk7CiBzZHBfcmVjb3JkX3QgKmZpbmRfcmVjb3JkX2luX2xpc3Qoc2RwX2xpc3RfdCAqcmVj cywgY29uc3QgY2hhciAqdXVpZCk7CiBpbnQgc3RvcmVfZGV2aWNlX2lkKGNvbnN0IGdjaGFyICpz cmMsIGNvbnN0IGdjaGFyICpkc3QsCi0tIAoxLjYuMi4zCgo= --001517740dda88839c047718c8d5 Content-Type: text/x-diff; charset=US-ASCII; name="0002-Fix-handling-of-SDP-records.patch" Content-Disposition: attachment; filename="0002-Fix-handling-of-SDP-records.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1dywbdu2 RnJvbSAxYjkwMWRhYmRlMzA0MjM3ZGMxY2EwNWViMTdhNDIxMzdhNjUwZTE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKYWlrdW1hciBHYW5lc2ggPGphaWt1bWFyQGdvb2dsZS5jb20+ CkRhdGU6IFRodSwgMjkgT2N0IDIwMDkgMTM6MjQ6MDUgLTA3MDAKU3ViamVjdDogW1BBVENIIDIv Ml0gRml4IGhhbmRsaW5nIG9mIFNEUCByZWNvcmRzLgoKV2Ugd2VyZSBkZWxldGluZyB0aGUgU0RQ IHJlY29yZHMgb25seSBpZiBhIGRldmljZQp3YXMgcmVnaXN0ZXJlZCBmb3IgdGhvc2UgVVVJRHMu IFdpdGggdGhpcyBjaGFuZ2UsCndlIGRlbGV0ZSB0aGUgU0RQIHJlY29yZHMgZXZlbiBpZiB0aGVy ZSBhcmUgbm8KZHJpdmVycyByZWdpc3RlcmVkLgotLS0KIHNyYy9kZXZpY2UuYyB8ICAgMjcgKysr KysrKysrKysrKystLS0tLS0tLS0tLS0tCiAxIGZpbGVzIGNoYW5n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