1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

6850 Commits

Author SHA1 Message Date
Peter Rajnoha
3be9089cd3 Add 'vgscan --cache' functionality for consistency with 'pvscan --cache'.
Calling vgscan alone should reuse information from the lvmetad (if running).
The --cache option should initiate direct device scan and update lvmetad
appropriately (if running).

This is mainly for vgscan to behave consistently compared to pvscan.
2012-03-27 11:04:46 +00:00
Alasdair Kergon
4007e0d139 add make install_verity 2012-03-26 23:23:31 +00:00
Alasdair Kergon
6bbbcf42f8 Rename verity dir 2012-03-26 23:09:37 +00:00
Milan Broz
ddb31b62e5 Keep exclusive activation in pvmove if LV is already active.
Pvmove should never try to downgrade exclusive lock
for LVs.

This allows pvmove to work again for exclusive activated LVs.
2012-03-26 20:33:40 +00:00
Milan Broz
dcd90bc501 Do not allow pvmove if some affected LVs are activated
locally or on more nodes while others are activated exclusively.

Current pvmove code can either use local mirror (for exclusive
activation) or cmirror (for clustered LVs).

Because the whole intenal pvmove LV is just segmented LV containing
segments of several top-level LVs, code cannot properly handle
situation if some segment need to be activated exclusively.

Previously, it wrongly activated exclusive LV on all nodes
(locing code allowed it) but now this is no lnger possible.

If there is exclusively activated LV, pvmove is only
possible if all affected LVs are aslo activated exclusively.

(Note that in non-exclusive mode pvmove still activates LVs
on other nodes during move.)

# lvchange -aly vg_test/lv1
# lvchange -aey vg_test/lv2
# pvmove -i 1 /dev/sdc
   Error locking on node bar-01: Device or resource busy
   Error locking on node bar-03: Volume is busy on another node
...
   Failed to activate lv2
2012-03-26 20:32:58 +00:00
Milan Broz
3366541aab Use new flag PVMOVE_EXCLUSIVE in update_metatada call.
There is no real functional change in this patch except it
avoids checking cluster cmirror module twice.

(Flag used in following patch.)
2012-03-26 20:31:01 +00:00
Milan Broz
62a40438ab Remove unused and wrongly set cluster VG flag from clvmd lock query command. 2012-03-26 20:29:45 +00:00
Alasdair Kergon
836bafac6e fixes/improvements 2012-03-24 02:58:56 +00:00
Alasdair Kergon
3d962ed68f First veritysetup version using configure --with-veritysetup. 2012-03-24 01:59:59 +00:00
Milan Broz
7076d1439b Fix pvmove if LV is activated exclusively but cmirror is not running.
In this case we should allow to use local mirror, check for cmirror
should apply only for lvconvert/lvcreate.

Introduced in 2.02.86 by removing !(lv->status & ACTIVATE_EXCL).

