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

4356 Commits

Author SHA1 Message Date
Zdenek Kabelac
6ea4f7dfc0 Add error diagnostic for setenv failure. 2010-04-13 20:54:57 +00:00
Zdenek Kabelac
b409df00a9 Use C locales and use_mlockall for clvmd.
Use same steps for clvmd as for dmeventd - using C locales to avoid reading
large mmaps and use mlockall() for threaded version.
2010-04-13 19:54:16 +00:00
Dave Wysochanski
fc63498c49 Update WHATS_NEW 2010-04-13 18:18:54 +00:00
Dave Wysochanski
af46c894d0 Add pv->vg to solidify link between a pv and a vg.
lvm2app needs a link back to the vg in order to use the vg handle for
memory allocations as well as other things.  This patch adds the field
to struct physical_volume, and sets pv->vg when reading a vg from disk or
extending a vg by using the helper function previously added,
add_pvl_to_vgs().  Moves and renames are handled with separate code
inside move_pv() and vgmerge().  Add pv->vg check to vg_validate().

A NULL value in pv->vg signifies membership in the orphan VG.
Note though in the case of pv_read() on a device with metadatacopies == 0,
more devices may need to be read for an authoritative answer.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-13 17:26:36 +00:00
Dave Wysochanski
11647ad01c Use del_pvl_from_vgs() in vgreduce paths.
Somehow these got missed in earlier patches.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-13 17:26:20 +00:00
Dave Wysochanski
0adfbfd5ea Call add_pvl_to_vgs() and del_pvl_from_vgs() from more places.
Now that we have library functions to add/delete a pv from the vg->pvs
list, call them from everywhere.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-13 17:26:03 +00:00
Dave Wysochanski
8cfd64de78 Add del_pvl_from_vgs() and move prototypes into metadata-exported.h
Add a delete function to manage the vg->pvs list.

NOTE: It may be possible to do further cleanup to these add/del functions
by passing a 'pv' as input instead of 'pv_list'.  The pv_list is used for
functions which do allocations (lvcreate) while other places in the code
just manage a list of 'pv' (e.g. import functions, vgextend, etc).

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-13 17:25:44 +00:00
Dave Wysochanski
a6a4941504 Move increment of vg->pv_count from import_pool_vg() to import_pool_pvs().
Move the increment of vg->pv_count next to the place where we add to
vg->pvs.  It looks safe to do this since the only caller of import_pool_vg()
calls import_pool_pvs() immediately afterward, and there is no way
import_pool_vg() can fail (always returns 1).  However, if there's a
memory allocation failure inside import_pool_pvs(), we will end up with
a different count in vg->pv_count that with the original code.  In any
case, vg->pv_count should be as close to dm_list_size(&vg->pvs) as
possible, as is the case everywhere else in the code.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-13 17:25:26 +00:00
Dave Wysochanski
f6644ff8fe Remove unnecessary parameter from import_pool_pvs().
The dm_list * parameter is unnecessary since we are passing in 'vg'
and the only caller of import_pool_pvs() passes '&vg->pvs' in the
dm_list * parameter.  Just use vg->pvs directly in the function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-13 17:25:13 +00:00
Jonathan Earl Brassow
94b713df08 Arguments to the --mirrorlog option are described in the synopsis as
{core|disk|mirrored}.  However, under the options section they are
described as {core|disk} - even though the 'mirrored' argument is
described.

