22 Sep, 2016

1 commit


21 Jul, 2016

1 commit

  • dm_btree_find_next_single() can short-circuit the search for a block
    with a return of -ENODATA if all entries are higher than the search key
    passed to lower_bound().

    This hasn't been a problem because of the way the btree has been used by
    DM thinp. But it must be fixed now in preparation for fixing the race
    in DM thinp's handling of simultaneous block discard vs allocation.
    Otherwise, once that fix is in place, some of the blocks in a discard
    would not be unmapped as expected.

    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer

    Joe Thornber
     

10 Dec, 2015

2 commits


03 Dec, 2015

2 commits

  • dm_btree_remove_leaves() only unmaps a contiguous region so we need a
    loop, in __remove_range(), to handle ranges that contain multiple
    regions.

    A new btree function, dm_btree_lookup_next(), is introduced which is
    more efficiently able to skip over regions of the thin device which
    aren't mapped. __remove_range() uses dm_btree_lookup_next() for each
    iteration of __remove_range()'s loop.

    Also, improve description of dm_btree_remove_leaves().

    Fixes: 6550f075 ("dm thin metadata: add dm_thin_remove_range()")
    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org # 4.1+

    Joe Thornber
     
  • The block allocated at the start of btree_split_sibling() is never
    released if later insert_at() fails.

    Fix this by releasing the previously allocated bufio block using
    unlock_block().

    Reported-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org

    Mike Snitzer
     

05 Nov, 2015

1 commit

  • Pull device mapper updates from Mike Snitzer:
    "Smaller set of DM changes for this merge. I've based these changes on
    Jens' for-4.4/reservations branch because the associated DM changes
    required it.

    - Revert a dm-multipath change that caused a regression for
    unprivledged users (e.g. kvm guests) that issued ioctls when a
    multipath device had no available paths.

    - Include Christoph's refactoring of DM's ioctl handling and add
    support for passing through persistent reservations with DM
    multipath.

    - All other changes are very simple cleanups"

    * tag 'dm-4.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm switch: simplify conditional in alloc_region_table()
    dm delay: document that offsets are specified in sectors
    dm delay: capitalize the start of an delay_ctr() error message
    dm delay: Use DM_MAPIO macros instead of open-coded equivalents
    dm linear: remove redundant target name from error messages
    dm persistent data: eliminate unnecessary return values
    dm: eliminate unused "bioset" process for each bio-based DM device
    dm: convert ffs to __ffs
    dm: drop NULL test before kmem_cache_destroy() and mempool_destroy()
    dm: add support for passing through persistent reservations
    dm: refactor ioctl handling
    Revert "dm mpath: fix stalls when handling invalid ioctls"
    dm: initialize non-blk-mq queue data before queue is used

    Linus Torvalds
     

01 Nov, 2015

1 commit


24 Oct, 2015

1 commit


12 Aug, 2015

2 commits


06 Jul, 2015

1 commit


11 Nov, 2014

1 commit

  • The walk code was using a 'ro_spine' to hold it's locked btree nodes.
    But this data structure is designed for the rolling lock scheme, and
    as such automatically unlocks blocks that are two steps up the call
    chain. This is not suitable for the simple recursive walk algorithm,
    which retraces its steps.

    This code is only used by the persistent array code, which in turn is
    only used by dm-cache. In order to trigger it you need to have a
    mapping tree that is more than 2 levels deep; which equates to 8-16
    million cache blocks. For instance a 4T ssd with a very small block
    size of 32k only just triggers this bug.

    The fix just places the locked blocks on the stack, and stops using
    the ro_spine altogether.

    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org

    Joe Thornber
     

10 Jan, 2014

1 commit

  • dm_btree_find_lowest_key is the reciprocal of dm_btree_find_highest_key.
    Factor out common code for dm_btree_find_{highest,lowest}_key.

    dm_btree_find_lowest_key is needed for an upcoming DM target, as such it
    is best to get this interface in place.

    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer

    Joe Thornber
     

23 Aug, 2013

2 commits


02 Mar, 2013

1 commit


22 Dec, 2012

2 commits

  • When deleting nested btrees, the code forgets to delete the innermost
    btree. The thin-metadata code serendipitously compensates for this by
    claiming there is one extra layer in the tree.

    This patch corrects both problems.

    Signed-off-by: Joe Thornber
    Signed-off-by: Alasdair G Kergon

    Joe Thornber
     
  • This patch fixes a compilation failure on sparc32 by renaming struct node.

    struct node is already defined in include/linux/node.h. On sparc32, it
    happens to be included through other dependencies and persistent-data
    doesn't compile because of conflicting declarations.

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     

29 Mar, 2012

1 commit

  • Now that the value_size is held within every node of the btrees we can
    remove this argument from value_ptr().

    For the last few months a BUG_ON has been checking this argument is
    the same as that held in the node. No issues were reported. So this
    is a safe change.

    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Joe Thornber
     

08 Nov, 2011

1 commit


01 Nov, 2011

1 commit

  • The persistent-data library offers a re-usable framework for the storage
    and management of on-disk metadata in device-mapper targets.

    It's used by the thin-provisioning target in the next patch and in an
    upcoming hierarchical storage target.

    For further information, please read
    Documentation/device-mapper/persistent-data.txt

    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Joe Thornber