]> sourceware.org Git - lvm2.git/log
lvm2.git
12 years agoAdd log_error even for general device in use when we can't do the sysfs checks.
Peter Rajnoha [Mon, 26 Sep 2011 10:17:51 +0000 (10:17 +0000)]
Add log_error even for general device in use when we can't do the sysfs checks.

12 years agoUse execvp for clvmd restart
Zdenek Kabelac [Mon, 26 Sep 2011 07:51:23 +0000 (07:51 +0000)]
Use execvp for clvmd restart

Since execve passed only NULL as environ, we had lost all environment vars on
restart - thus actually running  'different' clvmd then the one at start.

Preserving environ allows to restart clvmd with the same settings
(i.e. LD_LIBRARY_PATH)

Add test for second restart.

12 years agoRemove test for NULL
Zdenek Kabelac [Sun, 25 Sep 2011 19:45:40 +0000 (19:45 +0000)]
Remove test for NULL

Since it's internal function and we always check for NULL value
before call - this is safe.

Just for case add nonnull attribute so analyzer might better
catch error.

12 years agoAdd missing log_error messages
Zdenek Kabelac [Sun, 25 Sep 2011 19:43:43 +0000 (19:43 +0000)]
Add missing log_error messages

12 years agoAdd backtrace when allocation fails for _type
Zdenek Kabelac [Sun, 25 Sep 2011 19:42:45 +0000 (19:42 +0000)]
Add backtrace when allocation fails for _type

12 years agoReplace test for NULL of root->child with test for NULL l
Zdenek Kabelac [Sun, 25 Sep 2011 19:41:27 +0000 (19:41 +0000)]
Replace test for NULL of root->child with test for NULL l

It's 100% equivalent test - since it always happen for the first iteration.
But the check for 'l' is understandable with analyzers - since analyzer
is not smart enough to deduce connection between  root->child == NULL.

12 years agoSimplier attribute format
Zdenek Kabelac [Sun, 25 Sep 2011 19:40:29 +0000 (19:40 +0000)]
Simplier attribute format

No need to repeat whole declaration for static function.

12 years agoChheck for failing filename strdup
Zdenek Kabelac [Sun, 25 Sep 2011 19:39:38 +0000 (19:39 +0000)]
Chheck for failing filename strdup

12 years agoUse NULL for pointers
Zdenek Kabelac [Sun, 25 Sep 2011 19:38:59 +0000 (19:38 +0000)]
Use  NULL for pointers

12 years agoRestart CLVMD with same cluster manager
Zdenek Kabelac [Sun, 25 Sep 2011 19:37:00 +0000 (19:37 +0000)]
Restart CLVMD with same cluster manager

Add named cluster_ops to easily learn the name of the active cluster manager,
so we are able to restart singlenode manager in testing.

Add simple test for clvmd -S  (restart) and -R (refresh)
(though it needs some extensions).

12 years agoFix log_error() usage
Zdenek Kabelac [Sat, 24 Sep 2011 21:19:30 +0000 (21:19 +0000)]
Fix log_error() usage

Cosmetic - skip <bactrace> when error has been just printed in raid segtype.
Add missing log_error if allocation would fail for unknown segtype.

12 years agoAllow overwrite for VERIFY_UDEV
Zdenek Kabelac [Sat, 24 Sep 2011 21:15:13 +0000 (21:15 +0000)]
Allow overwrite for VERIFY_UDEV

When running tests it might be useful to have an override option when
testing on real /dev  and some broken system (i.e. Debian and its rules).

So one can use:

LVM_TEST_DEVDIR=/dev LVM_VERIFY_UDEV=1 make check

12 years agoAvoid sending garbage to terminal in verbose mode.
Zdenek Kabelac [Sat, 24 Sep 2011 21:12:35 +0000 (21:12 +0000)]
Avoid sending garbage to terminal in verbose mode.

When read in drain returned <0 value, terminal content has been trashed.
Remove unneeded  memset() and use whole buffer.
Free  readbuf before exit (valgrind).

12 years agoImprovements
Zdenek Kabelac [Sat, 24 Sep 2011 21:10:19 +0000 (21:10 +0000)]
Improvements

Simplify RUN_BASE

Put .tests-stamp deps only for check target and fix its cleanup.
Fix abs_top_srcdir.
vgimportclone needs  srcdir.
Clean  api subdir.

12 years agoFix install_ocf
Zdenek Kabelac [Sat, 24 Sep 2011 21:05:03 +0000 (21:05 +0000)]
Fix install_ocf

When builddir is different from srcdir install_ocf: has not been able to find
files for installation.

