1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
Commit Graph

9954 Commits

Author SHA1 Message Date
Peter Rajnoha
a61c5c5b3a revert: 7639eae and 4a52a92
Revert 7639eae891 and
4a52a9212c. We need a better fix here.
2014-11-20 08:22:34 +01:00
Zdenek Kabelac
8d8c1b6624 tests: use snapshot targets 2014-11-19 23:24:18 +01:00
Zdenek Kabelac
c75548300d tests: prepare control node before clvmd
Make sure there is 'control' node before clvmd is started.
Somehow  'clvmd' is not allowed by selinux to create one.

TODO: Check is selinux policy is right here...
2014-11-19 23:22:52 +01:00
Zdenek Kabelac
d7985ebead thin: fix error path
Print pool name and not the origin name.
2014-11-19 18:58:30 +01:00
Peter Rajnoha
4a52a9212c systemd: clvmd and cmirrord systemd unit - use usrsbindir instead of sbindir 2014-11-19 16:06:05 +01:00
Peter Rajnoha
7639eae891 configure: expand prefix and exec_prefix directly in configure
In case someone wants to use @some_path@ that contains
prefix or exec_prefix and it's used in other files than Makefiles
(Makefiles used make.tmpl to expand these).
2014-11-19 16:03:27 +01:00
Peter Rajnoha
74ed1ba9f9 configure: make configure --enable-udev-systemd-background-jobs only for systemd >= 205
systemd-run is available in systemd>=205. Also, this fix prevents
systemd-specific udev rules in 69-dm-lvm-metad.rules to appear in
case systemd environment is not available - make configure to check
this automatically and use these systemd specific rules only if it
is applicable.
2014-11-19 13:47:18 +01:00
Zdenek Kabelac
422d1ac8d2 man: clvmd updates
- closer to the recommendation of man-pages (7) if possible
- Add crossrefs
- Sort options and crossrefs
- Fix default timeout (60 secs) of -t
- Documents -I[auto]

Signed-off-by: Stéphane Aulery <saulery@free.fr>
2014-11-19 01:09:52 +01:00
Zdenek Kabelac
5226181329 man: clvmd help output
Closer to the recommendation of groff_man (7) if possible

Signed-off-by: Stéphane Aulery <saulery@free.fr>
2014-11-19 01:09:52 +01:00
Zdenek Kabelac
10330b8782 man: blkdeactivate help output
- Closer to the recommendation of man-pages and groff_man (7) if
  possible
- Sort options and crossrefs
- Relocate sub-options on the right places

Signed-off-by: Stéphane Aulery <saulery@free.fr>
2014-11-19 01:09:24 +01:00
Zdenek Kabelac
731e99025b man: lvchange update
Fix \fI usage.
2014-11-19 00:31:23 +01:00
Zdenek Kabelac
53d2db31c6 cleanup: drop unused var 2014-11-18 16:50:49 +01:00
Zdenek Kabelac
01760967b4 locking: rename LCK_CONVERT
All 'MODE' bits are using _MODE suffix so rename to LCK_CONVERT_MODE
(part of rhbz 735445).
No functional change.
2014-11-18 16:50:49 +01:00
David Teigland
aaa6205d5a toollib: improve ignore_vg case in _process_pvs_in_vgs
ignore_vg now returns 0 for the FAILED_CLUSTERED case,
so all the ignore_vg 1 cases will return vg's with an
empty vg->pvs, so we do not need to iterate through
vg->pvs to remove the entries from the devices list.

Clean up whitespace problems in that area from the
previous commit.
2014-11-18 09:25:56 -06:00
Petr Rockai
cf37c04347 memlock: Make malloc reserve more robust against glibc tricks. 2014-11-18 03:17:27 +01:00
Zdenek Kabelac
542b03ee00 tests: deactivate repaired before swap 2014-11-17 08:44:53 +01:00
Zdenek Kabelac
740fcdae7d tests: thin repair testing
More checks for thin related tools.
Add same functionality for cache related tools.
2014-11-17 00:41:33 +01:00
Zdenek Kabelac
3a1c609ac4 tests: reduce number of sync waiting
Lets assume faster systems, if we have too big raid arrays,
reduce them.
2014-11-17 00:34:44 +01:00
Zdenek Kabelac
776934aa08 tests: skip another older kernel from raid456 2014-11-17 00:32:49 +01:00
David Teigland
b622a7fe3f toollib: fixes and cleanup of recent changes
- Fix problems with recent changes related to skipping in:
  . _process_vgnameid_list
  . _process_pvs_in_vgs

- Undo unnecessary changes to the code structure and readability.

