]> sourceware.org Git - lvm2.git/log
lvm2.git
12 years agoFix a compiler warning.
Petr Rockai [Mon, 12 Dec 2011 00:08:23 +0000 (00:08 +0000)]
Fix a compiler warning.

12 years agoUse a more canonic regex escaping in the default lvm.conf file for testing.
Petr Rockai [Mon, 12 Dec 2011 00:01:12 +0000 (00:01 +0000)]
Use a more canonic regex escaping in the default lvm.conf file for testing.

12 years agoMove dm_config_write out of libdm, back to lib/config, as config_write.
Petr Rockai [Sun, 11 Dec 2011 23:18:20 +0000 (23:18 +0000)]
Move dm_config_write out of libdm, back to lib/config, as config_write.

12 years agoAdd a shell test for config parsing and merging (lvm dumpconfig).
Petr Rockai [Sun, 11 Dec 2011 23:14:37 +0000 (23:14 +0000)]
Add a shell test for config parsing and merging (lvm dumpconfig).

12 years agoAutoreconf.
Petr Rockai [Sun, 11 Dec 2011 17:24:37 +0000 (17:24 +0000)]
Autoreconf.

12 years agoAdd a unit test for dm_config_clone_node.
Petr Rockai [Sun, 11 Dec 2011 15:45:14 +0000 (15:45 +0000)]
Add a unit test for dm_config_clone_node.

12 years agoStart a rudimentary unit test for the dm_config_* interface.
Petr Rockai [Sun, 11 Dec 2011 15:19:41 +0000 (15:19 +0000)]
Start a rudimentary unit test for the dm_config_* interface.

12 years agoIn the dm_config_*get_* functions, make the actual value retrieval optional
Petr Rockai [Sun, 11 Dec 2011 15:18:32 +0000 (15:18 +0000)]
In the dm_config_*get_* functions, make the actual value retrieval optional
(useful for just checking that a given key is of a given type).

12 years agoUse pkg-config to look for CUnit (needed for systems where it's not on the
Petr Rockai [Sun, 11 Dec 2011 15:15:57 +0000 (15:15 +0000)]
Use pkg-config to look for CUnit (needed for systems where it's not on the
standard include path).

12 years agoNowadays, lvm-version.h is generated from lvm-version.h.in, and lives in the
Petr Rockai [Sat, 10 Dec 2011 14:55:31 +0000 (14:55 +0000)]
Nowadays, lvm-version.h is generated from lvm-version.h.in, and lives in the
build directory, not the source one -> fix test/shell/000-basic.sh.

12 years agoupdate FIXMEs
Alasdair Kergon [Sat, 10 Dec 2011 00:47:23 +0000 (00:47 +0000)]
update FIXMEs

12 years agoWhen dropping the VG metadata from the cache during a VG revert, we must
Alasdair Kergon [Thu, 8 Dec 2011 23:18:00 +0000 (23:18 +0000)]
When dropping the VG metadata from the cache during a VG revert, we must
reset the 'precomitted' flag, just as we'd clear if we next did a 'commit'.

12 years agoOnly use built-in stack size in clvmd - ignore lvm.conf.
Alasdair Kergon [Thu, 8 Dec 2011 21:24:08 +0000 (21:24 +0000)]
Only use built-in stack size in clvmd - ignore lvm.conf.

12 years agoTest for LCK_CLUSTER_VG directly in args[0].
Alasdair Kergon [Thu, 8 Dec 2011 18:32:33 +0000 (18:32 +0000)]
Test for LCK_CLUSTER_VG directly in args[0].
Drop unused LCK_LOCAL from debug msg.

12 years agoDon't pass LCK_LOCAL to clvmd - it's unused.
Alasdair Kergon [Thu, 8 Dec 2011 18:19:05 +0000 (18:19 +0000)]
Don't pass LCK_LOCAL to clvmd - it's unused.
Pass LCK_CLUSTER_VG in args[0] instead of args[1].

12 years agoUpdate comments. CLUSTER_VG belongs firmly to args[0].
Alasdair Kergon [Thu, 8 Dec 2011 18:09:48 +0000 (18:09 +0000)]
Update comments.  CLUSTER_VG belongs firmly to args[0].

12 years agoreinstate !first_time check
Alasdair Kergon [Thu, 8 Dec 2011 18:06:33 +0000 (18:06 +0000)]
reinstate !first_time check
(recovery from first_time failure would need different code)

12 years agotag uninit var
Alasdair Kergon [Thu, 8 Dec 2011 18:00:03 +0000 (18:00 +0000)]
tag uninit var

12 years agoFix lvm2-monitor init script to use normalized output when using vgs.
Peter Rajnoha [Wed, 7 Dec 2011 12:29:41 +0000 (12:29 +0000)]
Fix lvm2-monitor init script to use normalized output when using vgs.

12 years agoAdd policy based automated repair of RAID logical volumes
Jonathan Earl Brassow [Tue, 6 Dec 2011 19:30:15 +0000 (19:30 +0000)]
Add policy based automated repair of RAID logical volumes

The RAID plug-in for dmeventd now calls 'lvconvert --repair' to address failures
of devices in a RAID logical volume.  The action taken can be either to "warn"
or "allocate" a new device from any spares that may be available in the
volume group.  The action is designated by setting 'raid_fault_policy' in
lvm.conf - the default being "warn".

12 years agoFix FIXME and comment :-)
Milan Broz [Sat, 3 Dec 2011 11:36:10 +0000 (11:36 +0000)]
Fix FIXME and comment :-)