s/'{core|disk}'/'{core|disk|mirrored}'/
2010-04-13 16:13:08 +00:00
Milan Broz
e4594d9c23 Mask LCK_HOLD flag in cluster VG locks for compatibility reasons. 2010-04-13 14:36:24 +00:00
Petr Rockai
a2263de0a3 Add check_cluster and check_local targets in addition to just "check". 2010-04-13 13:28:52 +00:00
Petr Rockai
2f938809c4 Process all core dumps that exist upon a test failure (this would hopefully
include eg. clvmd cores, apart from the usual lvm ones).
2010-04-13 08:01:53 +00:00
Petr Rockai
d78af3f646 Fix a reversed exit status from test harness. 2010-04-13 07:34:19 +00:00
Petr Rockai
0128c3703a Optionally disable the verbose repeat of a failed test (export
LVM_TEST_NOVERBOSE=1).
2010-04-13 07:33:34 +00:00
Petr Rockai
cad4999faa Disable the rather-dangerous prepare_scsi_debug_dev in the testsuite. 2010-04-13 07:02:14 +00:00
Petr Rockai
468667effa Make it easy to run just a subset of tests by saying make check T="regex". 2010-04-13 06:45:53 +00:00
Petr Rockai
99224dfeac Fix t-lvcreate-usage, as lvcreate ... -i1 no longer prints "Redundant stripes
argument: default is 1".
2010-04-13 06:25:08 +00:00
Petr Rockai
cd7d2bc5e4 For the testsuite, set a default polling interval to 0 in lvm.conf. Cuts down
testing time considerably.
2010-04-13 06:24:20 +00:00
Alasdair Kergon
68176be18e Add --stripes to lvconvert too. 2010-04-13 01:54:32 +00:00
Alasdair Kergon
59131572d5 Add activation/polling_interval to lvm.conf as --interval default. 2010-04-13 01:43:56 +00:00
Petr Rockai
31f8085a1b More testsuite helpers for check.sh. 2010-04-12 19:33:58 +00:00
Petr Rockai
88e3d4e262 Absorb t-mirror-lvconvert-usage into t-lvconvert-mirror. 2010-04-12 19:32:58 +00:00
Petr Rockai
400502f7e6 Explode t-mirror-basic into a number of smaller tests. 2010-04-12 19:16:24 +00:00
Petr Rockai
bedabf92f3 Add a new helper script for the testsuite, that makes checking for various
(lvm) properties easier and produces nicer output.
2010-04-12 19:02:59 +00:00
Petr Rockai
b7d23b7943 Do not pollute /tmp with testing byproducts. 2010-04-12 19:00:23 +00:00
Alasdair Kergon
0693099223 Don't ignore error if resuming any LV fails in resume_lvs.
Skip closing persistent filter cache file if open failed.
2010-04-12 11:52:53 +00:00
Zdenek Kabelac
d5fdc8e8ab Update install rules for udev.
Fix unwanted modification of $(top_builddir)/make.tmpl.

Using dependency rules to install rules for udev.
There is minor problem, with concurent usage of builddir
and srcdir could lead to missuse of 10-dm.rules which
could be found in VPATH from different builddir.
However current solution uses intermediate target so
the generated 10-dm.rules exists only for short period of time
during make install execution.
2010-04-09 21:44:28 +00:00
Zdenek Kabelac
23b059e7b7 INSTALL rules updates
Patch is inspired by Debian's extra patch.

- removes OWNER & GROUP make vars they are parts of INSTALL command.
- adds INSTALL_PROGRAM for executable, uses $(INSTALL)
- adds INSTALL_DATA for non-executable data, uses ($INSTALL)
- adds INSTALL_WDATA for writable non-executable data, uses ($INSTALL)
- adds configure option --enable-write_install - to support
  installatin of writable files used by distribution
- replaces usage of ifeq @LIB_SUFFIX@ with $(LIB_SUFFIX)
- installs .a files from static builds without executable flag
- installs .a files to $(usrlibdir) instead of $(libdir)
- installs all static binaries to $(staticdir)
- create .so links for devel package in $(usrlibdir) instead of
  $(libdir)
- makes .so and .so.LIB_VERSION files within builddir
- removes VERSIONED_SHLIB and created versioned LIB_SHARED automagicaly
- install LIB_SHARED via install_lib_shared target
- install plugins via install_lib_shared_plugin target
- prints whole 'install' command during installation instead of less
  informative "Installing  $(something) $(somewhere)"
- install multiple man pages with one INSTALL command
- use DISTCLEAN_TARGETS instead of creating multiple distclean targets
2010-04-09 21:42:48 +00:00
Zdenek Kabelac
c737d34804 Use vpath instead of VPATH.
Usage of VPATH makes troubles when used within $(builddir).
Not only source files are being found through VPATH,
but targets as well. (make --debug=v)

Thus if user builds the code in $(srcdir) and also in some $(builddir)
he gets mangled results as some generated files (i.e. .export.sym)
are 'reused' from $(srcdir) instead of $(builddir).

This patch switches to use vpath were we could explicitly name
suffixes that should be looked via vpath - we must take care,
we do not generate files with these suffixes:
.c, .in, .po, .exported_symbols
2010-04-09 21:34:25 +00:00
Alasdair Kergon
1485ce69c4 Permit mimage LVs to be striped in lvcreate and lvresize. 2010-04-09 01:00:10 +00:00
Dave Wysochanski
fddc256a02 Check for duplicate paths (pvids) on the commandline of vgcreate.
A user specifying duplicate paths on the cmdline of vgcreate will
get a message similar to the following:
vgcreate vgtest2 /dev/loop3 /dev/loop5
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop5 not /dev/loop3
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop3 not /dev/loop5
  Internal error: Duplicate PV id jk1lXs-Kzwy-OKlX-q6bh-aFFK-MQQ0-6oPgu8 detected for /dev/loop3 in vgtest2.