12 years agoDrop cleanup of .exported_symbols_generated in DISTCLEAN_TARGETS
Zdenek Kabelac [Sat, 24 Sep 2011 21:00:52 +0000 (21:00 +0000)]
Drop cleanup of .exported_symbols_generated in DISTCLEAN_TARGETS

Makefile cosmetics - since .exported_symbols_generated in cleardir:
target via make.tmpl, there is no need to set them in DISTCLEAN_TARGETS.

12 years agoUse Makefile for daemmons/common library.
Zdenek Kabelac [Sat, 24 Sep 2011 20:57:49 +0000 (20:57 +0000)]
Use Makefile for daemmons/common library.

Next iteration for better fit of lvmetad compilation.

Move build of libdaemon.a into common subdir Makefile.
libdaemon.a is device-mapper target.

Build and install lvmetad as lvm2 target.

12 years agoDetect unusable nodes on fs
Zdenek Kabelac [Sat, 24 Sep 2011 20:54:35 +0000 (20:54 +0000)]
Detect unusable nodes on fs

Test whether nodes could be used on given filesystem where TMP
dir is being used and skip teardown quicker in fail case.
(makes the problem quickly obvious if you try to such fs).

Skip teardown_dev if we have not created any devs yet.

and do not mkdir /dev/mapper dir  when LVM_TEST_DEVDIR is set.

Drop this test from t-000-basic.sh.

12 years agoCLVMD support for LVM_CLVMD_BINARY and LVM_BINARY
Zdenek Kabelac [Sat, 24 Sep 2011 20:50:35 +0000 (20:50 +0000)]
CLVMD support for LVM_CLVMD_BINARY and LVM_BINARY

Read 2 environmental vars to learn about overide position for
CLVMD and LVM binaries.

We support LVM_BINARY in other script - and this way we could easily
test restart in our test-suite.

12 years agoCLVMD bugfix support for args -S -E
Zdenek Kabelac [Sat, 24 Sep 2011 20:48:34 +0000 (20:48 +0000)]
CLVMD bugfix support for args -S -E

Bugfix:
Add (most probably unfinished) support for -E arg with list of exclusive
locks.  (During clvmd restart all exclusive locks would have been lost and
in fact, if there would have been an exclusive lock, usage text would be
printed and clvmd exits.)

Instead of parsing list options multiple times every time some lock UUID is
checked - put them straight into the hash table - make the code easier to
understand as well.

Remove  was_ex_lock() function (replaced with dm_hash_lookup()).

Swap return value for get_initial_state() (1 means success).

Update man pages and usage info for -E option.

12 years agoreadlink does not append a null byte to the output string!
Peter Rajnoha [Sat, 24 Sep 2011 11:47:53 +0000 (11:47 +0000)]
readlink does not append a null byte to the output string!

12 years agoupdate man page for new RAID lv_attr characters.
Jonathan Earl Brassow [Fri, 23 Sep 2011 19:21:53 +0000 (19:21 +0000)]
update man page for new RAID lv_attr characters.

12 years agoexplain why we may now retry
Alasdair Kergon [Fri, 23 Sep 2011 17:16:28 +0000 (17:16 +0000)]
explain why we may now retry

12 years agomissing Makefile dep
Alasdair Kergon [Fri, 23 Sep 2011 17:05:44 +0000 (17:05 +0000)]
missing Makefile dep

