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
     

03 Oct, 2006

3 commits

  • When suspending a device-mapper device, dm_suspend() sleeps until all
    necessary I/O is completed. This state is triggered by a callback from
    persistent_commit(). But some I/O can still be issued *after* the callback
    (to prepare the next metadata area for use if the current one is full). This
    patch delays the callback until after that I/O is complete.

    Signed-off-by: Mark McLoughlin
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark McLoughlin
     
  • read_exception() and write_exception() only return an error if supplied with
    an out-of-range index. If this ever happens it's the result of a bug in the
    calling code so we handle this with an assertion and remove the error handling
    in the callers.

    Signed-off-by: Mark McLoughlin
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark McLoughlin
     
  • The chunk size of snapshots cannot be changed so it is redundant to require it
    as a parameter when activating an existing snapshot. Allow a value of zero in
    this case and ignore it. For a new snapshot, use a default value if zero is
    specified.

    Signed-off-by: Mark McLoughlin
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark McLoughlin
     

27 Jun, 2006

2 commits

  • Tidy device-mapper error messages to include context information
    automatically.

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

    Alasdair G Kergon
     
  • Persistent snapshots currently store a private copy of the chunk size.
    Userspace also supplies the chunk size when loading a snapshot. Ensure
    consistency by only storing the chunk_size in one place instead of two.

    Currently the two sizes will differ if the chunk size supplied by userspace
    does not match the chunk size an existing snapshot actually uses. Amongst
    other problems, this causes an incorrect 'percentage full' to be reported.

    The patch ensures consistency by only storing the chunk_size in one place,
    removing it from struct pstore. Some initialisation is delayed until the
    correct chunk_size is known. If read_header() discovers that the wrong chunk
    size was supplied, the 'area' buffer (which the header already got read into)
    is reinitialised to the correct size.

    [akpm: too late for 2.6.17 - suitable for 2.6.17.x after it has settled]

    Signed-off-by: Alasdair G Kergon
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alasdair G Kergon