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

  • ffs counts bit starting with 1 (for the least significant bit), __ffs
    counts bits starting with 0. This patch changes various occurrences of ffs
    to __ffs and removes subtraction of 1 from the result.

    Note that __ffs (unlike ffs) is not defined when called with zero
    argument, but it is not called with zero argument in any of these cases.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     

10 Oct, 2015

1 commit

  • Commit 76c44f6d80 introduced the possibly for "Overflow" to be reported
    by the snapshot device's status. Older userspace (e.g. lvm2) does not
    handle the "Overflow" status response.

    Fix this incompatibility by requiring newer userspace code, that can
    cope with "Overflow", request the persistent store with overflow support
    by using "PO" (Persistent with Overflow) for the snapshot store type.

    Reported-by: Zdenek Kabelac
    Fixes: 76c44f6d80 ("dm snapshot: don't invalidate on-disk image on snapshot write overflow")
    Reviewed-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

27 Jul, 2012

1 commit


29 Mar, 2012

1 commit


01 Nov, 2011

1 commit


12 Aug, 2010

1 commit

  • Validate chunk size against both origin and snapshot sector size

    Don't allow chunk size smaller than either origin or snapshot logical
    sector size. Reading or writing data not aligned to sector size is not
    allowed and causes immediate errors.

    This requires us to open the origin before initialising the
    exception store and to export dm_snap_origin.

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

    Mikulas Patocka
     

11 Dec, 2009

2 commits


17 Oct, 2009

3 commits

  • Allow the snapshot chunk size to be smaller than the page size
    The code is now capable of handling this due to some previous
    fixes and enhancements.

    As the page size varies between computers, prior to this patch,
    the chunk size of a snapshot dictated which machines could read it:
    Snapshots created on one machine might not be readable on another.

    Signed-off-by: Mikulas Patocka
    Reviewed-by: Mike Snitzer
    Reviewed-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Use unsigned integer chunk size.

    Maximum chunk size is 512kB, there won't ever be need to use 4GB chunk size,
    so the number can be 32-bit. This fixes compiler failure on 32-bit systems
    with large block devices.

    Cc: stable@kernel.org
    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Reviewed-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Properly close the device if failing because of an invalid chunk size.

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

    Mikulas Patocka
     

05 Sep, 2009

2 commits

  • Fix some problems seen in the chunk size processing when activating a
    pre-existing snapshot.

    For a new snapshot, the chunk size can either be supplied by the creator
    or a default value can be used. For an existing snapshot, the
    chunk size in the snapshot header on disk should always be used.

    If someone attempts to load an existing snapshot and has the 'default
    chunk size' option set, the kernel uses its default value even when it
    is incorrect for the snapshot being loaded. This patch ensures the
    correct on-disk value is always used.

    Secondly, when the code does use the chunk size stored on the disk it is
    prudent to revalidate it, so the code can exit cleanly if it got
    corrupted as happened in
    https://bugzilla.redhat.com/show_bug.cgi?id=461506 .

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

    Mikulas Patocka
     
  • Break the function set_chunk_size to two functions in preparation for
    the fix in the following patch.

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

    Mikulas Patocka
     

30 Jun, 2009

1 commit

  • Fix exception store name handling.

    We need to reference exception store by zero terminated string.

    Fixes regression introduced in commit f6bd4eb73cdf2a5bf954e497972842f39cabb7e3

    Cc: Yi Yang
    Cc: Jonathan Brassow
    Cc: stable@kernel.org
    Cc: Andrew Morton
    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Milan Broz
     

22 Jun, 2009

1 commit


23 May, 2009

1 commit

  • Until now we have had a 1:1 mapping between storage device physical
    block size and the logical block sized used when addressing the device.
    With SATA 4KB drives coming out that will no longer be the case. The
    sector size will be 4KB but the logical block size will remain
    512-bytes. Hence we need to distinguish between the physical block size
    and the logical ditto.

    This patch renames hardsect_size to logical_block_size.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

03 Apr, 2009

5 commits


06 Jan, 2009

4 commits


22 Oct, 2008

3 commits

  • Change #include "dm.h" to #include in all targets.
    Targets should not need direct access to internal DM structures.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • We must zero the next chunk on disk *before* writing out the current chunk, not
    after. Otherwise if the machine crashes at the wrong time, the "end of metadata"
    marker may be missing.

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

    Mikulas Patocka
     
  • Use a separate buffer for writing zeroes to the on-disk snapshot
    exception store, make the updating of ps->current_area explicit and
    refactor the code in preparation for the fix in the next patch.

    No functional change.

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

    Alasdair G Kergon
     

10 Oct, 2008

2 commits


25 Apr, 2008

3 commits


08 Feb, 2008

1 commit

  • drivers/md/dm-exception-store.c: In function 'persistent_read_metadata':
    drivers/md/dm-exception-store.c:452: warning: 'new_snapshot' may be used uninitialized in this function

    Signed-off-by: Andrew Morton
    Signed-off-by: Alasdair G Kergon

    Andrew Morton
     

18 Jul, 2007

1 commit


13 Jul, 2007

3 commits

  • Allow invalid snapshots to be activated instead of failing.

    This allows userspace to reinstate any given snapshot state - for
    example after an unscheduled reboot - and clean up the invalid snapshot
    at its leisure.

    Cc: stable@kernel.org
    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Linus Torvalds

    Milan Broz
     
  • Process persistent exception store metadata IOs in a separate thread.

    A snapshot may become invalid while inside generic_make_request().
    A synchronous write is then needed to update the metadata while still
    inside that function. Since the introduction of
    md-dm-reduce-stack-usage-with-stacked-block-devices.patch this has to
    be performed by a separate thread to avoid deadlock.

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Linus Torvalds

    Milan Broz
     
  • Use new KMEM_CACHE() macro and make the newly-exposed structure names more
    meaningful. Also remove some superfluous casts and inlines (let a modern
    compiler be the judge).

    Acked-by: Christoph Lameter
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Linus Torvalds

    Alasdair G Kergon
     

10 May, 2007

1 commit

  • This patch ports dm-exception-store.c to the new, scalable dm_io() interface.

    It replaces dm_io_get()/dm_io_put() by
    dm_io_client_create()/dm_io_client_destroy() calls and
    dm_io_sync_vm() by dm_io() to achive this.

    Signed-off-by: Heinz Mauelshagen
    Cc: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heinz Mauelshagen