12 years agoSwitch locking bits to match RHEL5 version.
Milan Broz [Sat, 3 Dec 2011 11:34:35 +0000 (11:34 +0000)]
Switch locking bits to match RHEL5 version.

FIXME:
There is a problem with overloaded bit 0x80 in locking flag,
the bit flags array must be extended or changed.

12 years agoupdate old comment
Alasdair Kergon [Thu, 1 Dec 2011 14:57:30 +0000 (14:57 +0000)]
update old comment

12 years agoDon't allow two images to be split and tracked from a RAID LV at one time
Jonathan Earl Brassow [Thu, 1 Dec 2011 00:21:04 +0000 (00:21 +0000)]
Don't allow two images to be split and tracked from a RAID LV at one time

Also, don't allow a splitmirror operation on a RAID LV that is already tracking
a split, unless the operation is to stop the tracking and complete the split.
Example:
~> lvconvert --splitmirrors 1 --trackchanges vg/lv /dev/sdc1
# Now tracking changes - image can be merged back or split-off for good
~> lvconvert --splitmirrors 1 -n new_name vg/lv /dev/sdc1
# ^ Completes split ^

If a split is performed on a RAID that is tracking an already split image and
PVs are provided, we must ensure that
 1) the already split LV is represented in the PVs
 2) we are careful to split only the tracked image

12 years ago Don't allow size change of RAID LV that is tracking changes for a split image
Jonathan Earl Brassow [Thu, 1 Dec 2011 00:13:16 +0000 (00:13 +0000)]
  Don't allow size change of RAID LV that is tracking changes for a split image
  Don't allow size change of RAID sub-LVs independently

12 years agoDo not allow users to change the name of RAID sub-LVs or the name of the
Jonathan Earl Brassow [Thu, 1 Dec 2011 00:09:34 +0000 (00:09 +0000)]
Do not allow users to change the name of RAID sub-LVs or the name of the
RAID LV if it is tracking changes for a split image.

12 years agoWHATS_NEW for previous commit.
Jonathan Earl Brassow [Thu, 1 Dec 2011 00:05:40 +0000 (00:05 +0000)]
WHATS_NEW for previous commit.

12 years agoDo not allow users to change permissions on RAID sub-LVs.
Jonathan Earl Brassow [Thu, 1 Dec 2011 00:04:21 +0000 (00:04 +0000)]
Do not allow users to change permissions on RAID sub-LVs.

12 years agorefer to kernel docs for target info
Alasdair Kergon [Wed, 30 Nov 2011 22:32:37 +0000 (22:32 +0000)]
refer to kernel docs for target info
FIXME thin still missing

12 years agoUpdate comment on LCK_*DMEVENTD*.
Petr Rockai [Wed, 30 Nov 2011 17:02:37 +0000 (17:02 +0000)]
Update comment on LCK_*DMEVENTD*.

12 years agoFix clvmd to respect DMEVENTD_MONITOR_IGNORE. Fixes a bug where dmeventd
Petr Rockai [Wed, 30 Nov 2011 17:00:57 +0000 (17:00 +0000)]
Fix clvmd to respect DMEVENTD_MONITOR_IGNORE. Fixes a bug where dmeventd
actions caused clvmd to turn off monitoring of the volume causing the action.

