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

6 commits

  • Merging is started when origin is resumed and it is stopped when
    origin is suspended or when the merging snapshot is destroyed or
    errors are detected.

    Merging is not yet interlocked with writes: this will be handled in
    subsequent patches.

    The code relies on callbacks from a private kcopyd thread.

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

    Mikulas Patocka
     
  • Add functions that decide how many consecutive chunks of snapshot to
    merge back into the origin next and to update the metadata afterwards.

    prepare_merge provides a pointer to the most recent still-to-be-merged
    chunk and returns how many previous ones are consecutive and can be
    processed together.

    commit_merge removes the nr_merged most-recent chunks permanently from
    the exception store. The number must not exceed that returned by
    prepare_merge.

    Introduce NUM_SNAPSHOT_HDR_CHUNKS to show where the snapshot header
    chunk is accounted for.

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

    Mikulas Patocka
     
  • Store the reference to the snapshot cow device in the core snapshot
    code instead of each exception store. It can be accessed through the
    new function dm_snap_cow(). Exception stores should each now maintain a
    reference to their parent snapshot struct.

    This is cleaner and makes part of the forthcoming snapshot merge code simpler.

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

    Mike Snitzer
     
  • Add number of sectors used by metadata to the end of the snapshot's status
    line.

    Renamed dm_exception_store_type's 'fraction_full' to 'usage'. Renamed
    arguments to be clearer about what is being returned. Also added
    'metadata_sectors'.

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

    Mike Snitzer
     
  • The exception structure is not necessarily just a snapshot
    element (especially after we pull it out of dm-snap.c).

    Renaming appropriately.

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

    Jon Brassow
     
  • Removed unnecessary 'and' masking: The right shift discards the lower
    bits so there is no need to clear them.

    (A later patch needs this change to support a 32-bit chunk_mask.)

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

    Mikulas Patocka
     

17 Oct, 2009

1 commit

  • 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
     

05 Sep, 2009

1 commit


22 Jun, 2009

1 commit

  • Use i_size_read() instead of reading i_size.

    If someone changes the size of the device simultaneously, i_size_read
    is guaranteed to return a valid value (either the old one or the new one).

    i_size can return some intermediate invalid value (on 32-bit computers
    with 64-bit i_size, the reads to both halves of i_size can be interleaved
    with updates to i_size, resulting in garbage being returned).

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

    Mikulas Patocka
     

19 Jun, 2009

1 commit

  • Follow-up to "block: enable by default support for large devices
    and files on 32-bit archs".

    Rename CONFIG_LBD to CONFIG_LBDAF to:
    - allow update of existing [def]configs for "default y" change
    - reflect that it is used also for large files support nowadays

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     

03 Apr, 2009

8 commits


06 Jan, 2009

4 commits