12 years agoUpdate the RAID design doc to reflect some of the new options introduce (e.g.
Jonathan Earl Brassow [Fri, 23 Sep 2011 17:04:41 +0000 (17:04 +0000)]
Update the RAID design doc to reflect some of the new options introduce (e.g.
--merge and --trackchanges) and document the coding steps of up/down-conversion,
splitting RAID1 images, and merging RAID1 images.

12 years agoAdd 'Volume Type' lv_attr characters for RAID and RAID_IMAGE.
Jonathan Earl Brassow [Fri, 23 Sep 2011 15:17:54 +0000 (15:17 +0000)]
Add 'Volume Type' lv_attr characters for RAID and RAID_IMAGE.

RAID_META is already handled.

12 years agoUpdate dmsetup man page
Zdenek Kabelac [Fri, 23 Sep 2011 09:51:37 +0000 (09:51 +0000)]
Update dmsetup man page

While dmsetup command properly shows all dmsetup resume supported options,
man page missed to document it.

12 years agoBuild all man pages
Zdenek Kabelac [Fri, 23 Sep 2011 09:48:21 +0000 (09:48 +0000)]
Build all man pages

When running plain 'make' in man dir - do also those for device-mapper target.

12 years agoInitialize 'retryable' variable.
Peter Rajnoha [Thu, 22 Sep 2011 17:59:58 +0000 (17:59 +0000)]
Initialize 'retryable' variable.

12 years agoAdd activation/retry_deactivation to lvm.conf to retry deactivation of an LV.
Peter Rajnoha [Thu, 22 Sep 2011 17:39:56 +0000 (17:39 +0000)]
Add activation/retry_deactivation to lvm.conf to retry deactivation of an LV.

12 years agoAdd dm_tree_retry_remove to use retry logic for device removal in a dm_tree.
Peter Rajnoha [Thu, 22 Sep 2011 17:36:50 +0000 (17:36 +0000)]
Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree.

12 years agoReplace open_count check with holders/mounted_fs check on lvremove path.
Peter Rajnoha [Thu, 22 Sep 2011 17:33:50 +0000 (17:33 +0000)]
Replace open_count check with holders/mounted_fs check on lvremove path.

Before, we used to display "Can't remove open logical volume" which was
generic. There 3 possibilities of how a device could be opened:
  - used by another device
  - having a filesystem on that device which is mounted
  - opened directly by an application

With the help of sysfs info, we can distinguish the first two situations.
The third one will be subject to "remove retry" logic - if it's opened
quickly (e.g. a parallel scan from within a udev rule run), this will
finish quickly and we can remove it once it has finished. If it's a
legitimate application that keeps the device opened, we'll do our best
to remove the device, but we will fail finally after a few retries.

12 years agoAdd dm_device_has_holders fn to to check use of the device by another device.
Peter Rajnoha [Thu, 22 Sep 2011 17:23:35 +0000 (17:23 +0000)]
Add dm_device_has_holders fn to to check use of the device by another device.
Add dm_device_has_mounted_fs fn to check mounted filesystem on a device.

This requires sysfs directory to be correctly set via dm_set_sysfs_dir
(/sys by default). If sysfs dir is not used or it's set incorrectly,
dm_device_has_{holders,mounted_fs} will return 0!

12 years agoAdd dm_set_sysfs_dir to libdevmapper to set sysfs location.
Peter Rajnoha [Thu, 22 Sep 2011 17:17:07 +0000 (17:17 +0000)]
Add dm_set_sysfs_dir to libdevmapper to set sysfs location.
Add dm_sysfs_dir to libdevmapper to retrieve sysfs location thas is set.

12 years agoAdd --retry option for dmsetup remove to retry removal if not successful.
Peter Rajnoha [Thu, 22 Sep 2011 17:12:28 +0000 (17:12 +0000)]
Add --retry option for dmsetup remove to retry removal if not successful.

12 years agoAdd dm_task_retry_remove fn to use retry logic for device removal.
Peter Rajnoha [Thu, 22 Sep 2011 17:09:48 +0000 (17:09 +0000)]
Add dm_task_retry_remove fn to use retry logic for device removal.

This call ensures that the dm device removal is retried several
times before failing.

12 years agoDisallow the creation of mirrors (mirror or raid1 segtype) with only one leg.
Jonathan Earl Brassow [Thu, 22 Sep 2011 15:36:21 +0000 (15:36 +0000)]
Disallow the creation of mirrors (mirror or raid1 segtype) with only one leg.

If you specify the segment type (e.g. --type mirror) and the mirrors argument
as zero, it would result in a mirrored LV with only one image.  While the device
may be valid in theory, it should not be allowed in practice.  It also makes it
difficult on the conversion tools, since they react badly to single-image
mirrors.

12 years agoWhen up-converting a RAID1 array, we need to allocate new larger arrays for
Jonathan Earl Brassow [Thu, 22 Sep 2011 15:33:21 +0000 (15:33 +0000)]
When up-converting a RAID1 array, we need to allocate new larger arrays for
seg->areas and seg->meta_areas.  We also need to copy the memory from the
old arrays to the newly allocated arrays.  The amount of memory to copy was
determined by seg->area_count.  However, seg->area_count was being set to the
higher value after copying the 'seg->areas' information, but before copying
the 'seg->meta_areas' information.  This means we were copying more memory
than necessary for 'seg->meta_areas' - something that could lead to a segfault.

12 years agoClvmd restart cleanup
Zdenek Kabelac [Thu, 22 Sep 2011 09:47:34 +0000 (09:47 +0000)]
Clvmd restart cleanup

Patch fixes Clang warnings about possible access via lv_name NULL pointer.

Replaces allocation of memory (strdup) with just pointer assignment
(since execve is being called anyway).

Checks for  !*lv_name only when lv_name is defined.
(and as I'm not quite sure what state this really is - putting a FIXME
around - as this rather looks suspicios ??).

Add debug print of passed clvmd args.

12 years agoAdd all exclusive locks to clvmd restart option args
Zdenek Kabelac [Thu, 22 Sep 2011 09:45:24 +0000 (09:45 +0000)]
Add all exclusive locks to clvmd restart option args

Fix bug when only every even lock has been passed.

Warning: currently -E causes clvmd to exit with usage text being printed.

12 years agoFIXMEs to note problems with some error paths. (Perhaps safer to disable
Alasdair Kergon [Wed, 21 Sep 2011 16:36:39 +0000 (16:36 +0000)]
FIXMEs to note problems with some error paths.  (Perhaps safer to disable
them until they can be fixed completely?)

12 years agoAlways sent the whole command header in restart/reload clvmd commands.
Milan Broz [Wed, 21 Sep 2011 13:40:46 +0000 (13:40 +0000)]
Always sent the whole command header in restart/reload clvmd commands.
(Newly added check catch this as invalid packet.)

(N.B. that code is so fragile that it need full rewrite soon:-)

12 years agoCheck for failing 'stat' and skip this loop iteration
Zdenek Kabelac [Wed, 21 Sep 2011 10:42:53 +0000 (10:42 +0000)]
Check for failing 'stat' and skip this loop iteration
(since data in statbuf are invalid).

Check whether sysconf managed to find _SC_PAGESIZE.

Report at least debug warning about failing unlink
(logging scheme here seems to be a different then in lvm).

Duplicate terminal FDs and use similar code as is made in clvmd
and cleanup warns about missing open/close tests.
FIXME: Looks like we already have 3 instancies of the same code in lvm repo.

12 years agoAdd missing log_error() to lvresize command when fsadm tool fails
Zdenek Kabelac [Wed, 21 Sep 2011 10:39:47 +0000 (10:39 +0000)]
Add missing log_error() to lvresize command when fsadm tool fails

Also add test case

12 years agoUnmount works with -y
Zdenek Kabelac [Mon, 19 Sep 2011 19:37:26 +0000 (19:37 +0000)]
Unmount works with -y

12 years agoAdd support for DM_DEV_DIR
Zdenek Kabelac [Mon, 19 Sep 2011 19:36:52 +0000 (19:36 +0000)]
Add support for DM_DEV_DIR

Follow other commands support this directory setting.
Useful for test suite.

12 years agoAnother vgremove for speedup
Zdenek Kabelac [Mon, 19 Sep 2011 18:40:51 +0000 (18:40 +0000)]
Another vgremove for speedup

It seems like test-suite is significantly slowed down on removal phase.

Maybe it should be part of generic teardown - though the reason of slowdown
should be also discovered -  probably related to retry loop ?

12 years agoRevert patch
Zdenek Kabelac [Mon, 19 Sep 2011 18:38:43 +0000 (18:38 +0000)]
Revert patch

Caller of exec must report log_error when rstatus is passed.

12 years agoEnsure fsadm.sh is executable
Zdenek Kabelac [Mon, 19 Sep 2011 15:54:15 +0000 (15:54 +0000)]
Ensure  fsadm.sh is executable

When the srcdir == builddir we get the link on non-exectable file.
So make always sure fsadm.sh is executable script file.

Add cleanup target for lib/fsadm.

12 years agoUse log_error instead of log_verbose when executed command fails
Zdenek Kabelac [Mon, 19 Sep 2011 14:54:23 +0000 (14:54 +0000)]
Use log_error instead of log_verbose when executed command fails

12 years agoAdd support for non /dev devices
Zdenek Kabelac [Mon, 19 Sep 2011 14:52:33 +0000 (14:52 +0000)]
Add support for non /dev devices

Since test suite is not using /dev - add support for such dirs into fsadm.

12 years agofix compiler warning.
Jonathan Earl Brassow [Mon, 19 Sep 2011 14:28:23 +0000 (14:28 +0000)]
fix compiler warning.

Compiler says variable may be used uninitialized.  It can't be, but we
initialize the variable to NULL anyway.  Also, remove the double initialization
of another variable.

12 years agoEnable t-fsadm test
Zdenek Kabelac [Mon, 19 Sep 2011 13:52:22 +0000 (13:52 +0000)]
Enable  t-fsadm test

Now all commands are executed from preffered directory.

12 years agoSupport different PATH setting
Zdenek Kabelac [Mon, 19 Sep 2011 13:51:09 +0000 (13:51 +0000)]
Support different PATH setting

When fsadm is test - it needs to execute lvm and fsadm from non-standard path
setting.   So adding a support in fsadm script when user set LVM_BINARY, then
the lvm command invoced from fsadm will have the same PATH setting as before
entering  fsadm command.

Needed for testing.

12 years agoSurround all executed commands with quotes
Zdenek Kabelac [Mon, 19 Sep 2011 13:47:37 +0000 (13:47 +0000)]
Surround all executed commands with quotes

In case someone would use filename paths with spaces when changing
this script surround commands with '"'.

With default settings there is no change in behavior.

12 years agoFix missing '$' in test
Zdenek Kabelac [Mon, 19 Sep 2011 13:43:50 +0000 (13:43 +0000)]
Fix missing '$' in test

12 years agoAdd link for fsadm script
Zdenek Kabelac [Mon, 19 Sep 2011 12:50:17 +0000 (12:50 +0000)]
Add link for fsadm script

Prepare to enabling t-fsadm.sh test

12 years agoTest speed up
Zdenek Kabelac [Mon, 19 Sep 2011 12:49:14 +0000 (12:49 +0000)]
Test speed up

Removing vg  reduces time execution of this test.
Teardown has some wait states here...

12 years agoMove debug message
Zdenek Kabelac [Mon, 19 Sep 2011 12:48:02 +0000 (12:48 +0000)]
Move debug message

so it does not look like we are executing command in the middle of
critical_section in log trace.

12 years agoFew more updates to lvmetad build deps
Zdenek Kabelac [Mon, 19 Sep 2011 00:29:11 +0000 (00:29 +0000)]
Few more updates to lvmetad build deps

It seem lvmetad deps must be expressed after the include.
Also adding lvmetad deps to device-mapper target in daemons dir.

12 years agoBuild fixes for lvmetad
Zdenek Kabelac [Sat, 17 Sep 2011 14:50:22 +0000 (14:50 +0000)]
Build fixes for lvmetad

Should now be giving better build order and install lvmetad.

12 years agoMore gcc warnings removed
Zdenek Kabelac [Sat, 17 Sep 2011 14:49:18 +0000 (14:49 +0000)]
More gcc warnings removed

12 years agoFix for gcc compilation warnings
Zdenek Kabelac [Sat, 17 Sep 2011 13:33:51 +0000 (13:33 +0000)]
Fix for gcc compilation warnings

and put _XOPEN_SOURCE so pthread_mutexattr is properly defined.

12 years agoFix Bug 738832 - core to disk log conversion fails with internal error
Jonathan Earl Brassow [Fri, 16 Sep 2011 18:39:03 +0000 (18:39 +0000)]
Fix Bug 738832 - core to disk log conversion fails with internal error

This bug showed up when trying to add a log to a mirror whose images are on
multiple devices.  This is an intra-release regression and no WHATS_NEW
entry will be added.  The error was introduce in the following commit:
2d8a2f35c77fdeef1dbe0ef791db8530d07826eb

The solution is to recognise in _alloc_init that if there are no mirrors
or stripes specified, then 'new_extents' should be zero.

12 years agoAfter suspend/resume following a splitmirror op, call sync_local_dev_names
Jonathan Earl Brassow [Fri, 16 Sep 2011 16:41:37 +0000 (16:41 +0000)]
After suspend/resume following a splitmirror op, call sync_local_dev_names
to settle udev before calling deactivate_lv.

This is an intra-release regression (no WHATS_NEW entry required).  It is
part of the fix for the current WHATS_NEW entry:
  Work around resume_lv causing error LV scanning during splitmirror operation.

12 years agoFix clvmd processing of invalid request on local socket. (rommer)
Milan Broz [Fri, 16 Sep 2011 14:40:06 +0000 (14:40 +0000)]
Fix clvmd processing of invalid request on local socket. (rommer)

Code now detects small packet and wrong arglen and reply with
error intead of infinite loop.

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

12 years agoDisable t-lvcreate-large.sh for now with cluster.
Milan Broz [Fri, 16 Sep 2011 14:32:47 +0000 (14:32 +0000)]
Disable t-lvcreate-large.sh for now with cluster.

12 years agoAdd inital thin testing
Zdenek Kabelac [Fri, 16 Sep 2011 12:23:59 +0000 (12:23 +0000)]
Add inital thin testing

Currently test is skipped by default (since it needs code hack to work)
Check command line options to create & remove thin pools and thin volumes.

Activation code for thin LV support is missing, thus it only works without
driver loaded.

12 years agoRemove thin volumes before thin pools
Zdenek Kabelac [Fri, 16 Sep 2011 12:12:51 +0000 (12:12 +0000)]
Remove thin volumes before thin pools

When user wants to remove thin pool - check if there are no thin volumes using it.
If so - query before removal (or -ff for no question) and remove them first.

12 years agoFix command line option decoding
Zdenek Kabelac [Fri, 16 Sep 2011 12:10:02 +0000 (12:10 +0000)]
Fix command line option decoding

LVM has huge set of options now - it's approaching 60 short-arg less options
and we get interesting case of misdetection for 'merge' option which has been
put into the middle of options with 'short_arg' - thus certainly past 65. (ASCII 'A').

To avoid confusion of short_arg with long_opt number - add  '128' to all such
non-short-arg options.

12 years agoUpdate
Zdenek Kabelac [Fri, 16 Sep 2011 12:01:48 +0000 (12:01 +0000)]
Update

12 years agoReset LV status when unlinking LV from VG
Zdenek Kabelac [Fri, 16 Sep 2011 11:59:22 +0000 (11:59 +0000)]
Reset LV status when unlinking LV from VG

When LV is unlinked, we want to catch problem in vg_validate,
that LV has changed.

i.e. catch LV has been removed and is no long thin_pool while still
being referenced by some thin volume.

12 years agoTrim spaces on EOL
Zdenek Kabelac [Fri, 16 Sep 2011 11:53:14 +0000 (11:53 +0000)]
Trim spaces on EOL

12 years agoRemove vg at the test's end
Zdenek Kabelac [Fri, 16 Sep 2011 11:52:33 +0000 (11:52 +0000)]
Remove vg at the test's end

Speedup this test by removing mirrored vg when it's not longer needed.
teardown() seems to be waiting here for too long.

12 years agoUpdate WHATS_NEW.
Petr Rockai [Fri, 16 Sep 2011 10:02:14 +0000 (10:02 +0000)]
Update WHATS_NEW.

12 years agoFix the divisibility check in the allocator for the mirror+stripe case (require
Petr Rockai [Fri, 16 Sep 2011 09:59:42 +0000 (09:59 +0000)]
Fix the divisibility check in the allocator for the mirror+stripe case (require
divisibility by stripe count alone, not by (mirror*stripe)).

12 years agoUpdate WHATS_NEW.
Petr Rockai [Thu, 15 Sep 2011 20:01:21 +0000 (20:01 +0000)]
Update WHATS_NEW.

12 years agoWhen resizing LVs, always round in the safe direction, regardless of whether we
Petr Rockai [Thu, 15 Sep 2011 18:51:11 +0000 (18:51 +0000)]
When resizing LVs, always round in the safe direction, regardless of whether we
were called as lvresize or lvreduce.

12 years agoFix possible overflow of size if %FREE or %VG is used.
Milan Broz [Thu, 15 Sep 2011 15:26:40 +0000 (15:26 +0000)]
Fix possible overflow of size if %FREE or %VG is used.

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

12 years agoFix vgchange activation of snapshot with virtual origin.
Milan Broz [Wed, 14 Sep 2011 18:20:03 +0000 (18:20 +0000)]
Fix vgchange activation of snapshot with virtual origin.

12 years agoFix memory overwrite
Zdenek Kabelac [Wed, 14 Sep 2011 16:07:07 +0000 (16:07 +0000)]
Fix memory overwrite

Transfer of build_dm_uuid() function into libdm made uuid_prefix as parameter,
thus sizeof() was replaced with strlen() and room for '\0' missed.

As it's only fix in current version - no whatsnew.

12 years agoActivate virtual snapshot origin exclusively (only on local node in cluster).
Milan Broz [Wed, 14 Sep 2011 14:20:16 +0000 (14:20 +0000)]
Activate virtual snapshot origin exclusively (only on local node in cluster).

12 years agoAdd suggest parentheses around '&&'
Zdenek Kabelac [Wed, 14 Sep 2011 10:03:15 +0000 (10:03 +0000)]
Add suggest parentheses around '&&'

Follow gcc suggestion.

12 years agoLVM_WRITE and LVM_READ are 64bit constants
Zdenek Kabelac [Wed, 14 Sep 2011 09:57:35 +0000 (09:57 +0000)]
LVM_WRITE and LVM_READ are 64bit constants

Revert John patch, which fixed only 1 place where ~LVM_WRITE was in use and
convert ommited LVM_READ/WRITE flags to 64bit constants as well.
(Since both 'status' flags for LV and VG are 64bit.)

12 years agoAdd missing underscores to local static functions
Zdenek Kabelac [Wed, 14 Sep 2011 09:54:21 +0000 (09:54 +0000)]
Add missing underscores to local static functions

12 years agoKeep the old-style function definition
Zdenek Kabelac [Wed, 14 Sep 2011 09:53:32 +0000 (09:53 +0000)]
Keep the old-style function definition

12 years agoAdditional fixes for lv_mirror_count.
Jonathan Earl Brassow [Wed, 14 Sep 2011 04:10:26 +0000 (04:10 +0000)]
Additional fixes for lv_mirror_count.

Changing lv_mirror_count to only count the AREA_LVs made the function
stop working for PVMOVE mirrors.  A conditional has been added to fix
that problem.  Additionally, when counting the images in a mirror stack,
we don't need to subtract 1 from the count we get back from the
lv_mirror_count call on the temporary mirror layer.  (This is because we
are no falsely counting the top layer of the temporary mirror.)

12 years agoFix for bug 734252 - problem up converting striped mirror after image failure
Jonathan Earl Brassow [Wed, 14 Sep 2011 02:45:36 +0000 (02:45 +0000)]
Fix for bug 734252 - problem up converting striped mirror after image failure

lv_mirror_count was not able to handle mirrors of stripes properly.  When a
failed device is removed, the MIRRORED status flag is removed from the LV
conditionally based on the results of lv_mirror_count.  However, lv_mirror_count
trusted the MIRRORED flag - thinking any such LV must be mirrored.  It would
happily assign first_seg(lv)->area_count as the number of mirrors, but when
a mirrored striped LV was reduced to a simple striped LV area_count would be
the number of /stripes/ not the number of /mirrors/.  A result higher than 1
would be returned from lv_mirror_count, the MIRRORED flag would not be cleared,
and the LV would fail to be up-converted properly in lvconvert_mirrors_aux
because of it.

12 years agoFix bug 733400 - Mirror down conversion when specifying the secondary leg is broke
Jonathan Earl Brassow [Tue, 13 Sep 2011 21:13:33 +0000 (21:13 +0000)]
Fix bug 733400 - Mirror down conversion when specifying the secondary leg is broke

The operation of deactivating the residual error target LV after removing a
mirror layer can cause a "device in-use" conflict with udev.  Giving udev a
poke before calling deactivate_lv eliminates the conflict.  The stick used
to poke udev is 'sync_local_dev_names'.

12 years agoFix for bug 737200 - Can't create mirrored-log mirror on a VG with small extents
Jonathan Earl Brassow [Tue, 13 Sep 2011 18:42:57 +0000 (18:42 +0000)]
Fix for bug 737200 - Can't create mirrored-log mirror on a VG with small extents

Kernel requires a mirror to be at least 1 region large.  So,
if our mirror log is itself a mirror, it must be at least
1 region large.  This restriction may not be necessary for
non-mirrored logs, but we apply the rule anyway.

(The other option is to make the region size of the log
mirror smaller than the mirror it is acting as a log for,
but that really complicates things.  It's much easier to
keep the region_size the same for both.)

12 years agoBetter fix for bug 737125 - unable to create mirror on 1K extent size VG
Jonathan Earl Brassow [Tue, 13 Sep 2011 18:11:38 +0000 (18:11 +0000)]
Better fix for bug 737125 - unable to create mirror on 1K extent size VG

WHATS_NEW entry:
Fix log size calculation when only a log is being added to a mirror.

The original fix pass the mirror LV to allocate_extents (rather than
passing NULL) so that _alloc_init could correctly determine the necessary
size of the mirror log.  In the previous check-in, I noted:
    In order to get a decent value computed, we need to pass in the 'lv' argument
    to allocate_extents.  This would normally imply a desire for cling/contiguous
    allocation to the given LV, but since we are not allocating any parallel
    extents and only log extents, it works fine.
However, passing in the LV did have unintended consequences on the placement of
the log.  The better solution is to pass in the number of extext that are in
the mirror LV instead of the LV itself.  This will not cause the allocator to
reserve that number of extents, because 'stripes' and 'mirrors' are specified
as 0.  Thus, 'extents' is used to calculate the size of the log, but won't
affect how much is allocated.

12 years agoChanging RAID status flags to 64-bit broke some binary flag operations.
Jonathan Earl Brassow [Tue, 13 Sep 2011 16:33:21 +0000 (16:33 +0000)]
Changing RAID status flags to 64-bit broke some binary flag operations.

LVM_WRITE is a 32-bit flag.  Now that RAID[_IMAGE|_META] are 64-bit,
and'ing a RAID LV's status against LVM_WRITE can reset the higher order
flags.

A similar thing will affect thinp flags if not careful.

12 years agoRetry DM_DEVICE_REMOVE ioctl if device is busy.
Peter Rajnoha [Tue, 13 Sep 2011 15:13:41 +0000 (15:13 +0000)]
Retry DM_DEVICE_REMOVE ioctl if device is busy.

This is a workaround for long-lasting problem with using the WATCH udev
rule. When trying to remove a DM device, this one can still be opened
while processing the event in parallel (generated based on the WATCH
udev rule).

Let's use this until we have a proper solution.

12 years agoFix for bug 737125 - unable to create mirror on 1K extent size VG
Jonathan Earl Brassow [Tue, 13 Sep 2011 14:37:48 +0000 (14:37 +0000)]
Fix for bug 737125 - unable to create mirror on 1K extent size VG

_alloc_init calculates the number of necessary log extents via
'mirror_log_extents'.  'mirror_log_extents' takes 3 arguments: region_size,
pe_size, and size of the mirror LV.  Unfortunately, _alloc_init is guessing at
the mirror size by using 'ah->new_extents / ah->area_multiple' - the number of
extents that the mirror images have.  However, this is /always/ wrong when
allocating the log separately.  Further, the log is always allocated separately
unless we are up-converting the mirror at the same time.  It was by luck alone
that a default value of '1' reflects what we want in most cases.

In order to get a decent value computed, we need to pass in the 'lv' argument
to allocate_extents.  This would normally imply a desire for cling/contiguous
allocation to the given LV, but since we are not allocating any parallel
extents and only log extents, it works fine.

12 years agoFix for bug 733114.
Jonathan Earl Brassow [Tue, 13 Sep 2011 13:59:19 +0000 (13:59 +0000)]
Fix for bug 733114.

When an image is split from a 2-way mirror, the original mirror is converted to
a linear device.  To do this, the top "layer" must be removed.  The segments
are transferred from the sub-lv to the top-level LV and the link is severed.
The former sub-lv - having its segments transferred - now contains a temporary
error target.

When the original LV is resumed, the old sub-lv that now contains an error
segment is activated and scanned.  This is what causes the I/O error messages.
There are three ways to fix this problem:

1) Do not set the sub-lv which contains the error target as "visible" before
suspending the original LV.  This way, when the original is resumed, the sub-lv
device node is not created and it is not scanned - avoiding the error messages.
 The problem with this approach is that if the machine crashes after the
resume, it leaves the *hidden* LV in place and the user has a more difficult
time noticing that it needs to be cleaned up.  Thus, this type of processing is
frowned upon.

2) Do like _remove_mirror_images does and suspend the original, then suspend
the sub-lv (the error target), then resume the sub-lv, and finally resume the
original LV.  This seems like extra pointless operations to me, but it does not
produce the error message (although, I'm not sure why) and it allows us to
leave the visible flag in place.

3) Flag the sub-lv (error target) with a "do not scan" flag.  This seems like
the cleanest approach, but I have been unable to find the method for doing
this.  LVs get tagged in such a way by _get_udev_flags, but in this case the
resume of the original LV also resumes the error target LV without running it
through _get_udev_flags (likely because they are no longer linked).  Could
there be something wrong in resume_lv?

Option #2 was chosen to fix this bug, but it seems like more of a workaround
for now.

12 years agoreorder some status flag printing in gdbinit file.
Jonathan Earl Brassow [Tue, 13 Sep 2011 13:57:02 +0000 (13:57 +0000)]
reorder some status flag printing in gdbinit file.

12 years agoUpdated testing script
Zdenek Kabelac [Fri, 9 Sep 2011 13:19:19 +0000 (13:19 +0000)]
Updated testing script

Since attrs were extended by 2 new fields update check functions.

12 years agoAppend z to lv_attr if new blocks will be zeroed.
Alasdair Kergon [Fri, 9 Sep 2011 01:15:18 +0000 (01:15 +0000)]
Append z to lv_attr if new blocks will be zeroed.

12 years agoAdd a new 'thin_pool' output field to 'lvs.
Alasdair Kergon [Fri, 9 Sep 2011 00:54:49 +0000 (00:54 +0000)]
Add a new 'thin_pool' output field to 'lvs.

A gentle reminder that anyone relying on the output of reporting commands
like lvs in scripts must use -o to guarantee they get the fields they expect.

The default sequence of fields can change from release to release.
Equally, the 'attr' fields can have new values introduced and/or characters
appended to them.

12 years agoAdjust gdbinit script to new RAID status flag values.
Jonathan Earl Brassow [Thu, 8 Sep 2011 22:19:45 +0000 (22:19 +0000)]
Adjust gdbinit script to new RAID status flag values.

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