From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zdenek Kabelac Subject: Re: Strange mapped block count kept by dm-thin driver for thin devices Date: Wed, 28 Aug 2013 13:52:13 +0200 Message-ID: <521DE46D.80609@redhat.com> References: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development Cc: Teng-Feng Yang List-Id: dm-devel.ids Dne 28.8.2013 05:52, Teng-Feng Yang napsal(a): > Hi, > > I have already noticed that the mapped block count of thin devices > shown by "dmsetup status" looked unreasonable to me for a couple of > times in the last six months. > Sometimes the mapped block count was zero, but sometimes it was a > large number which was obviously larger than the total available > blocks in thin-pool. > So I dig into the source code, and I find some codes look suspicious to me. > > In dm_pool_metadata_close() in dm-thin-metadata.c, it will try to > commit transaction for the last time before it destroys the > pmd(dm_pool_metadata). > However, it does not lock the pool_metadata before transaction commit, > which I am not really sure if we still need to acquire lock when it > reaches here. > I know that this function is mainly called when users try to remove > pool, but it seems like we can still have some on-the-fly transaction > commit when dm-thin module calls this function. > Although I would like to test it by myself, this problem occurs in > random and I am still trying to find a way to reproduce it > systematically. > > Any help would be grateful. > I think it's good idea in this case to catch as much info in the moment you think you see a problem. Take output from: dmsetup status/info/table safe content of your metadata device for further analysis with thin provisioning tools. Are you using lvm2 for thin volumes ? Zdenek