12 years agoThe LV_REBUILD flag is not internal - bad comments in metadata-exported.h updated
Jonathan Earl Brassow [Wed, 30 Nov 2011 02:20:13 +0000 (02:20 +0000)]
The LV_REBUILD flag is not internal - bad comments in metadata-exported.h updated

12 years agoSupport the ability to replace specific devices in a RAID array.
Jonathan Earl Brassow [Wed, 30 Nov 2011 02:02:10 +0000 (02:02 +0000)]
Support the ability to replace specific devices in a RAID array.

RAID is not like traditional LVM mirroring.  LVM mirroring required failed
devices to be removed or the logical volume would simply hang.  RAID arrays can
keep on running with failed devices.  In fact, for RAID types other than RAID1,
removing a device would mean substituting an error target or converting to a
lower level RAID (e.g. RAID6 -> RAID5, or RAID4/5 to RAID0).  Therefore, rather
than removing a failed device unconditionally and potentially allocating a
replacement, RAID allows the user to "replace" a device with a new one.  This
approach is a 1-step solution vs the current 2-step solution.

example> lvconvert --replace <dev_to_remove> vg/lv [possible_replacement_PVs]

'--replace' can be specified more than once.

example> lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lv

12 years agoFix last checkin for replicator.
Peter Rajnoha [Tue, 29 Nov 2011 12:10:38 +0000 (12:10 +0000)]
Fix last checkin for replicator.

12 years agoAdd activation/use_linear_target enabled by default. (prajnoha)
Alasdair Kergon [Mon, 28 Nov 2011 20:37:51 +0000 (20:37 +0000)]
Add activation/use_linear_target enabled by default.   (prajnoha)

LVM metadata knows only of striped segments - not linear ones.
The activation code detects segments with a single stripe and switches
them to use the linear target.

If the new lvm.conf setting is set to 0 (e.g. in a test script), this
'optimisation' is turned off.

12 years agoTry longer sleep
Zdenek Kabelac [Wed, 23 Nov 2011 15:27:14 +0000 (15:27 +0000)]
Try longer sleep

Seems like testing machine could be busy - so 10s might not be enough
for rechecking status.

12 years agoCleanup files from testing
Zdenek Kabelac [Wed, 23 Nov 2011 14:56:47 +0000 (14:56 +0000)]
Cleanup files from testing

Cleanup generated files from coverage testing.
Do not skip standard .o compilation for lib/not and lib/harness.
Make a bit longer string in harness to fit new shell/ in.

12 years agoSwap condition order
Zdenek Kabelac [Wed, 23 Nov 2011 13:03:57 +0000 (13:03 +0000)]
Swap condition order

Swap condtion so the make line does not return 'false'.
Remove cleanup of lvm2api.sh since it is not created anymore.

12 years agoPut back devmapper-event linkage
Zdenek Kabelac [Wed, 23 Nov 2011 13:02:17 +0000 (13:02 +0000)]
Put back devmapper-event linkage

Older systems are not able to get this library from lvm2api library and need
this library to be passed to the linker (i.e. Debian Lenny).

12 years agoCleanup test makefiles
Zdenek Kabelac [Wed, 23 Nov 2011 12:21:41 +0000 (12:21 +0000)]
Cleanup test makefiles

Simplify /api makefile and use SUBDIRS target for test dir.
Properly cleanup Makefiles with distclean in /test.
Use symbolic links for shell scripts for non-srcdir compilation.

12 years agoSplit gcc warning options
Zdenek Kabelac [Wed, 23 Nov 2011 12:19:23 +0000 (12:19 +0000)]
Split gcc warning options

Use gcc warning options only for .c -> .o compilation
So it makes the output more clear.

Do not use INCLUDES and DEFS for .o -> .so.

Do not use CFLAGS for deps .d generation.

12 years agoUse 3 digits for chmod
Zdenek Kabelac [Wed, 23 Nov 2011 12:18:42 +0000 (12:18 +0000)]
Use 3 digits for chmod

Use same sized chmod params (0 are filled from left on its own)
and we use just 3 digits elsewhere.

12 years agoMove y/n prompts to stderr and repeat if response has both 'n' and 'y'.
Alasdair Kergon [Wed, 23 Nov 2011 01:34:38 +0000 (01:34 +0000)]
Move y/n prompts to stderr and repeat if response has both 'n' and 'y'.

(Note that in a future release we might make this stricter and insist
on exactly 'y' or 'n'.)