(Partially workaround, it is minimalistic patch for now.)
2012-03-23 16:28:40 +00:00
Zdenek Kabelac
2dba563206 Add fixmes
There is missing some proper reaction when update fails ?
2012-03-23 10:34:51 +00:00
Zdenek Kabelac
0fc9a3dce3 Always free hash table
also in error path
2012-03-23 10:33:26 +00:00
Zdenek Kabelac
2caa558e7c Update and fix monitoring of thin pool devices
Code adds better support for monitoring of thin pool devices.
update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring.
vgchange & lvchange are checking real thin pool device for existance
as we are using   _tpool  real device and visible LV pool device might not
be even active (_tpool is activated implicitely for any thin volume).
monitor_dev_for_events is another _lv_postorder like code it might be worth
to think about reusing it here - for now update the code to properly
monitory thin volume deps.
For unmonitoring add extra code to check the usage of thin pool - in case it's in use
unmonitoring of thin volume is skipped.
2012-03-23 09:58:04 +00:00
Zdenek Kabelac
5da4d94adc Return mem fail if hash insert fails 2012-03-23 09:48:17 +00:00
Zdenek Kabelac
4ea8533f30 Make sure namelen fits into buffer allocated on stack 2012-03-23 09:43:44 +00:00
Zdenek Kabelac
fbd89d3a1a Fix typo in config option check 2012-03-23 09:42:36 +00:00
Zdenek Kabelac
86bdfb3722 Improve teardown_devs
Try to avoid start of dmeventd during vgremove if the code has any bug
inside.
2012-03-23 09:41:20 +00:00
Zdenek Kabelac
467f454c09 Update debug message
(compiled only with special debug define)
2012-03-23 09:39:59 +00:00
Zdenek Kabelac
1d6a2c7326 Update lcov target 2012-03-23 09:39:03 +00:00
Zdenek Kabelac
0b17a75f13 Fix regression in thin monitoring
Patch https://www.redhat.com/archives/lvm-devel/2012-February/msg00118.html
removed initilization of thin volume monitoring, leaving it only for
thin pool - but missed the code move part for monitoring of thin pools.
Effectively making thin pools not monitorable.
2012-03-20 17:42:19 +00:00
Zdenek Kabelac
516b79299a Fix check for passed in path for dmeventd startup
Check passed in executable path for dmeventd instead of predefined
compiled in path which is not the thing to be executed.
2012-03-20 17:38:47 +00:00
Zdenek Kabelac
8100989dbb Sleep longer in the test so it really dies properly
and check for right exit code from pgrep
2012-03-20 13:35:46 +00:00
Zdenek Kabelac
ef199faeda Update testing scripts
Make the teardown really usable - it will try down to remove all the left
devices even from previous test runs
(the only missing piece is probably proper mdadm teardown)
Add few more local vars
Try to setup PATH and LD_LIBRARY_PATH just once.
Try shorter sleeps.
2012-03-20 10:51:57 +00:00
Zdenek Kabelac
758f674240 Update test for dmevent restart
Actually restart was failing for different reason - so pass in proper
location of dmeventd for restart from lvm command and avoid using
the one from /sbin location.

Update pv create test with "" around path.
2012-03-20 10:48:59 +00:00
Zdenek Kabelac
37672e676d Support improperly formated device numbers
There are kernel drivers (smblk) which set '-1' as their device major number.
This number is listed in /proc/devices then - but the kernel itself is using
just 12 bits - thus device is accessible via 4095 - there is posted patch
for 3.4 to fix this behavior (0 for auto allocation was mean to be used).

However to still allow using such devices with older kernels add some code
to use same behavior - so cut 12 bits from the major number from /proc/devices.

For now use log_warn() - maybe the severity of the message could be lowered
to just verbose level.
2012-03-20 10:47:02 +00:00
Peter Rajnoha
761407217a Do exit if LISTEN_PID environment variable not correct during systemd handover. 2012-03-16 21:30:53 +00:00
Zdenek Kabelac
fad6a65f3c Add comment about slow startup of dmeventd
Separat lvm dumpconfig on extra line, so the shell trace output
is not mixed with dump.
2012-03-16 19:13:09 +00:00
Zdenek Kabelac
171d7d5793 Skip dmeventd restart test
If dmevendt is not in /sbin, do not try to run restarting test.
FIXME: add some workaround for testing.
2012-03-16 19:11:29 +00:00
Zdenek Kabelac
e79d64b52b Regression fix kernel version check
got changed improperly with large update patch.
2012-03-16 19:09:49 +00:00
Zdenek Kabelac
358b3ce26b Longer sleep after clvmd start 2012-03-16 19:08:09 +00:00
Peter Rajnoha
d837eebdcc Use pvscan --cache instead of vgscan in lvmetad init script and systemd unit. 2012-03-16 15:12:04 +00:00
Zdenek Kabelac
6bf324c4fd Switch condition for dmeventd check 2012-03-16 13:44:51 +00:00
Zdenek Kabelac
351be15dc4 Update tests
Indent

Shell improvements - use internal function for checks

Use PVs in ""   (LV and VG cannot have spaces)

Several test very starting 'dmeventd' without annoucing
it via prepade_dmeventd.

Fix some of test actually.
2012-03-16 13:00:05 +00:00
Zdenek Kabelac
cce2475889 Update test.sh check.sh utils.sh get.sh
Indent
Better shell usage
Function simplification
More usage of 'get' functions
Don't use valgrind tracing for check and get function (faster)
Update shell debugging (PS4, better stacktrace)
Support paths with spaces
Export SCRIPTNAME for external usage
Watch for dmeventd unexpectedly started during test
2012-03-16 12:59:43 +00:00
Zdenek Kabelac
fd818eb3aa Update aux.sh lvmwrapper
Indent

Add valgrind support:
 env LVM_TEST_VALGRIND={0123} (the higher level, more commands tested)
 env LVM_TEST_CLVMD=1   runs clvmd within valgrind.
 env VALGRIND  script name executed for each lvm command (def. is valg).

Smarted teardown - should minimize occurence of left dev entries
 (using dmsetup remove -f only as last resort)
 sort removed devices by open count before actual removal

Use "" around string that may contain spaces.

Set log/verbose and activation/retry_deactivation to defined value.

Remove  debug.log after successful lvm command (easier to check output).
2012-03-16 12:59:02 +00:00
Zdenek Kabelac
7755376d7c Test suite skip md_detection
Not normally needed - lets' enable it only for test that
really needs it.
2012-03-16 12:57:28 +00:00
Zdenek Kabelac
803b1056ca Allow to use also special prefixed names for test
Currently we could not test special prefixes in our test suite.
As teardown will not find such device and basicaly busyloops here,
as at cannot remove such names.

This patch adds possibity to use:

vgcreate  V_$vg1 $dev

Note: you still need to use $PREFIX somewhere in the name.
(And of course, it's really bad idea to use $PREFIX (=LVMTEST)
 for normally used LVs)

The only purpose of this patch is to allow testing cluster with
special vg names that begins with V_ , P_....
2012-03-16 12:56:29 +00:00
Zdenek Kabelac
a9382908ae Fix string parsing
Fix propagation of -e option - pass it via internal shell variable.
Fix parsing of /proc/mounts files (don't check for substrings).
 as reported by O.Mangold with suggested patch:
 https://www.redhat.com/archives/linux-lvm/2012-February/msg00030.html
Properly pass arguments with spaces ("$@")
Add validation for YES and EXTOFF variable content.
2012-03-16 12:53:05 +00:00
Petr Rockai
5ee11ece1a Relax the active-minor test a bit. 2012-03-16 11:36:51 +00:00
Petr Rockai
f1d117f9f9 It's new. 2012-03-16 10:46:25 +00:00
Petr Rockai
7720ed7037 Fix a regression in handling --major/--minor arguments to lvcreate & lvchange,
by allowing arg_int_value to be used with groupable options.
2012-03-16 10:43:52 +00:00
Jonathan Earl Brassow
dc7b1640ed Fix name conflicts that prevent down-converting RAID1 when specifying a device
When down-converting a RAID1 device, it is the last device that is extracted
and removed when the user does not specify a particular device.  However,
when a device is specified (and it is not the last), the device is removed and
the remaining sub-LVs are "shifted down" to fill the hole.  This cause problems
when resuming the LV because if the shifted devices were resumed (and thus
renamed) before the sub-LV being extracted, there would be a name conflict.
The solution is to resume the extracted sub-LVs first so that they can be
properly renamed preventing a possible conflict.

This addresses bug 801967.
2012-03-15 20:00:54 +00:00
Peter Rajnoha
08e846e3d9 Remove dmeventd fifos on exit if they are not managed by systemd. 2012-03-15 08:45:55 +00:00
Zdenek Kabelac
909887be5e Update configure change
Always define THIN_CHECK_CMD define - since for now we compile thin code
in more places.
2012-03-14 19:25:04 +00:00
Zdenek Kabelac
ea91741212 Just move declaration 2012-03-14 17:15:22 +00:00
Zdenek Kabelac
813a1868c6 Use proper "" for absolute paths 2012-03-14 17:14:33 +00:00
Zdenek Kabelac
2c49a5a7cc Cleanup for conf file 2012-03-14 17:13:45 +00:00
Zdenek Kabelac
e866931169 Improve thin_check option passing
Update a way we handle option passing - so we now support path and options
with space inside.
Fix dm name usage for thin pools with '-' in name.
Use new lvm.conf option thin_check_options to pass in options as string array.
2012-03-14 17:12:05 +00:00
Zdenek Kabelac
f61cacad16 Add --with-thin-check configure option
If specified - use given path without test (Path could be empty)
If autodetection is in use - check for command in available PATH.
2012-03-14 17:09:00 +00:00
Peter Rajnoha
93945bb616 Use SD_ACTIVATION env. var. in systemd units to better detect systemd in use.
LISTEN_PID and LISTEN_FDS environment variables are defined only during systemd
"start" action. But we still need to know whether we're activated during
"reload" action as well - we use the reload action to call "dmeventd -R"/"lvmetad -R"
for statefull daemon restart. We can't use normal "restart" as that is simply
composed of "stop" and "start" and we would lose any state the daemon has.
2012-03-14 15:51:51 +00:00