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
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 -
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 -
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 -
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 -
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 -
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
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
05 Sep, 2009
1 commit
-
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
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
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 nowadaysSigned-off-by: Bartlomiej Zolnierkiewicz
Signed-off-by: Jens Axboe
03 Apr, 2009
8 commits
-
Let the exception store types print out their status through
the new API, rather than having the snapshot code do it.Adjust the buffer position to allow for the preceding DMEMIT in the
arguments to type->status().Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
First step of having the exception stores parse their own arguments -
generalizing the interface.Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Move useful functions out of dm-snap.h and stop using dm-snap.h.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Move COW device from snapshot to exception store.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Move chunk fields from snapshot to exception store.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Move target pointer from snapshot to exception store.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Move exception stores into a registry.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Introduce struct dm_exception_store_type.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon
06 Jan, 2009
4 commits
-
Supply dm_add_exception as a callback to the read_metadata function.
Add a status function ready for a later patch and name the functions
consistently.Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Move the existing snapshot exception store implementations out into
separate files. Later patches will place these behind a new
interface in preparation for alternative implementations.Signed-off-by: Alasdair G Kergon
-
Rename struct exception_store to dm_exception_store.
Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon -
Pull structures that bridge the gap between snapshot and
exception store out of dm-snap.h and put them in a new
.h file - dm-exception-store.h. This file will define the
API for new exception stores.Ultimately, dm-snap.h is unnecessary, since only dm-snap.c
should be using it.Signed-off-by: Jonathan Brassow
Signed-off-by: Alasdair G Kergon