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
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
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
27 Jul, 2012
1 commit
-
Replace obsolete simple_strtoul() with kstrtou8/kstrtouint.
Signed-off-by: majianpeng
Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon
29 Mar, 2012
1 commit
-
Call the correct exit function on failure in dm_exception_store_init.
Signed-off-by: Andrei Warkentin
Acked-by: Mike Snitzer
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon
01 Nov, 2011
1 commit
-
A pending cleanup will mean that module.h won't be implicitly
everywhere anymore. Make sure the modular drivers in md dir
are actually calling out for explicitly in advance.Signed-off-by: Paul Gortmaker
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
2 commits
-
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 -
Error handling code following a kmalloc should free the allocated data.
Cc: stable@kernel.org
Signed-off-by: Julia Lawall
Signed-off-by: Alasdair G Kergon
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 -
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 -
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
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 -
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
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
22 Jun, 2009
1 commit
-
When snapshots are created using 'p' instead of 'P' as the
exception store type, the device-mapper table loading fails.This patch makes the code case insensitive as intended and fixes some
regressions reported with device-mapper snapshots.Signed-off-by: Jonathan Brassow
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon
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
03 Apr, 2009
5 commits
-
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 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
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
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 -
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 -
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
10 Oct, 2008
2 commits
-
Change uint32_t into chunk_t to remove 32-bit limitation on the
number of chunks on systems with 64-bit sector numbers.Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon -
Move this logic to a function, because it will be reused later.
Signed-off-by: Mikulas Patocka
Signed-off-by: Alasdair G Kergon
25 Apr, 2008
3 commits
-
Publish the dm-io, dm-log and dm-kcopyd headers in include/linux.
Signed-off-by: Alasdair G Kergon
-
Clean up the dm-io interface to prepare for publishing it in include/linux.
Signed-off-by: Heinz Mauelshagen
Signed-off-by: Alasdair G Kergon -
If a snapshot has a smaller chunksize than the page size the
conversion to pages currently returns 0 instead of 1, causing:
kernel BUG in mempool_resize.Signed-off-by: Mikulas Patocka
Signed-off-by: Milan Broz
Signed-off-by: Alasdair G Kergon
Cc: stable@kernel.org
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 functionSigned-off-by: Andrew Morton
Signed-off-by: Alasdair G Kergon
18 Jul, 2007
1 commit
-
If, in dm_create_persistent(), the call to create_singlethread_workqueue()
fails then we'll return without freeing the memory allocated to 'ps', thus
leaking sizeof(struct pstore) bytes. This patch fixes the leak.Signed-off-by: Jesper Juhl
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
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 -
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 -
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
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