13 years ago--addtag instead of --tag
Peter Rajnoha [Tue, 22 Nov 2011 13:54:05 +0000 (13:54 +0000)]
--addtag instead of --tag

13 years agoCleanup gcc warning
Zdenek Kabelac [Mon, 21 Nov 2011 13:15:40 +0000 (13:15 +0000)]
Cleanup gcc warning

bitset_t.c:39: warning: 'last' may be used uninitialized in this function

Compiler is not smart enough to see the code path which avoid using
unitialized 'last'.

13 years agoAdd some cflags to ldflags
Zdenek Kabelac [Mon, 21 Nov 2011 13:11:03 +0000 (13:11 +0000)]
Add some cflags to ldflags

Things like gcov needs the compilation flags for linker as well.
TODO: cleanup compilation flags usage

13 years agoMore of WHATS_NEW.
Petr Rockai [Mon, 21 Nov 2011 12:44:38 +0000 (12:44 +0000)]
More of WHATS_NEW.

13 years agoUpdate WHATS_NEW.
Petr Rockai [Mon, 21 Nov 2011 12:33:56 +0000 (12:33 +0000)]
Update WHATS_NEW.

13 years agoFix a bug in dmeventd snapshot monitoring code where the monitoring threshold
Petr Rockai [Mon, 21 Nov 2011 12:31:18 +0000 (12:31 +0000)]
Fix a bug in dmeventd snapshot monitoring code where the monitoring threshold
would grow with subsequent snapshot extensions (RHBZ 754198).

13 years agoFix the last fix (t-XXX -> shell/XXX).
Petr Rockai [Mon, 21 Nov 2011 11:36:53 +0000 (11:36 +0000)]
Fix the last fix (t-XXX -> shell/XXX).

13 years agoFix the fallout in shell tests from the t-XXX -> shell/XXX move.
Petr Rockai [Mon, 21 Nov 2011 11:25:35 +0000 (11:25 +0000)]
Fix the fallout in shell tests from the t-XXX -> shell/XXX move.

13 years agoAdd CUnit testing support
Zdenek Kabelac [Mon, 21 Nov 2011 10:40:21 +0000 (10:40 +0000)]
Add CUnit testing support

Regenerate configure for unit test support.

13 years agoTidy the shell tests into their own subdir. We now have:
Petr Rockai [Mon, 21 Nov 2011 00:15:42 +0000 (00:15 +0000)]
Tidy the shell tests into their own subdir. We now have:
- test/lib -- infrastructure and helper code
- test/api -- liblvm2app API tests
- test/unit -- C-based unit tests
- test/shell -- shell-based functional tests

13 years agoFix a syntax error.
Petr Rockai [Sun, 20 Nov 2011 21:55:24 +0000 (21:55 +0000)]
Fix a syntax error.

13 years agoImplement a CUnit-based runner for unit tests. Copy and adapt (actual unit)
Petr Rockai [Sun, 20 Nov 2011 21:43:20 +0000 (21:43 +0000)]
Implement a CUnit-based runner for unit tests. Copy and adapt (actual unit)
tests from unit-tests/*/*_t.c (now under test/unit). The valgrind/pool test is
missing, since it's not really a unit test and probably not too valuable
either. Available via "make unit" (and if --enable-testing was passed to
configure, also executed by make check).

13 years agoDon't ignore configure --mandir and --infodir.
Alasdair Kergon [Sun, 20 Nov 2011 20:52:09 +0000 (20:52 +0000)]
Don't ignore configure --mandir and --infodir.

13 years agoDrop pool memory allocated in lv_has_target_type
Zdenek Kabelac [Fri, 18 Nov 2011 19:42:03 +0000 (19:42 +0000)]
Drop pool memory allocated in lv_has_target_type

Remove FIXMES - there should not be any pool free call since
the memory pool is from device manager, and pool is detroyed
after the operation, so doing extra free here would not help here.

However lv_has_target_type() is using cmd mempool so here the extra
call for dm_pool_free makes sence.

13 years agoRemove constant expression check
Zdenek Kabelac [Fri, 18 Nov 2011 19:36:10 +0000 (19:36 +0000)]
Remove constant expression check

"result_independent_of_operands: ((dev->dev & 0xfff00UL) >> 8) ==
18446744073709551615UL /* -1 */ is always false regardless of the values
of its operands (logical operand of if)."

'dev->dev' is set in dev-cache.c _insert() and it's not expectable
st_rdev would have '-1'

This code has been introduced with drbd support commit and code never
worked - so eliminated.

13 years agoCheck target type name for DM_MAX_TYPE_NAME length
Zdenek Kabelac [Fri, 18 Nov 2011 19:34:02 +0000 (19:34 +0000)]
Check target type name for DM_MAX_TYPE_NAME length

Avoid creation of target type name when it's longer then
DM_MAX_TYPE_NAME (noticed by static analyzer where the
sp.target_type might be missing '\0' at the end.)

Before patch:

$> dmsetup create long
0 1000 looooooooooooooooooooooooooong
^D
device-mapper: reload ioctl failed: Invalid argument

After patch:

$> dmsetup create xxx
0 1000 looooooooooooooooooooooooooong
Target type name looooooooooooooooooooooooooong is too long.
Command failed

13 years agoReplace dynamic buffer allocations for PATH_MAX
Zdenek Kabelac [Fri, 18 Nov 2011 19:31:09 +0000 (19:31 +0000)]
Replace dynamic buffer allocations for PATH_MAX

Use static buffer instead of stack allocated buffer.
This reduces stack size usage of lvm tool and the
change is very simple.

Since the whole library is not thread safe - it should not
add any new problems - and if there will be some conversion
it's easy to convert this to use some preallocated buffer.

13 years agoUnlock memory for vg_write
Zdenek Kabelac [Fri, 18 Nov 2011 19:28:00 +0000 (19:28 +0000)]
Unlock memory for vg_write

For write we do not need to hold memory locked.
This relaxes many conditions and avoid problems when allocating
a lot of memory for writting metadata buffers.
(In case of huge MDA size this would lead to mismatch between
locked and unlocked memory region size).

Add also internal check we are not writing in critical section.

13 years agoQuery before removing inactive snapshots
Zdenek Kabelac [Fri, 18 Nov 2011 19:25:20 +0000 (19:25 +0000)]
Query before removing inactive snapshots

Removal of an inactive origin removes also all related snapshots.

When we now support 'old' external snapshots with thin volumes,
removal of pool will not only drop all thin volumes, but as
a consequence also all snapshots - which might be seen a bit
unexpected for the user - so add a query to confirm such action.

lvremove -f will skip the prompt.

13 years agoAllow to activate snapshot
Zdenek Kabelac [Fri, 18 Nov 2011 19:22:49 +0000 (19:22 +0000)]
Allow to activate snapshot

Add extra code to active and deactivate related
snapshots and origin when user specifies snapshot
logical volume as lvchange parameter.

Before patch:

$> lvs -a
  LV    VG   Attr     LSize  Pool Origin Snap%  Move Log Copy%  Convert
  lvol0 mvg  owi-a-s-  1.00k
  lvol1 mvg  swi-a-s- 16.00k      lvol0    0.00
  lvol2 mvg  swi-a-s- 16.00k      lvol0    0.00

$> lvchange -an mvg/lvol2; echo $?
  Can't change snapshot logical volume "lvol2".
5

After patch:

$> lvchange -an mvg/lvol2
Change of snapshot lvol2 will also change its origin lvol0 and 1 other
snapshot(s). Proceed? [y/n]: n
  Logical volume lvol2 not changed.

$> lvchange -y -an mvg/lvol2; echo $?
0

$> lvs -a
  LV    VG   Attr     LSize  Pool Origin Snap%  Move Log Copy%  Convert
  lvol0 mvg  owi---s-  1.00k
  lvol1 mvg  swi---s- 16.00k      lvol0
  lvol2 mvg  swi---s- 16.00k      lvol0

13 years agoSkip non-virtual snapshots for availability
Zdenek Kabelac [Fri, 18 Nov 2011 19:19:22 +0000 (19:19 +0000)]
Skip non-virtual snapshots for availability

Change the behavior of availability change.
With this patch the lvgchange returns success
when VG is properly changed.

It skips non-virtual origins from being changes when
only 'vg' is specified as lvchange -a parameter.

Before this change we had this:

$> lvs -a
  LV    VG   Attr     LSize   Pool Origin
  lvol0 mvg  owi-a-s- 128.00k
  lvol1 mvg  owi-a-s- 128.00k
  lvol2 mvg  swi-a-s-   1.25m      lvol0
  lvol3 mvg  swi-a-s-   1.25m      lvol1