- Preserve valid but minor changes:
  . testing FAILED bit values in ignore_vg
  . using "skip" value from ignore_vg instead of "ret" value
  . applying the sigint check to the start of all loops
  . setting stack backtrace when ECMD_PROCESSED is not returned,
    i.e. apply the following pattern:

	ret = process_foo();
	if (ret != ECMD_PROCESSED)
		stack;
	if (ret > ret_max)
		ret_max = ret;
2014-11-14 16:58:09 -06:00
Zdenek Kabelac
513105c6ac toollib: ignore_vg() with skip is not locked
Extend/fix d8923457b8 commit.

'skip'-ed VG is not holding any lock - so don't unlock such VG.

At the same time simplify the code around and relase VG at a single
place and unlock only not skiped and not ignored VGs.
2014-11-14 19:32:03 +01:00
Zdenek Kabelac
27182e1ddb tests: explicit raid sync 2014-11-14 18:12:44 +01:00
Zdenek Kabelac
fd32bb1991 debug: switch to verbose
When there is no real error from the function - avoid using log_error().
2014-11-14 18:12:44 +01:00
Zdenek Kabelac
b6f921e5cb debug: better message for pool zeroing state 2014-11-14 18:12:35 +01:00
Zdenek Kabelac
38200c2000 cleanup: add '.' to log messages 2014-11-14 18:12:35 +01:00
Zdenek Kabelac
f36080a05d vg_read: correct warning
Use log_warn when we are effectively not creating an error -
we 'allowed' inconsistent read for a reason - so it's just warning
level we process inconsistent VG - it's upto caller later to decide
error level of command return value and in case of error it needs
to use log_error then.
2014-11-14 18:12:35 +01:00
Zdenek Kabelac
d8923457b8 toolib: fix ignore_vg
Rework ignore_vg() API so it properly handles
multiple kind of vg_read_error() states.

Skip processing only otherwise valid VG.

Always return ECMD_FAILED when break is detected.

Check sigint_caught() in front of dm iterator loop.

Add stack for _process failing ret codes.
2014-11-14 18:10:45 +01:00
Zdenek Kabelac
06e3f1757e vg_read: use new error flag
Failed recovery provides different (NULL) VG then FAILED_INCONSISTENT.
Mark it with different failure bit - since FAILED_INCONSISTENT is
supposed to contain something 'usable' (thought inconsistent).
2014-11-14 18:09:27 +01:00
David Teigland
01bbbc27bf lvmcache: remove unnecessary line break syntax 2014-11-13 11:07:34 -06:00
David Teigland
474c6a5271 lvmcache.7: remove unwanted line continuation syntax 2014-11-13 11:04:15 -06:00
Stéphane Aulery
271252eff7 lvconvert.8: fix bold and italic syntax mistake
Signed-off-by: Stéphane Aulery <saulery@free.fr>
2014-11-13 17:49:42 +01:00
Zdenek Kabelac
88e944b5a3 cleanup: remove unused headers 2014-11-13 17:49:42 +01:00
Zdenek Kabelac
428b9fcd87 cleanup: validate pointers
Mostly on almost impossible to happen paths - but stay safe.
2014-11-13 17:49:42 +01:00
Zdenek Kabelac
7278556c76 lvm2api: use fully initilized struct
Don't pass partially initialized struct.
2014-11-13 17:49:41 +01:00
Zdenek Kabelac
49e3fd1ce8 reporter: drop mem on error path
Coverity noticed.
2014-11-13 17:44:31 +01:00
Zdenek Kabelac
6308a8b06d cache: wrong feature in seg is internal error 2014-11-13 17:44:31 +01:00
Peter Rajnoha
48874703d2 cleanup: free mempool memory used for LV status in PVSEGS reporting
Addendum to previous commit 4de7699855.
2014-11-13 14:41:01 +01:00
Peter Rajnoha
4de7699855 cleanup: unify LV info and LV segment status reporting in combination with LVS, SEGS and PVSEGS reporting
Move common code into shared internal fn so the logic for getting the
LV info as well LV segment status is not scattered around - call common
_do_info_and_status to gather required parts in reporting handlers.
2014-11-13 14:28:51 +01:00
Peter Rajnoha
83308fdff9 cleanup: cleanup internal interface to acquire segment status
- Add separate lv_status fn (if we're interested only in seg status,
   but not lv info at the same time as it is with existing
   lv_info_with_seg_status fn). So we 3 fns:

     - lv_info (existing one, runs only info ioctl, fills in struct lvinfo only)

     - lv_status (new one, runs status ioctl, fills in struct lv_seg_status only)

     - lv_info_with_seg_status (existing one, runs status ioctl, fills
       in struct lvinfo as well as lv_seg_status)

 - Add more comments in the code explaining the difference between lv_info,
   lv_status and lv_info_with_seg_status and their return values.

 - Move decision whether lv_info_with_seg_status needs to call only
   status ioctl (in case the segment for which we require status is from
   the LV for which we require info) or separate status and info ioctl
   (in case the segment for which we require status is from different
    LV that the one for which we require info) into
   lv_info_with_seg_status fn so caller doesn't need to bother about
   this at all.

 - Cleanup internal interface for this seg status so it's more readable.
