Return-Path: MIME-Version: 1.0 In-Reply-To: <20091029001531.GA14617@jh-x301> References: <1256253562-22532-1-git-send-email-jaikumar@google.com> <2d5a2c100910230649u1946e632qa4c50b33b6654218@mail.gmail.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 11:42:16 -0700 Message-ID: Subject: Re: [PATCH] Update SDP storage records when a record is deleted. To: Jaikumar Ganesh , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Content-Type: multipart/mixed; boundary=001636ed6870709c780477174654 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --001636ed6870709c780477174654 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Johan: On Wed, Oct 28, 2009 at 5:15 PM, Johan Hedberg wr= ote: > 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=3D4bec430396= 26e853489e72149014868f8c8afedc > > 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 thi= s > misunderstanding finally sorted out :) New patch attached. > > Johan > --001636ed6870709c780477174654 Content-Type: text/x-diff; charset=US-ASCII; name="0001-Fix-handling-of-SDP-records.patch" Content-Disposition: attachment; filename="0001-Fix-handling-of-SDP-records.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g1d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