$> lvchange -an mvg ; echo $?
  Can't change snapshot logical volume "lvol2".
  Can't change snapshot logical volume "lvol3".
5

$> lvs -a
  LV    VG   Attr     LSize   Pool Origin
  lvol0 mvg  owi---s- 128.00k
  lvol1 mvg  owi---s- 128.00k
  lvol2 mvg  swi---s-   1.25m      lvol0
  lvol3 mvg  swi---s-   1.25m      lvol1

$> lvchange -ay mvg ; echo $?
  Can't change snapshot logical volume "lvol2".
  Can't change snapshot logical volume "lvol3".
5

$> lvs
  LV    VG   Attr     LSize   Pool Origin
  lvol0 mvg  owi-a-s- 128.00k
  lvol1 mvg  owi-a-s- 128.00k
  lvol2 mvg  swi-a-s-   1.25m      lvol0
  lvol3 mvg  swi-a-s-   1.25m      lvol1

After commit:

$> lvs -a
  LV    VG   Attr     LSize   Pool Origin
  lvol0 mvg  owi-a-s- 128.00k
  lvol1 mvg  owi-a-s- 128.00k
  lvol2 mvg  swi-a-s-   1.25m      lvol0
  lvol3 mvg  swi-a-s-   1.25m      lvol1

$> lvchange -an mvg ; echo $?
0

$> lvs -a
  LV    VG   Attr     LSize   Pool Origin
  lvol0 mvg  owi---s- 128.00k
  lvol1 mvg  owi---s- 128.00k
  lvol2 mvg  swi---s-   1.25m      lvol0
  lvol3 mvg  swi---s-   1.25m      lvol1

$> lvchange -ay mvg ; echo $?
0

$> lvs -a
  LV    VG   Attr     LSize   Pool Origin
  lvol0 mvg  owi-a-s- 128.00k
  lvol1 mvg  owi-a-s- 128.00k
  lvol2 mvg  swi-a-s-   1.25m      lvol0
  lvol3 mvg  swi-a-s-   1.25m      lvol1

13 years agoAdjusted mirror region size only for mirrors and raids
Zdenek Kabelac [Tue, 15 Nov 2011 17:32:12 +0000 (17:32 +0000)]
Adjusted mirror region size only for mirrors and raids

Update region_size only for mirror and raid targets.
This fixes warning messages when vg is using small
extent size like 1KiB and no mirror/raid is created,
but the user still got the message:

$> vgcreate -s 1K vg  <pvs>
$> lvcreate -L10K vg
Using reduced mirror region size of 4 sectors

13 years agoThin update prompt message
Zdenek Kabelac [Tue, 15 Nov 2011 17:29:52 +0000 (17:29 +0000)]
Thin update prompt message

Enhance message with info about how many thin volumes are going to
be removed with thin pool removal.

13 years agoReorder AND test condition
Zdenek Kabelac [Tue, 15 Nov 2011 17:27:41 +0000 (17:27 +0000)]
Reorder AND test condition

Take the easiest condition for checking first since they must
apply all together, check local conditions first before doing
more expensive tests.

13 years agoThin clean
Zdenek Kabelac [Tue, 15 Nov 2011 17:25:05 +0000 (17:25 +0000)]
Thin clean

Reuse seg pointer already set in _add_lv_to_dtree to have the
value of first_seg(lv) (and is used in other parts of this function).

13 years agoThin supports only thin volumes as snapshot origins
Zdenek Kabelac [Tue, 15 Nov 2011 17:23:51 +0000 (17:23 +0000)]
Thin supports only thin volumes as snapshot origins

It's currently of the scope to properly solve the snapshoting
of internal thin devs so prevent non-toplevel snapshots here.

13 years agoSimplify iteration
Zdenek Kabelac [Tue, 15 Nov 2011 17:21:02 +0000 (17:21 +0000)]
Simplify iteration

Since nothing is removed in dm_list snapshot_segs during the loop,
there is no reason to use _safe iteration, so switch to simplier
dm_list_iterate().

13 years agoThin fix tpool layer
Zdenek Kabelac [Tue, 15 Nov 2011 17:15:03 +0000 (17:15 +0000)]
Thin fix tpool layer

Since we support snapshots of thin volumes, we could have more layers,
so we have to check whether tpool layer is going to be inserted.

As the _add_segment_to_dtree() is the only place that adds tpool
segment, we may just check pointer (no strcmp for layer).

Switch to use  seg_is_  function instead of lv_is_.

