Linux Device Mapper development
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: Possible bug when releasing metadata snapshot in dm-thin
Date: Wed, 19 Nov 2014 12:48:07 +0000	[thread overview]
Message-ID: <20141119124807.GA14615@debian> (raw)
In-Reply-To: <CAKTMprOM+0dZV_XhvkLJCNuq6kmAbg-9uor7wkin5v3MGXRVJg@mail.gmail.com>

On Wed, Nov 19, 2014 at 05:21:52PM +0800, Teng-Feng Yang wrote:
> Hi all,
> 
> I accidentally run into this weird situation which looks like a bug to me.
> This bug can be reproduced every time with the following steps.
> 
> 1) Create a thin pool and a thin volume.
> 2) Write some data to this thin volume.
> 3) Reserve metadata snapshot by sending "reserve_metadata_snap" to pool.
> 4) Create a snapshot for the thin volume.
> 5) Release metadata snapshot by sending "release_metadata_snap" to pool
> 6) Remove both the snapshot and thin volume.
> 
> After these steps, pool blocks allocated to the thin volume are never
> returned to the pool. I trace the code of releasing metadata snapshot,
> and I might find the root cause of this. When reserving metadata
> snapshot, we will increase the reference count of data mapping root by
> 1. However, the subsequent changes to the data mapping tree will split
> the data mapping tree which results in increasing reference counts of
> all bottom level roots. When releasing metadata snapshot, we simply
> decrease the reference count of the old data mapping root without
> propagating these reference count decrements all the way down. IMHO,
> maybe we should call dm_btree_del() on the old data mapping root
> instead of dm_sm_dec_refcount().

Yep, that sounds likely.  I'll confirm and post a patch later.

Thanks,

- Joe

  reply	other threads:[~2014-11-19 12:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19  9:21 Possible bug when releasing metadata snapshot in dm-thin Teng-Feng Yang
2014-11-19 12:48 ` Joe Thornber [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-28  7:29 Teng-Feng Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141119124807.GA14615@debian \
    --to=thornber@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox