]>
sourceware.org Git - lvm2.git/log
Zdenek Kabelac [Fri, 31 Oct 2014 12:36:54 +0000 (13:36 +0100)]
cleanup: shorter code
Zdenek Kabelac [Sun, 2 Nov 2014 19:59:57 +0000 (20:59 +0100)]
cleanup: rename function
Make more clear dm_info type.
Zdenek Kabelac [Fri, 31 Oct 2014 10:31:22 +0000 (11:31 +0100)]
cleanup: standard params ordering
Pass lvconvert_params as last arg.
Zdenek Kabelac [Fri, 31 Oct 2014 09:25:05 +0000 (10:25 +0100)]
cleanup: init of lcp
Use struct initializer instead of memset().
Zdenek Kabelac [Mon, 3 Nov 2014 11:52:24 +0000 (12:52 +0100)]
cleanup: correcting tracing
Use log_error for real error.
Zdenek Kabelac [Fri, 31 Oct 2014 10:41:03 +0000 (11:41 +0100)]
cleanup: use arg_is_set
Zdenek Kabelac [Mon, 3 Nov 2014 11:38:29 +0000 (12:38 +0100)]
cache: report stats for cache volumes usage
Show some stats with 'lvs'
Display same info for active cache volume and cache-pool.
data% - #used cache blocks/#total cache blocks
meta% - #used metadata blocks/#total metadata blocks
copy% - #dirty/#used cache blocks
TODO: maybe there is a better mapping
- should be seen as first-try-and-see.
Zdenek Kabelac [Sun, 2 Nov 2014 18:41:46 +0000 (19:41 +0100)]
cache: wipe cache-pool before reuse
Before we reuse cache-pool - we need to ensure metadata volume
has wiped header.
Zdenek Kabelac [Sun, 2 Nov 2014 18:34:50 +0000 (19:34 +0100)]
cache: support activation of empty cache-pool
When the cache pool is unused, lvm2 code will internally
allow to activate such cache-pool.
Cache-pool is activate as metadata LV, so lvm2 could easily
wipe such volume before cache-pool is reused.
Zdenek Kabelac [Mon, 3 Nov 2014 11:52:29 +0000 (12:52 +0100)]
cache: lv_cache_status
Replace lv_cache_block_info() and lv_cache_policy_info()
with lv_cache_status() which directly returns
dm_status_cache structure together with some calculated
values.
After use mem pool stored inside lv_status_cache structure
needs to be destroyed.
Zdenek Kabelac [Sun, 2 Nov 2014 16:22:32 +0000 (17:22 +0100)]
cleanup: add arg to _setup_task
Add init of no_open_count into _setup_task().
Report problem as warning (cannot happen anyway).
Also drop some duplicated debug messages - we have already
printed the info about operation so make log a bit shorter.
Zdenek Kabelac [Fri, 31 Oct 2014 10:33:19 +0000 (11:33 +0100)]
cleanup: rename virtual_extents
Use standard 'virtual_extents' naming.
Move virtual_size into 'lcp' struct out of lvcreate_params.
Zdenek Kabelac [Thu, 30 Oct 2014 12:04:06 +0000 (13:04 +0100)]
cleanup: use extents to pass size to /lib
Lib takes sizes in extens - do the same for pool_metadata.
Zdenek Kabelac [Sun, 2 Nov 2014 17:36:41 +0000 (18:36 +0100)]
cache: add wipe_cache_pool
Add function for wiping cache pool volume.
Only unused cache-pool could be wiped.
Zdenek Kabelac [Sun, 2 Nov 2014 16:48:21 +0000 (17:48 +0100)]
cache: allow deactivation of empty pool
Tool will use internal activation of unused cache pool to
clear metadata area before next use of cache-pool.
So allow to deactivation unused pool in case some error
case happend and we were not able to deactivation pool
right after metadata wipe.
Zdenek Kabelac [Sun, 2 Nov 2014 16:03:14 +0000 (17:03 +0100)]
cache: convert thin-pool
Support caching of thin-pool.
lvresize needs to be resolved - so far, user
has to manually drop cache-pool before resizing.
Zdenek Kabelac [Mon, 3 Nov 2014 13:00:09 +0000 (14:00 +0100)]
thin: allow to convert chunksize of empty pool
When pool is not used, allow to change its chunksize.
Zdenek Kabelac [Mon, 3 Nov 2014 11:38:24 +0000 (12:38 +0100)]
thin: reporting of thin volumes simplified
Simplify reporting of percentage.
Allows easier support for more types.
Move testing of device availability into activate.c
Zdenek Kabelac [Fri, 31 Oct 2014 10:41:49 +0000 (11:41 +0100)]
pool: validate sizes
0 size are not supported as well as negative.
Zdenek Kabelac [Fri, 31 Oct 2014 19:25:25 +0000 (20:25 +0100)]
filters: change return code
No data for writing should be seen as 'dump' success.
(reduces one <bactrace> in the log) - it has no other
effect.
Zdenek Kabelac [Fri, 31 Oct 2014 12:37:39 +0000 (13:37 +0100)]
lvcreate: tollerate defaults
lvcreate -m0 and -Mn goes with anything.
Read ahead works either with pools or thin/cache, but not with both.
Zdenek Kabelac [Fri, 31 Oct 2014 12:04:46 +0000 (13:04 +0100)]
libdm: init char array
When non-root uses dm_check_version() it's been printing some unit
values from stack. So always init those vars.
Zdenek Kabelac [Thu, 30 Oct 2014 23:37:35 +0000 (00:37 +0100)]
tests: update raid sync
Zdenek Kabelac [Thu, 30 Oct 2014 23:31:54 +0000 (00:31 +0100)]
tests: wait for raid sync
Zdenek Kabelac [Thu, 30 Oct 2014 23:28:25 +0000 (00:28 +0100)]
tests: explicitely use old snapshots
Zdenek Kabelac [Thu, 30 Oct 2014 22:16:03 +0000 (23:16 +0100)]
tests: lvcreate snapshot usage update
Zdenek Kabelac [Sun, 26 Oct 2014 19:41:49 +0000 (20:41 +0100)]
tests: use aux func to disable device
Zdenek Kabelac [Sat, 25 Oct 2014 14:03:44 +0000 (16:03 +0200)]
tests: raid syncaction test
Add sync wait for syncaction of raid1 test.
--syncaction requires raid to be in sync first.
Zdenek Kabelac [Thu, 30 Oct 2014 12:04:41 +0000 (13:04 +0100)]
cleanup: shorter code
Zdenek Kabelac [Thu, 30 Oct 2014 10:38:49 +0000 (11:38 +0100)]
cleanup: extents_from_size is 32bit value
Current lvm2 does support only 32bit extents count.
Zdenek Kabelac [Thu, 30 Oct 2014 10:38:03 +0000 (11:38 +0100)]
cleanup: prints and stacks
Zdenek Kabelac [Tue, 28 Oct 2014 19:09:08 +0000 (20:09 +0100)]
cleanup: remove unneeded assign
Zdenek Kabelac [Thu, 30 Oct 2014 22:43:12 +0000 (23:43 +0100)]
metadata: add extents_from_percent_size
Add API call to calculate extents from percentage value.
Size is based in DM_PERCENT_1 units.
(Supporting decimal point number).
This commit is preparing functionality for more global
usage of % with i.e. --size option.
Zdenek Kabelac [Tue, 28 Oct 2014 10:02:58 +0000 (11:02 +0100)]
pv_manip: check for pe_ranges
Zdenek Kabelac [Thu, 30 Oct 2014 13:52:37 +0000 (14:52 +0100)]
lvmcmdline: support size_mb_arg_with_percent
New size_mb_arg_with_percent is able to read size_mb_arg
but also it's able to read % values.
Percent parsing is share with int_arg_with_sign_and_percent.
Zdenek Kabelac [Tue, 28 Oct 2014 10:20:33 +0000 (11:20 +0100)]
lvmcmdline: extra support for decimal point
If root has locales with different decimal point then '.'
(i.e. Czech with ',') lets be tolerant and retry with
"C" locales in the case '.' is found during parse of number.
Locales are then restored back.
Zdenek Kabelac [Mon, 27 Oct 2014 09:50:52 +0000 (10:50 +0100)]
segtype: drop cmdcontex pointer
Users of context provide their cmd pointer,
so don't keep it inside segtype.
Zdenek Kabelac [Thu, 30 Oct 2014 22:36:07 +0000 (23:36 +0100)]
lvcreate: improving recent lvcreate updates
We need to be able to parse:
lvcreate --type snapshot -s
lvcreate --type thin -s
lvcreate --type cache-pool -H
Zdenek Kabelac [Thu, 30 Oct 2014 18:44:42 +0000 (19:44 +0100)]
man: update lvcreate with sparse
Document sparse device creation and its default segtype selection.
Zdenek Kabelac [Thu, 30 Oct 2014 16:07:58 +0000 (17:07 +0100)]
configure: autoreconf
Just rebuild after configure.in update.
Zdenek Kabelac [Thu, 30 Oct 2014 22:38:02 +0000 (23:38 +0100)]
sparse: configurable type for sparse volumes
Support compile type configurable defaults for creation
of sparse volumes.
By default now create 'thin-pools' for sparse volumes.
Use the global/sparse_segtype_default to switch back to old
snapshots if needed.
Apply the same compile logic for newly introduces mirror/raid1 options.
Zdenek Kabelac [Thu, 30 Oct 2014 16:13:05 +0000 (17:13 +0100)]
configure: option cleanup
Drop double [[ ]] around default args.
(AC_HELP_STRING is already quoted so double [[]] are not needed).
Peter Rajnoha [Mon, 27 Oct 2014 10:53:01 +0000 (11:53 +0100)]
test: for issue fixed in previous commit
2f7f6932dcd450ba75fe590aba8c09838d2618dc
Peter Rajnoha [Mon, 27 Oct 2014 10:25:08 +0000 (11:25 +0100)]
report: selection: fix selection criteria to not match reserved values when using >, <, >=, <
Some values are reserved for special purpose like 'undefined', 'unmanaged' etc.
When using >, <, >= and < comparison operators where the range is considered,
do not include reserved values as proper values in this range which
would otherwise result in not so obvious criteria match (as the reserved value is
actually transparent for the user). It's incorrect.
Example scenario:
$ vgs -o vg_name,vg_mda_copies vg1 vg2
VG #VMdaCps
vg1 1
vg2 unmanaged
The "unmanaged" is actually mapped onto reserved value
18446744073709551615 (2^64 - 1) internally.
Such reseved value is already caught on selection criteria input
properly:
$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=
18446744073709551615 '
Numeric value
18446744073709551615 found in selection is reserved.
However, we still need to fix situaton where the reserved value may be
included in resulting range:
Before this patch:
$ vgs -o vg_name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies >= 1'
VG #VMdaCps
vg1 1
vg2 unmanaged
With this patch applied:
$ vgs -o vg_name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies >= 1'
VG #VMdaCps
vg1 1
From the examples above, we can see that without this patch applied,
the vg_mda_copies >= 1 also matched the reserved value
18446744073709551615
(which is represented by the "unamanged" string on report). When
applying the operators, such values must be skipped! They're meant to
be matched only against their string representation only, e.g.:
$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=unmanaged'
VG #VMdaCps
vg2 unmanaged
...or any synonyms:
$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=undefined'
VG #VMdaCps
vg2 unmanaged
Zdenek Kabelac [Sun, 26 Oct 2014 18:45:17 +0000 (19:45 +0100)]
pools: workaround hints
Missing code for stacked hint estimation
Zdenek Kabelac [Sun, 26 Oct 2014 15:19:30 +0000 (16:19 +0100)]
tests: update cache creation tests
Zdenek Kabelac [Sun, 26 Oct 2014 06:29:25 +0000 (07:29 +0100)]
tests: lvcreate-update
Test with old mirror type.
Zdenek Kabelac [Sun, 26 Oct 2014 06:27:23 +0000 (07:27 +0100)]
tests: pytest update
Zdenek Kabelac [Sun, 26 Oct 2014 15:18:53 +0000 (16:18 +0100)]
lvcreate: delay check for free extents
As the rounding for cache creation may change the value of extents
postpone check for free extents.
Zdenek Kabelac [Sun, 26 Oct 2014 15:17:14 +0000 (16:17 +0100)]
cache: support more args
Unlike with thin-pool - with cache we support all args also
directly when create cache volume.
So the result of 'separate' cache-pool creation and setting its
options should give same result as specifying those args
during cache creation.
Cache-pool values are used as defaults if the params are
not specified with cache creation.
Zdenek Kabelac [Sun, 26 Oct 2014 07:13:59 +0000 (08:13 +0100)]
thin: simplify thin volume creation
Move code for creation of thin volume into a single place
out of lv_extend(). This allows to drop extra pool arg
for alloc_lv_segment() && lv_extend() and makes code
more easier to read and follow.
Zdenek Kabelac [Sun, 26 Oct 2014 17:17:59 +0000 (18:17 +0100)]
cache: apply chunk rounding also for cache creation.
When we create volumes with chunk size bigger then extent size
we try to round up to some nearest chunk boundary.
Until now we did this for thins - use same logic for
cache volumes.
Zdenek Kabelac [Sun, 26 Oct 2014 17:17:40 +0000 (18:17 +0100)]
pools: prefetch pool_lv and origin_lv
Load pool_lv and origin_lv at a single place and
use it for more types as they need them.
Zdenek Kabelac [Sun, 26 Oct 2014 06:25:30 +0000 (07:25 +0100)]
lvm2app: update to new lv_create_single API
lv_create_single is more type based.
David Teigland [Fri, 24 Oct 2014 20:54:04 +0000 (21:54 +0100)]
vg_read: Remove unused READ_WITHOUT_LOCK.
Unused since
67a7b7a87da65b2350f975272e581be5f41976e0 :
report: Iterate over labels instead of PVs for label-only reports.
(included in 2.02.105).
Zdenek Kabelac [Tue, 21 Oct 2014 08:52:57 +0000 (10:52 +0200)]
tests: syncaction needs kernel fix
Add 'should' as we currently cannot pass this test.
FIXME:
Add properly wrapper to not use 'should' with fixed kernel.
Zdenek Kabelac [Mon, 20 Oct 2014 12:56:55 +0000 (14:56 +0200)]
tests: new lvcreate functionality
Fixed syntax parsing means that some commands that used to work are now
failing. Particullary this case:
$ invalid lvcreate -l1 --type thin vg/pool
> Needs to fail becase thin type LV needs --virtualsize
$ invalid lvcreate --type snapshot vg/lv1
> Needs to fail because old-snapshot segment type needs --size
Some reported error messages have been also updated.
Zdenek Kabelac [Sat, 11 Oct 2014 07:12:56 +0000 (09:12 +0200)]
tests: lvcreate usage
Zdenek Kabelac [Wed, 22 Oct 2014 19:02:29 +0000 (21:02 +0200)]
mirror: extra parsing for mirrorlog arg
Put validation of mirrorlog arg into a separate function.
Zdenek Kabelac [Tue, 7 Oct 2014 12:48:38 +0000 (14:48 +0200)]
man: lvconvert/create updates
More description for cache support.
Introduce --pooldatasize option.
Zdenek Kabelac [Wed, 22 Oct 2014 19:01:03 +0000 (21:01 +0200)]
cache: separate func for pool/origin validation
Split validate_lv_cache_create() into 2 function
once is called for pool validation other for origin.
It's less misleading the accepting NULLs.
Zdenek Kabelac [Mon, 20 Oct 2014 12:57:24 +0000 (14:57 +0200)]
segments: mark more of them unzeroable
Use segment flags to avoid zeroing of cache, cache pool
snapshot and thin pool segments.
We never want to zero these segment types.
Note:
Snapshot COW and Cache origin are created as stripes
thus are then properly zeroed.
Zdenek Kabelac [Tue, 21 Oct 2014 18:50:26 +0000 (20:50 +0200)]
lvcreate: check for conflicting -Zy -Wy
Let the finaly state of zero & wipe_signature to be
resolved later together with all the types.
Don't play with zero assigment and segtype flag
(i.e. thin-pool -Z has different meaning).
Check if the passed options do allow requested zeroing/wiping.
lvcreate without -Z or -W will fallback to warning if the device
cannot be zeroed, however if user requested them explicitely
it will give user error.
Zdenek Kabelac [Thu, 23 Oct 2014 12:26:16 +0000 (14:26 +0200)]
toollib: persistent major minor
Deduce -M from presence of --minor, --major option if
not specified on command line.
Zdenek Kabelac [Fri, 24 Oct 2014 13:26:41 +0000 (15:26 +0200)]
lvcreate: new validation code
Refactor lvcreate code.
Prefer to use arg_outside_list_is_set() so we get automatic 'white-list'
validation of supported options with different segment types.
Drop used lp->cache, lp->cache and use seg_is_cache(), seg_is_thin()
Draw clear border where is the last moment we could change create
segment type.
When segment type is given with --type - do not allow it to be changed
later.
Put together tests related to individual segment types.
Finish cache conversion at proper part of lv_manip code after
the vg_metadata are written - so we could correcly clean-up created
stripe LV for cache volume.
Zdenek Kabelac [Fri, 24 Oct 2014 13:21:48 +0000 (15:21 +0200)]
pools: error path removes metadata
When pool volume is create - it has already managed to update metadata
once within lv_extend - so revert new created LV here.
Zdenek Kabelac [Sat, 11 Oct 2014 16:36:40 +0000 (18:36 +0200)]
lvcreate: handle linear segment
Put in code to accept 'linear' segment type
(when specified stripes cannot be used)
Also report 'error' when unknown type is specified.
Zdenek Kabelac [Fri, 24 Oct 2014 12:22:25 +0000 (14:22 +0200)]
pool: better error path handling
Move test for size of new LV names in front before
any creation of LV.
Properly check striped segtype kernel presence,
since passed 'segtype' is already tested.
Keep deactivation error path local to wiping part of the function.
Create metadata with temporary flag (it's activated, zeroed
and deactivated).
Zdenek Kabelac [Wed, 22 Oct 2014 11:53:36 +0000 (13:53 +0200)]
cleanup: code move
Update comment and move code to new place.
Gets updated with next commit.
Zdenek Kabelac [Wed, 22 Oct 2014 11:40:16 +0000 (13:40 +0200)]
cleanup: function embeded
It's used just in one place now.
Zdenek Kabelac [Wed, 22 Oct 2014 11:38:47 +0000 (13:38 +0200)]
cleanup: better stack tracing
Show proper backtrace on error path.
Zdenek Kabelac [Sat, 18 Oct 2014 08:58:30 +0000 (10:58 +0200)]
options: introduce pooldatasize option
Introduce new option to specify pool data size.
This will be user to create i.e. cache & cachepool at once.
And possible for thin external origin snapshot.
This is only very basic patch to enable options, the
real working code will come later.
Zdenek Kabelac [Fri, 24 Oct 2014 11:07:02 +0000 (13:07 +0200)]
cleanup: use matching flags for permissions
Since our status bits are 64b - use uint64_t for permissions.
Zdenek Kabelac [Thu, 23 Oct 2014 10:40:15 +0000 (12:40 +0200)]
cleanup: lv_manip drops duplicated internal error
No reason to check the same condition twice with internal error.
Zdenek Kabelac [Tue, 21 Oct 2014 10:03:07 +0000 (12:03 +0200)]
cleanup: use arg_is_set
Zdenek Kabelac [Mon, 20 Oct 2014 19:49:07 +0000 (21:49 +0200)]
cleanup: don't backup twice
Zdenek Kabelac [Tue, 21 Oct 2014 09:23:33 +0000 (11:23 +0200)]
cleanup: move code for checking vg features
Move code that checks for needed VG features into separate
smaller function.
Zdenek Kabelac [Fri, 24 Oct 2014 12:22:13 +0000 (14:22 +0200)]
cleanup: simplier lv name construction
Using NAME_LEN max lv name size.
Zdenek Kabelac [Sun, 19 Oct 2014 11:00:48 +0000 (13:00 +0200)]
cleanup: sort args alphabetically
Give it some order for easier human lookup for options we do support.
Zdenek Kabelac [Sat, 18 Oct 2014 09:01:34 +0000 (11:01 +0200)]
cleanup: move code
Zdenek Kabelac [Sat, 18 Oct 2014 09:01:29 +0000 (11:01 +0200)]
cleanup: indent
Various indents and tiny error message improvements.
Zdenek Kabelac [Wed, 22 Oct 2014 20:43:42 +0000 (22:43 +0200)]
cleanup: commands.h update descriptions
Zdenek Kabelac [Sat, 18 Oct 2014 08:58:23 +0000 (10:58 +0200)]
cleanup: commands.h shorted string
Replace " "\n" with simplier \n"
Zdenek Kabelac [Thu, 23 Oct 2014 12:27:05 +0000 (14:27 +0200)]
lv_manip: preserve read-only status in layered volume
Zdenek Kabelac [Wed, 22 Oct 2014 11:29:25 +0000 (13:29 +0200)]
lv_manip: improve should_wipe reporting
We want to print smarter warning message only when
the zeroing was not provided on the first zeroable segment
of newly created LV.
Put warning within _should_wipe_lv function to avoid reevaluation
of same conditions twice.
Zdenek Kabelac [Wed, 15 Oct 2014 13:06:42 +0000 (15:06 +0200)]
toollib: new arg list functions
Check for negative arg list:
arg_from_list_is_negative()
Check for zero arg in list:
arg_from_list_is_zero()
Zdenek Kabelac [Sat, 11 Oct 2014 07:10:07 +0000 (09:10 +0200)]
segments: disable init of free segment
Since it is not needed and would require separate
code for validation disable its initialization.
Zdenek Kabelac [Sun, 19 Oct 2014 20:04:02 +0000 (22:04 +0200)]
lvconvert: external detects more conflicts
Check for more prohibited types for external origin conversion.
TODO: Move this function to separate validation code.
(Continuing in release fixes.)
Zdenek Kabelac [Tue, 21 Oct 2014 10:12:45 +0000 (12:12 +0200)]
lvcreate: move tests that requires activation
Tests that needs active kernel driver put in single place.
Zdenek Kabelac [Mon, 20 Oct 2014 19:53:48 +0000 (21:53 +0200)]
lvcreate: better logging for temporary device
Hide creation of temporary LVs and print them only in verbose mode.
e.g. hides confusing message about creation of _pmspare
device during creation of pool.
Zdenek Kabelac [Fri, 10 Oct 2014 20:22:43 +0000 (22:22 +0200)]
segtypes: macro segtype_is_unknown
Zdenek Kabelac [Sat, 11 Oct 2014 16:17:46 +0000 (18:17 +0200)]
tools: read yes_no_arg via int_value
yes_no_arg is already parsed so read parsed value as int.
Zdenek Kabelac [Wed, 22 Oct 2014 12:30:33 +0000 (14:30 +0200)]
tools: refactor reporter code
Use new libdm macro DM_LIST_HEAD_INIT().
Embeded 'free' segment type (so it's not needed in the list)
Drop assignments of 0,NULL since they are defaults.
Zdenek Kabelac [Wed, 22 Oct 2014 12:30:19 +0000 (14:30 +0200)]
libdm: add DM_LIST_HEAD_INIT macro
Support to initialize dm_list struct members.
Zdenek Kabelac [Mon, 20 Oct 2014 13:02:59 +0000 (15:02 +0200)]
pool: better error message
Zdenek Kabelac [Mon, 20 Oct 2014 13:03:24 +0000 (15:03 +0200)]
pool: fix testmode support with pools
Allow the --test mode to proceed further.
Zdenek Kabelac [Tue, 21 Oct 2014 08:53:56 +0000 (10:53 +0200)]
raid: query lock holder
Ask for lock the proper LV.
Use the top-most LV to query for locally exclusive lock.
The rest of operations are then using 'lv_info()'
TODO:
Check all devices are reloaded from proper level.
In general any query on lv_is_active is supposed to be running
ona lv_lock_holder() volume.
Zdenek Kabelac [Mon, 20 Oct 2014 12:53:48 +0000 (14:53 +0200)]
cache: better error message
Zdenek Kabelac [Mon, 20 Oct 2014 12:58:29 +0000 (14:58 +0200)]
cache: validate for locked
Add extra safety.
Zdenek Kabelac [Mon, 20 Oct 2014 18:09:42 +0000 (20:09 +0200)]
cleanup: drop default implementation
Now we reference segment name via lvseg_name() and
we can drop default implementation and leave its
function pointer to be NULL.
Default give us 'return seg->segtype->name'.
This page took 0.070242 seconds and 5 git commands to generate.