13 years agoInclude a copy of kernel DM documentation in doc/kernel
Alasdair Kergon [Tue, 15 Nov 2011 13:54:20 +0000 (13:54 +0000)]
Include a copy of kernel DM documentation in doc/kernel

13 years agoAvoid 'mda inconsistency' by properly registering UNLABELLED_PV flag (2.02.86).
Peter Rajnoha [Tue, 15 Nov 2011 11:54:15 +0000 (11:54 +0000)]
Avoid 'mda inconsistency' by properly registering UNLABELLED_PV flag (2.02.86).

When a PV label write is deferred to a vg_write call (as introduced by a patch
in 2.02.86), the PV is flagged with the internal UNLABELLED_PV flag. However,
when calling vg_archive before vg_write, we still have the PV labelled with the
UNLABELLED_PV flag which was not recognised as a proper flag while exporting
VG metadata:

  # vgcreate vg /dev/sda
  No physical volume label read from /dev/sda
  Metadata inconsistency: Not all flags successfully exported.
  Metadata inconsistency: Not all flags successfully exported.
  Writing physical volume data to disk "/dev/sda"
  Physical volume "/dev/sda" successfully created
  Volume group "vg" successfully created

13 years agoMake dmsetup.static and lvm.static build when dmeventd is disabled.
Alasdair Kergon [Mon, 14 Nov 2011 21:30:35 +0000 (21:30 +0000)]
Make dmsetup.static and lvm.static build when dmeventd is disabled.
udev may also need to be disabled if you didn't build it statically too.

dmeventd.static could be fixed with some more work but I don't really see the
point: without dlopen() it's useless, and if you have dlopen(), why not support
normal shared libraries too?

13 years agoIncomplete documentation is worse than no documentation.
Alasdair Kergon [Sun, 13 Nov 2011 01:41:57 +0000 (01:41 +0000)]
Incomplete documentation is worse than no documentation.
Any documentation less-detailed than Documentation/device-mapper is
dangerous for the non-trivial ctr lines.  And anyway, this should be in s4
not here.

13 years agoAdd missing stack reporting
Zdenek Kabelac [Sat, 12 Nov 2011 22:53:23 +0000 (22:53 +0000)]
Add missing stack reporting

also remove unneeded {}

13 years agoThin use items iterator and stack reporting
Zdenek Kabelac [Sat, 12 Nov 2011 22:52:18 +0000 (22:52 +0000)]
Thin use items iterator and stack reporting

13 years agoMissing stack printing
Zdenek Kabelac [Sat, 12 Nov 2011 22:51:20 +0000 (22:51 +0000)]
Missing stack printing

13 years agoUpdate dmsetup man page
Zdenek Kabelac [Sat, 12 Nov 2011 22:48:44 +0000 (22:48 +0000)]
Update dmsetup man page

Use standard manpage style.
Keep options and commands in alphabetic order.
Added at least a very simply info about some other targets.
TODO: documenting targest needs far more work...

13 years agoThin remove unused define
Zdenek Kabelac [Sat, 12 Nov 2011 22:44:10 +0000 (22:44 +0000)]
Thin remove unused define

Remove DM_THIN_ERROR_DEVICE_ID from API.
Remove API warning.
Drop code that was using DM_THIN_ERROR_DEVICE_ID (already commented)
Remove debug message which slipped in through some previous commit.

13 years agoMove gentoo MAKEDEV to /sbin in lvm2create_initrd. (James Le Cuirot)
Alasdair Kergon [Sat, 12 Nov 2011 17:03:53 +0000 (17:03 +0000)]
Move gentoo MAKEDEV to /sbin in lvm2create_initrd. (James Le Cuirot)

13 years agoFix major number filter structure boundary test.
Milan Broz [Fri, 11 Nov 2011 16:59:30 +0000 (16:59 +0000)]
Fix major number filter structure boundary test.

13 years agoRemove unneeded parameter.
Milan Broz [Fri, 11 Nov 2011 16:41:37 +0000 (16:41 +0000)]
Remove unneeded parameter.

13 years agoAnd now add files for real.
Milan Broz [Fri, 11 Nov 2011 15:24:48 +0000 (15:24 +0000)]
And now add files for real.

13 years agoFix function name in previous patch.
Milan Broz [Fri, 11 Nov 2011 15:14:05 +0000 (15:14 +0000)]
Fix function name in previous patch.

