• Joe Thornber's avatar
    dm btree: add ref counting ops for the leaves of top level btrees · a11117c7
    Joe Thornber authored
    commit b0dc3c8b upstream.
    
    When using nested btrees, the top leaves of the top levels contain
    block addresses for the root of the next tree down.  If we shadow a
    shared leaf node the leaf values (sub tree roots) should be incremented
    accordingly.
    
    This is only an issue if there is metadata sharing in the top levels.
    Which only occurs if metadata snapshots are being used (as is possible
    with dm-thinp).  And could result in a block from the thinp metadata
    snap being reused early, thus corrupting the thinp metadata snap.
    Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    [bwh: Backported to 3.2:
     - Drop change to remove_one()
     - Remove const pointer qualifications]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    a11117c7
dm-btree-remove.c 15 KB