2014-11-13 14:28:51 +01:00
Alasdair G Kergon
efe5245e47 pvck: Use non-zero exit status after failure. 2014-11-13 12:26:43 +00:00
Zdenek Kabelac
c3e2990359 cleanu: drop duplicate const 2014-11-13 13:15:58 +01:00
Zdenek Kabelac
8cb79dad0b pool: fix removal of pool metadata spare
Since we support device stack of pools over pool
(thin-pool with cache data volume) the existing code
is no longer able to detect orphan _pmspare.

So instead do a _pmspare check after volume removal,
and remove spare afterwards.
2014-11-13 13:09:07 +01:00
Zdenek Kabelac
fba86dd42b cache: improve pending_delete
We need to stop guessing deleted names - so rather collect
deleted  UUID into a string list - and then remove them properly
in _clean_tree. Restore origin _clean_tree behaviour them for
currently unconverted removal of snapshots.

Pending delete feature now properly tracks whole subtree of cache
(so i.e. data or metadata as raid volumes).
It properly replaces all related volumes with 'errors' in suspend
preload, then resume them as error and remove collected UUIDs
from root - since they are not longer part of any volume deps.
2014-11-13 11:54:41 +01:00
Peter Rajnoha
359dc6fa76 coverity: commit ba2302346 - report log_sys_error properly
log_sys_error uses errno, hence we need to report the first
failure before reporting another failure that uses errno as well.
2014-11-12 15:16:54 +01:00
Peter Rajnoha
c03d8473ea coverity: fix possible dereference of NULL pointer
This would be in case the pool segment was not found.

LVM2.2.02.112/lib/metadata/pool_manip.c:238:36: warning: Access to field 'segtype' results in a dereference of a null pointer (loaded from variable 'pool_seg')
2014-11-12 10:17:17 +01:00
Peter Rajnoha
ce8730b508 coverity: fix possible integer overflow
LVM2.2.02.112/lib/metadata/cache_manip.c:73: overflow_before_widen: Potentially overflowing expression "*pool_metadata_extents *vg->extent_size" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).
LVM2.2.02.112/lib/activate/dev_manager.c:217: overflow_before_widen: Potentially overflowing expression "seg_status->seg->len * extent_size" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).
LVM2.2.02.112/lib/activate/dev_manager.c:217: overflow_before_widen: Potentially overflowing expression "seg_status->seg->le * extent_size" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).
2014-11-12 10:03:27 +01:00
Peter Rajnoha
60cc666c94 coverity: fix compiler warning
LVM2.2.02.112/lib/activate/dev_manager.c:196:5: warning: 'dmtask' may be used uninitialized in this function [-Wmaybe-uninitialized]

In _info_run fn:

switch (type) {
	case INFO:
		...
	case STATUS:
		...
	case MKNODES:
		...
}

The "type" is enum and currently only those three types are supported,
but if we added a new type in the future, this would end up with a bug
(if we forgot to add the new "case" in that "switch"). So let's make
sure proper internal error is printed:

	default:
		log_error(INTERNAL_ERROR "_info_run: unhandled info type");
                return 0;
2014-11-12 09:55:12 +01:00
Zdenek Kabelac
57c618b0ed cache: fix clean_tree
Fix 8121074fda - the patch
incorrectly removed also other top-level nodes.

It needs to deactivate purely subnodes of _corig.
2014-11-12 09:40:27 +01:00
Stéphane Aulery
112302d41a man: fix (\+) syntax warning of Groff
Signed-off-by: Stéphane Aulery <saulery@free.fr>
2014-11-12 09:39:19 +01:00
Peter Rajnoha
eccc97f15a coverity: remove redundant condition
LVM2.2.02.112/daemons/clvmd/clvmd.c:1131: warning[arrayIndexOutOfBoundsCond]: Array 'row[8]' accessed at index 8, which is out of bounds. Otherwise condition 'j==8' is redundant.

This code:

int i,j = 0;
...
for (i = 0; i < len; ++i) {
	...
	if ((j == 8) || (i + 1 == len)) {
		for (;j < 8; ++j) {
			...
		}
		...
		j = 0;
	}
}

Indeed - j is 0 at the beginning, then iterating till j < 8,
then always zeroed at the end of the outer loop - so "j" never
reaching value of 8 - the j == 8 condition is redundant.
2014-11-12 09:30:02 +01:00