13 years agoDo not scan device if it is part of active multipath.
Milan Broz [Fri, 11 Nov 2011 15:11:08 +0000 (15:11 +0000)]
Do not scan device if it is part of active multipath.

Add filter which tries to check if scanned device is part
of active multipath.

Firstly, only SCSI major number devices are handled in filter.

Then it checks if device has exactly one holder (in sysfs) and
if it is device-mapper device and DM-UUID is prefixed by "MPATH-".

If so, this device is filtered out.

The whole filter can be switched off by setting
mpath_component_detection in lvm.conf.

https://bugzilla.redhat.com/show_bug.cgi?id=597010

Signed-off-by: Milan Broz <mbroz@redhat.com>
13 years agoThin send create_snap message
Zdenek Kabelac [Thu, 10 Nov 2011 15:30:59 +0000 (15:30 +0000)]
Thin send create_snap message

Start creating snapshots for real.
Update test suite to check it happens.

13 years agoThin update testing script
Zdenek Kabelac [Thu, 10 Nov 2011 12:44:33 +0000 (12:44 +0000)]
Thin update testing script

13 years agoAdd generic function to check for target version
Zdenek Kabelac [Thu, 10 Nov 2011 12:44:00 +0000 (12:44 +0000)]
Add generic function to check for target version

So the test script may use a simple line like i.e.:

aux target_at_least dm-thin-pool 1 0 0 || skip
aux target_at_least snapshot-origin 1 6 || skip

13 years agoSmall comment and indent updates
Zdenek Kabelac [Thu, 10 Nov 2011 12:43:05 +0000 (12:43 +0000)]
Small comment and indent updates

13 years agoThin test min thin_pool size for at least 1 chunk
Zdenek Kabelac [Thu, 10 Nov 2011 12:42:36 +0000 (12:42 +0000)]
Thin test min thin_pool size for at least 1 chunk

13 years agoThin align volume size on chunk boundary size
Zdenek Kabelac [Thu, 10 Nov 2011 12:42:15 +0000 (12:42 +0000)]
Thin align volume size on chunk boundary size

If the extent_size is smaller then the chunk_size we may try
to find better aligment (wasting less space).

i.e. using  4KB extent_size and  64KB chunk size will
lead to creation of 64KB aligned thin volume.

13 years agoThin lvcreate manpage
Zdenek Kabelac [Thu, 10 Nov 2011 12:41:39 +0000 (12:41 +0000)]
Thin lvcreate manpage

Merge thin creation into standard 1st. lvcreate.
Update snapshot for thin support.

13 years agoThin move _read_activation_params check
Zdenek Kabelac [Thu, 10 Nov 2011 12:40:29 +0000 (12:40 +0000)]
Thin move _read_activation_params check

Since we finaly recognize thin creation only after
_determine_snapshot_type() - move _read_activation_params()
after it - so we can support  lvcreate -an thin snapshot.

13 years agoThin create normal (old) snapshot when size is specified
Zdenek Kabelac [Thu, 10 Nov 2011 12:39:46 +0000 (12:39 +0000)]
Thin create normal (old) snapshot when size is specified

13 years agoThin disable pool create without activation
Zdenek Kabelac [Thu, 10 Nov 2011 12:39:01 +0000 (12:39 +0000)]
Thin disable pool create without activation

13 years agoAdd missing free() for line that is malloc()'d by getline().
Mike Snitzer [Tue, 8 Nov 2011 19:02:21 +0000 (19:02 +0000)]
Add missing free() for line that is malloc()'d by getline().

13 years agoFix _get_proc_number to be tolerant of malformed /proc/misc entries.
Mike Snitzer [Tue, 8 Nov 2011 17:32:10 +0000 (17:32 +0000)]
Fix _get_proc_number to be tolerant of malformed /proc/misc entries.

Fixes issue reported here: http://lkml.org/lkml/2011/11/8/190

13 years agoThin ensure pool table is update after resize
Zdenek Kabelac [Tue, 8 Nov 2011 12:19:53 +0000 (12:19 +0000)]
Thin ensure pool table is update after resize

Always make sure table gets reloaded.
For now activate and deactivate pool volume if it's not active.

FIXME: we could do this only if we are sure some thin volume is alive.

13 years agoUpdate lvs man page style.
Zdenek Kabelac [Tue, 8 Nov 2011 12:16:53 +0000 (12:16 +0000)]
Update  lvs man page style.

This page took 0.069063 seconds and 5 git commands to generate.