This is caught by vg_validate(), but it would be good to find
this condition earlier in the vgcreate code.  add_pv_to_vg()
currently checks by pvname, but does not look for duplcate pvids.
This patch adds the check for duplicate pvids and results in new
error output as follows:
vgcreate vgtest2 /dev/loop3 /dev/loop5
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop5 not /dev/loop3
  Found duplicate PV jk1lXsKzwyOKlXq6bhaFFKMQQ06oPgu8: using /dev/loop3 not /dev/loop5
  Physical volume '/dev/loop5 (jk1lXs-Kzwy-OKlX-q6bh-aFFK-MQQ0-6oPgu8)' listed more than once.
  Unable to add physical volume '/dev/loop5' to volume group 'vgtest2'.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2010-04-08 15:18:35 +00:00
Zdenek Kabelac
7cbd4a743e Add cleandir target.
Using non-recursive cleandir target for resursive distclean and clean.
Avoids duplicated clean invocation during distclean.
Indent $(RM) parameters.
2010-04-08 09:15:37 +00:00
Alasdair Kergon
9a62f0d59a And another test that should have been failing - normal allocation policy
does not put stripes on the same disk as each other!
2010-04-08 01:58:06 +00:00
Alasdair Kergon
1969deb742 another incorrect test that should have been failing before 2010-04-08 01:43:46 +00:00
Alasdair Kergon
4d0e07a799 missing ?: 2010-04-08 00:56:26 +00:00
Alasdair Kergon
b3302a0c3c suppress bogus compiler warning 2010-04-08 00:52:41 +00:00
Alasdair Kergon
aab7a3978b Fix pvmove allocation to take existing parallel stripes into account.
When moving parts of striped LVs, pvmove wouldn't care about leaving you with
two stripes on the same disk.  Now --alloc anywhere is needed for that.
(Tried and gave up on two alternative approaches before the one committed here.)
2010-04-08 00:28:57 +00:00
Alasdair Kergon
18e0f9342d Only fail if the top-level LV fails to be deactivated - allow deactivation
of its dependencies to fail.
2010-04-07 23:51:34 +00:00
Petr Rockai
09d11ca3d8 Don't forget to cd into $TESTDIR in test-utils.sh / prepare_testdir. 2010-04-07 21:38:01 +00:00
Alasdair Kergon
e6ff36ab61 Issue a message if the new type of deactivation failure happens.
If this can happen during 'normal' operations, I need to know.
2010-04-07 21:25:09 +00:00
Petr Rockai
3103d5e2d9 Fix a mis-override of $PWD in test-utils.sh. 2010-04-07 21:19:20 +00:00
Alasdair Kergon
f55021f487 Fix incorrect removal of symlinks after LV deactivation fails. 2010-04-07 20:04:41 +00:00
Petr Rockai
36bc6c3d19 Set ulimit -c to unlimited to allow coredumps to be collected and analysed in
the testsuite.
2010-04-07 16:04:22 +00:00
Petr Rockai
4c68b2cb9c Avoid spurious skips in the testsuite due to obsoleted
dmsetup_has_dm_devdir_support_.
2010-04-07 16:00:19 +00:00
Milan Broz
fb3bcb9f74 Wipe dm-ioctl parameters in memory after use. 2010-04-07 15:57:20 +00:00
Petr Rockai
ed5686d981 Refactor the test utilities, dropping the legacy test-lib.sh and curtailing
lvm-utils.sh. Clears up lots of unused code, should have little observable
impact (it does change test directory layout slightly).
2010-04-07 14:46:26 +00:00
Petr Rockai
e096611c96 In test harness, use fwrite(3) in place of write(2) to avoid mixing fd-level
and FILE-level IO on stdout.
2010-04-07 09:48:11 +00:00
Petr Rockai
c48d915f11 Keep the testsuite stats correct in spite of failed-test repetition. 2010-04-07 09:41:33 +00:00
Petr Rockai
065988dcd7 Move a fragile testcase toward the end of t-mirror-lvconvert.sh. 2010-04-06 23:04:45 +00:00