]> sourceware.org Git - lvm2.git/log
lvm2.git
14 years agoAdd dm_create_lockfile to libdm to handle pidfiles for all daemons.
Fabio M. Di Nitto [Tue, 13 Jul 2010 13:51:01 +0000 (13:51 +0000)]
Add dm_create_lockfile to libdm to handle pidfiles for all daemons.
Switch dmeventd to use dm_create_lockfile and drop duplicate code.
Allow clvmd pidfile to be configurable.
Switch cmirrord and clvmd to use dm_create_lockfile.

14 years agoMore comment updates in lvm2app.h.
Dave Wysochanski [Mon, 12 Jul 2010 18:29:31 +0000 (18:29 +0000)]
More comment updates in lvm2app.h.

14 years agoUpdate comments about memory handling in lvm2app.h.
Dave Wysochanski [Mon, 12 Jul 2010 18:12:23 +0000 (18:12 +0000)]
Update comments about memory handling in lvm2app.h.

14 years agoAddendum for previous patch - show VG/LV name everywhere so the messages
Peter Rajnoha [Mon, 12 Jul 2010 12:38:35 +0000 (12:38 +0000)]
Addendum for previous patch - show VG/LV name everywhere so the messages
are consistent.

14 years agoAdd more verbose messages while checking volume_list and hosttags settings.
Peter Rajnoha [Mon, 12 Jul 2010 11:37:49 +0000 (11:37 +0000)]
Add more verbose messages while checking volume_list and hosttags settings.

This should bring less confusion when there are some settings left and
people just forgot about it and then they run into problems. These messages
should give them a hint of what's really going on.

14 years agoFailed to test for the case where a log was requested to be removed
Jonathan Earl Brassow [Fri, 9 Jul 2010 17:57:51 +0000 (17:57 +0000)]
Failed to test for the case where a log was requested to be removed
even though there was no log.  A simple run through the in-tree test
suite would have caught this.  :(

-               if (lv_is_mirrored(detached_log_lv) &&
+               if (detached_log_lv && lv_is_mirrored(detached_log_lv) &&

Also, made some cosmetic changes suggested by kabi after my last check-in
(e.g. s/return 0/return_0/ and adding an error message).

14 years agoUpdate WHATS_NEW
Dave Wysochanski [Fri, 9 Jul 2010 17:01:11 +0000 (17:01 +0000)]
Update WHATS_NEW

14 years agoAdd log_error when strdup fails in {vg|lv}_change_tag().
Dave Wysochanski [Fri, 9 Jul 2010 16:57:44 +0000 (16:57 +0000)]
Add log_error when strdup fails in {vg|lv}_change_tag().

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoRemove unnecessary list of includes in liblvm files.
Dave Wysochanski [Fri, 9 Jul 2010 16:57:34 +0000 (16:57 +0000)]
Remove unnecessary list of includes in liblvm files.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoUse __attribute__ consistently throughout.
Alasdair Kergon [Fri, 9 Jul 2010 15:34:40 +0000 (15:34 +0000)]
Use __attribute__ consistently throughout.

14 years agoFix redundant declarations and always compile with -Wredundant-decls.
Alasdair Kergon [Fri, 9 Jul 2010 15:26:41 +0000 (15:26 +0000)]
Fix redundant declarations and always compile with -Wredundant-decls.

14 years agoRemove superfluous fn prototypes.
Alasdair Kergon [Fri, 9 Jul 2010 15:21:10 +0000 (15:21 +0000)]
Remove superfluous fn prototypes.

14 years agoFinish fix for bug 607347: failing both redundant mirror log legs...
Jonathan Earl Brassow [Fri, 9 Jul 2010 15:08:12 +0000 (15:08 +0000)]
Finish fix for bug 607347: failing both redundant mirror log legs...

A previous check-in added logic to handle the case where both images
of a mirrored log failed.  It solved the problem by simply removing
the log entirely - leaving the parent mirror with a 'core' log.  This
worked for most cases.  However, if there was a small delay between
the failures of the two mirrored log devices, the mirror would hang,
LVM would hang, and no additional LVM commands could be issued.

When the first leg of the log fails, it signals the need for repair.
Before 'lvconvert --repair' is run by dmeventd, the second leg fails.
'lvconvert' would see both devices as failed and try to remove the
log entirely.  When it came time to suspend the parent mirror to
update the configuration, the suspend would hang because it couldn't
get any I/O through the mirrored log, which was plugged waiting for
corrective action.  The solution is to replace the log with an error
target to clear any pending writes before removing it.  This allows
the parent mirror to suspend and make the proper changes.

14 years agoPass metadataignore to pv_create, pv_setup, _mda_setup, and add_mda.
Dave Wysochanski [Thu, 8 Jul 2010 18:24:29 +0000 (18:24 +0000)]
Pass metadataignore to pv_create, pv_setup, _mda_setup, and add_mda.

Pass metadataignore through PV creation / setup paths.
As a result of this cleanup, we can remove the unnecessary setting
of mda_ignore bits inside pvcreate_single(), after call to pv_create.
For now, just set metadataignore to '0' in some places.  This is
equivalent to the prior functionality, although the 0 is given
by the caller not hardcoded in _mda_setup() call.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoInit mda->list in mda_copy.
Dave Wysochanski [Thu, 8 Jul 2010 17:41:46 +0000 (17:41 +0000)]
Init mda->list in mda_copy.

This patch should be no functional change as all callers initialize
mda->list.

14 years agoFix format string from patch apply mistake
Zdenek Kabelac [Thu, 8 Jul 2010 14:47:46 +0000 (14:47 +0000)]
Fix format string from patch apply mistake

14 years agoRevert previous commit as it would return also for incorrect syntax.
Zdenek Kabelac [Thu, 8 Jul 2010 14:29:26 +0000 (14:29 +0000)]
Revert previous commit as it would return also for incorrect syntax.

14 years agoUpdate for dmsetup
Zdenek Kabelac [Thu, 8 Jul 2010 13:35:55 +0000 (13:35 +0000)]
Update for dmsetup

14 years agoSet return value 0 for 'dmsetup -c -o help'
Zdenek Kabelac [Thu, 8 Jul 2010 13:31:03 +0000 (13:31 +0000)]
Set return value 0 for 'dmsetup -c -o help'

14 years agoSmall update of memlock debug messages.
Zdenek Kabelac [Thu, 8 Jul 2010 13:05:27 +0000 (13:05 +0000)]
Small update of memlock debug messages.
Gives slightly better alligned lines for reading.

14 years agoDo not log backtrace in valid _lv_resume() code path
Zdenek Kabelac [Thu, 8 Jul 2010 12:24:04 +0000 (12:24 +0000)]
Do not log backtrace in valid _lv_resume() code path

14 years agoMinor optimalization of _test_word.
Zdenek Kabelac [Thu, 8 Jul 2010 12:16:16 +0000 (12:16 +0000)]
Minor optimalization of _test_word.
Skip ffs() if  (test >> bit) is 0.

14 years agoCleanups for configure:
Zdenek Kabelac [Thu, 8 Jul 2010 12:02:48 +0000 (12:02 +0000)]
Cleanups for configure:
 Indent updates.
 Use AC_HELP_STRING for help string.
 Start help string with lower letter.
 Add [] around some default values i.e. [TYPE=internal].
 Skip some "" around shell assigment when not needed.
 Fix typo --with-device-gid=UID string.

14 years agoShorten prompt for pvchange and vgextend.
Dave Wysochanski [Wed, 7 Jul 2010 21:30:07 +0000 (21:30 +0000)]
Shorten prompt for pvchange and vgextend.

14 years agoAdd --force to pvchange, and allow override of prompt involving metadataignore.
Dave Wysochanski [Wed, 7 Jul 2010 19:14:57 +0000 (19:14 +0000)]
Add --force to pvchange, and allow override of prompt involving metadataignore.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd prompt if using --metadataignore argument with vgmetadatacopies.
Dave Wysochanski [Wed, 7 Jul 2010 19:02:50 +0000 (19:02 +0000)]
Add prompt if using --metadataignore argument with vgmetadatacopies.

When using vgmetadatacopies value other than "umanaged" (0), prompt
the user if the usage of --metadataignore would change the value of
vgmetadatacopies.  The main 2 cases are:
1) pvchange --metadataignore
2) vgextend --metadataignore

We leave the prompt check in the tools, and do not change anything
if the user says 'n'.

Examples:
vgextend --metadataignore y vgtest /dev/loop0
Setting metadataignore will override preferred number of copies of VG vgtest metadata.
Are you sure? [y/n]: y
  No physical volume label read from /dev/loop0
  Physical volume "/dev/loop0" successfully created
  Volume group "vgtest" successfully extended

pvchange --metadataignore y /dev/loop3
Setting metadataignore on /dev/loop3 will override preferred number of copies of VG vgtest metadata.
Are you sure? [y/n]: y
  WARNING: Changing preferred number of copies of VG vgtest metadata from 3 to 2
  Physical volume "/dev/loop3" changed
  1 physical volume changed / 0 physical volumes not changed

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd warning to vgextend and pvchange if metadataignore given on cmdline.
Dave Wysochanski [Wed, 7 Jul 2010 18:59:45 +0000 (18:59 +0000)]
Add warning to vgextend and pvchange if metadataignore given on cmdline.

Warn the user then change the value of vg_mda_copies.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoTest failed commit of mda on new pv - failed vgextend.
Dave Wysochanski [Wed, 7 Jul 2010 14:43:57 +0000 (14:43 +0000)]
Test failed commit of mda on new pv - failed vgextend.

Test the auto-repair capability when we fail committing to an mda
on a new pv adding to a vg.  This test should fail until we fix
the auto-repair in this case.

14 years agoUse "nowatch" udev rule for known inappropriate devices.
Peter Rajnoha [Wed, 7 Jul 2010 11:22:46 +0000 (11:22 +0000)]
Use "nowatch" udev rule for known inappropriate devices.

For now, this is just a precaution. Normally, all the other (non-dm) rules
should check DM_UDEV_DISABLE_OTHER_RULES_FLAG and therefore avoid setting
any inotify watches as well. But let's make sure.

Support for final assignment of the "nowatch" rule (the use of ":=") will
appear in next udev release, v160. This should also work in previous udev
versions but the setting won't be sealed so any further OPTIONS="watch" will
always prevail there.

We may want to add more specific "nowatch" rules later if needed.

14 years agoAdjust auto-metadata repair and caching logic to try to cope with empty mdas.
Alasdair Kergon [Wed, 7 Jul 2010 02:53:16 +0000 (02:53 +0000)]
Adjust auto-metadata repair and caching logic to try to cope with empty mdas.

- If a PV contained empty mdas, the auto-recovery code was not kicking in.
- The 'inconsistent' state was getting lost when metadata was cached so
  recovery didn't kick in.  But leave the behaviour alone when using
  precommitted metadata because of a warning in a confusing FIXME.

In my testing, pvs and vgs didn't repair inconsistent metadata like they
used to do.  (How many other tools fail similarly now?)

And there should be no need to cache inconsistent metadata because it is
supposed to get repaired under the protection of a write lock immediately it is
discovered.

This code is in need of a redesign based on first principles.
I still see bugs in this code and this commit is risky.

14 years agopost-release
Alasdair Kergon [Wed, 7 Jul 2010 02:37:28 +0000 (02:37 +0000)]
post-release

14 years ago.
Alasdair Kergon [Wed, 7 Jul 2010 02:24:05 +0000 (02:24 +0000)]
.

14 years agofix code in 2nd mda unignore loop to match 1st loop
Alasdair Kergon [Tue, 6 Jul 2010 20:09:38 +0000 (20:09 +0000)]
fix code in 2nd mda unignore loop to match 1st loop

14 years agos/flags/mda/
Alasdair Kergon [Tue, 6 Jul 2010 17:29:50 +0000 (17:29 +0000)]
s/flags/mda/

14 years agoshorten mesg
Alasdair Kergon [Tue, 6 Jul 2010 17:27:32 +0000 (17:27 +0000)]
shorten mesg

14 years agofix jumbled args in 'Adjusting' message
Alasdair Kergon [Tue, 6 Jul 2010 17:26:08 +0000 (17:26 +0000)]
fix jumbled args in 'Adjusting' message

14 years agoFix for bug 607347: failing both redundant mirror log legs...
Jonathan Earl Brassow [Tue, 6 Jul 2010 17:02:03 +0000 (17:02 +0000)]
Fix for bug 607347: failing both redundant mirror log legs...

Rather than attempting to remove all the images of a mirrored
log volume via remove_mirror_images, simply remove the log
if all its devices have failed.

Taka was the first to report that there is still an outstanding
issue with handling this case.  I've managed to reproduce it
only very rarely, and am still working on identifying the problem.
Failing to handle the problem rarely is better than not handling
the scenario at all, so I'm checking this in.

14 years agopre-release
Alasdair Kergon [Tue, 6 Jul 2010 16:49:38 +0000 (16:49 +0000)]
pre-release

14 years agoFix dmlosetup snprintf %llu compiler warning.
Alasdair Kergon [Mon, 5 Jul 2010 22:56:31 +0000 (22:56 +0000)]
Fix dmlosetup snprintf %llu compiler warning.

14 years agoRandomly select which mdas to use or ignore.
Alasdair Kergon [Mon, 5 Jul 2010 22:23:15 +0000 (22:23 +0000)]
Randomly select which mdas to use or ignore.
Add some missing standard configure.in checks.

14 years agoAdd parentheses to some libdevmapper.h macro arguments.
Alasdair Kergon [Mon, 5 Jul 2010 22:22:43 +0000 (22:22 +0000)]
Add parentheses to some libdevmapper.h macro arguments.

14 years agoAdd printf format attributes to yes_no_prompt & dm_{sn,as}printf and fix a calle
Alasdair Kergon [Fri, 2 Jul 2010 21:16:50 +0000 (21:16 +0000)]
Add printf format attributes to yes_no_prompt & dm_{sn,as}printf and fix a calle

14 years ago.
Petr Rockai [Fri, 2 Jul 2010 17:44:17 +0000 (17:44 +0000)]
.

14 years agoMinor changes to man pages for --metadataignore.
Dave Wysochanski [Fri, 2 Jul 2010 17:05:22 +0000 (17:05 +0000)]
Minor changes to man pages for --metadataignore.

Move the definition from pvchange to pvcreate - the location of
other metadata options.

14 years agoremove unneeded header
Alasdair Kergon [Fri, 2 Jul 2010 10:25:16 +0000 (10:25 +0000)]
remove unneeded header

14 years agoAlways pass unsuspended dm devices through persistent filter to other filters.
Alasdair Kergon [Fri, 2 Jul 2010 02:09:57 +0000 (02:09 +0000)]
Always pass unsuspended dm devices through persistent filter to other filters.
Move test for suspended dm devices ahead of other filters.

14 years agoFix another segfault in clvmd -R if no response from daemon received.
Milan Broz [Thu, 1 Jul 2010 21:46:09 +0000 (21:46 +0000)]
Fix another segfault in clvmd -R if no response from daemon received.

Missed the same problem in another function...

14 years agoRemove superfluous suspended device counter from clvmd.
Milan Broz [Thu, 1 Jul 2010 21:23:47 +0000 (21:23 +0000)]
Remove superfluous suspended device counter from clvmd.

Moreover, in current mirror handling, when it calls activate
on removed but suspended detached log this counter drops below zero
and confuses debug log.

14 years agoFix lvm shell crash when input is entirely whitespace. (Xinwei Hu)
Alasdair Kergon [Thu, 1 Jul 2010 11:04:58 +0000 (11:04 +0000)]
Fix lvm shell crash when input is entirely whitespace.  (Xinwei Hu)

14 years agoMove dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50)
Alasdair Kergon [Thu, 1 Jul 2010 10:57:03 +0000 (10:57 +0000)]
Move dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50)

14 years agoRestore the "removemissing" behaviour of lvconvert --repair --use-policies.
Petr Rockai [Thu, 1 Jul 2010 10:10:52 +0000 (10:10 +0000)]
Restore the "removemissing" behaviour of lvconvert --repair --use-policies.

14 years agoUpdate metadata-balance test for --vgmetadatacopies 0.
Dave Wysochanski [Wed, 30 Jun 2010 22:22:00 +0000 (22:22 +0000)]
Update metadata-balance test for --vgmetadatacopies 0.

Should be equivalent to "unmanaged".

14 years ago.
Petr Rockai [Wed, 30 Jun 2010 21:58:13 +0000 (21:58 +0000)]
.

14 years agoMaintain memlock balance in clvmd.
Petr Rockai [Wed, 30 Jun 2010 21:40:27 +0000 (21:40 +0000)]
Maintain memlock balance in clvmd.

When a mirror is being downconverted in a cluster, a series of suspends and
resumes is executed.

With the change to using UUIDs in dev_manager instead of names, the behaviour
has changed with regards to including an _mlog in the deptree of a logical
volume. In the old (pre-UUID-enabled) code, the _mlog would appear in a deptree
of any volume purely based on a name match: a linear volume foo would include
foo_mlog in its dependencies if that happened to exist. This behaviour was
fixed and the mlog is now only included for mirrors.

By a coincidence, this mlog bug had been hiding a different bug in clvmd. When
a mirror is being dismantled (and converted to a linear volume), it is first
suspended as a whole, then later resumed in parts. Nevertheless, the overall
memlock balance is maintained in this operation. The problem kicks in, because
even though the mirror log was suspended as part of the mirror, when the
dismantled mirror is resumed again, it is no longer a mirror and therefore the
mirror log stays suspended. This would not be a problem in itself, since
_delete_lv (from metadata/mirror.c) is called on it subsequently, which does an
activate/deactivate cycle and removes the LV. The activate/deactivate cycle
correctly prompts clvmd to resume the device: however, in doing this, it will
issue an unpaired resume operation (the suspend that caused the mirror log to
be suspended is paired with resuming the dismantled mirror later). We have
concluded that the path in clvmd should never affect memlock_count, since there
should never be an unmatched explicit suspend preceding this resume.

14 years agoFix --[vg]metadatacopies arg processing
Alasdair Kergon [Wed, 30 Jun 2010 20:21:03 +0000 (20:21 +0000)]
Fix --[vg]metadatacopies arg processing

14 years agoimprove vgmetadatacopies unmanaged message
Alasdair Kergon [Wed, 30 Jun 2010 20:03:52 +0000 (20:03 +0000)]
improve vgmetadatacopies unmanaged message

14 years agoCheck for missing_pv in vg_remove loop.
Dave Wysochanski [Wed, 30 Jun 2010 19:55:43 +0000 (19:55 +0000)]
Check for missing_pv in vg_remove loop.

If a pv is missing, we should just skip it rather than checking the
device size and failing the vgremove.

14 years agomore mda ignore cleanups
Alasdair Kergon [Wed, 30 Jun 2010 19:28:35 +0000 (19:28 +0000)]
more mda ignore cleanups

14 years agoRefactor vg_remove_check to place pv removal into separate function.
Dave Wysochanski [Wed, 30 Jun 2010 18:03:52 +0000 (18:03 +0000)]
Refactor vg_remove_check to place pv removal into separate function.

14 years agomore metadataignore message/code cleanup
Alasdair Kergon [Wed, 30 Jun 2010 17:13:05 +0000 (17:13 +0000)]
more metadataignore message/code cleanup

14 years ago Update partial mode warning message.
Alasdair Kergon [Wed, 30 Jun 2010 16:43:09 +0000 (16:43 +0000)]
  Update partial mode warning message.

14 years agorevert that
Alasdair Kergon [Wed, 30 Jun 2010 14:54:29 +0000 (14:54 +0000)]
revert that

14 years agosuppress useless compiler warning
Alasdair Kergon [Wed, 30 Jun 2010 14:52:29 +0000 (14:52 +0000)]
suppress useless compiler warning

14 years agopost-release
Alasdair Kergon [Wed, 30 Jun 2010 14:50:32 +0000 (14:50 +0000)]
post-release

14 years agoOnly attempt to guarantee 1 mda ignored if there's at least one mda in the vg.
Dave Wysochanski [Wed, 30 Jun 2010 14:48:07 +0000 (14:48 +0000)]
Only attempt to guarantee 1 mda ignored if there's at least one mda in the vg.

14 years ago Only attempt to guarantee 1 mda ignored if there's at least one mda in the vg.
Alasdair Kergon [Wed, 30 Jun 2010 14:27:40 +0000 (14:27 +0000)]
 Only attempt to guarantee 1 mda ignored if there's at least one mda in the vg.

14 years agopre-release
Alasdair Kergon [Wed, 30 Jun 2010 14:04:15 +0000 (14:04 +0000)]
pre-release

14 years agoFix vgremove to allow removal of VG with missing PVs. (2.02.52)
Milan Broz [Wed, 30 Jun 2010 14:01:39 +0000 (14:01 +0000)]
Fix vgremove to allow removal of VG with missing PVs. (2.02.52)

14 years agoImprove various log messages.
Alasdair Kergon [Wed, 30 Jun 2010 13:51:11 +0000 (13:51 +0000)]
Improve various log messages.

14 years agoUpdate nightly tests for vgextend --metadataignore.
Dave Wysochanski [Wed, 30 Jun 2010 13:11:12 +0000 (13:11 +0000)]
Update nightly tests for vgextend --metadataignore.

14 years agoUpdate nightly tests for vgextend --metadataignore.
Dave Wysochanski [Wed, 30 Jun 2010 13:04:59 +0000 (13:04 +0000)]
Update nightly tests for vgextend --metadataignore.

14 years agoAdd --metadataignore to vgextend and man pages.
Dave Wysochanski [Wed, 30 Jun 2010 13:03:48 +0000 (13:03 +0000)]
Add --metadataignore to vgextend and man pages.

14 years agoAdd pvmetadatacopies to lvm.conf and pvcreate man pages.
Dave Wysochanski [Wed, 30 Jun 2010 12:49:28 +0000 (12:49 +0000)]
Add pvmetadatacopies to lvm.conf and pvcreate man pages.

14 years agoUpdate pvcreate tests for --metadataignore.
Dave Wysochanski [Wed, 30 Jun 2010 12:17:55 +0000 (12:17 +0000)]
Update pvcreate tests for --metadataignore.

14 years agoAdd --metadataignore to pvcreate.
Dave Wysochanski [Wed, 30 Jun 2010 12:17:24 +0000 (12:17 +0000)]
Add --metadataignore to pvcreate.

Allow metadataignore flag to be passed in to pvcreate.
Ideally, more refactoring of the mda allocation / initialization
is warranted, but for now, we just add another parameter to 'add_mda'
to take an existing mda ignored flag.  We need to do this or pv_write
loses the state of the mda 'ignored' flag before copying and writing
to disk.

14 years agoImprove logging for setting --vgmetadatacopies.
Dave Wysochanski [Tue, 29 Jun 2010 22:41:28 +0000 (22:41 +0000)]
Improve logging for setting --vgmetadatacopies.

Example of logging:
metadata/metadata.c:1127     Setting mda_copies = 3 on vg vgtest
metadata/pv_manip.c:296         /dev/loop2 0:      0     25: NULL(0:0)
metadata/pv_manip.c:296         /dev/loop3 0:      0     25: NULL(0:0)
metadata/pv_manip.c:296         /dev/loop4 0:      0     25: NULL(0:0)
metadata/metadata.c:1072     Adjusting ignored mdas on vg vgtest, vg_mda_used_count=5, vg_mda_copies=3
metadata/metadata.c:1015     Setting ignore flag for 2 mdas on vg vgtest
metadata/metadata.c:4151     Setting mda ignored flag for metadata_locn /dev/loop2.
metadata/metadata.c:4151     Setting mda ignored flag for metadata_locn /dev/loop3.

14 years agoImprove logging for metadata ignore by printing device name.
Dave Wysochanski [Tue, 29 Jun 2010 22:37:32 +0000 (22:37 +0000)]
Improve logging for metadata ignore by printing device name.

Print device name when setting or clearing metadata ignore bit.
Example:
label/label.c:160       /dev/loop2: lvm2 label detected
cache/lvmcache.c:1136         lvmcache: /dev/loop2: now in VG #orphans_lvm2 (#orphans_lvm2)
metadata/metadata.c:4142     Setting mda ignored flag for metadata_locn /dev/loop2.
format_text/text_label.c:318     Skipping mda with ignored flag on device /dev/loop2 at offset 4096

14 years agoAdd some log_verbose debug statements related to metadataignore.
Dave Wysochanski [Tue, 29 Jun 2010 22:25:58 +0000 (22:25 +0000)]
Add some log_verbose debug statements related to metadataignore.

Logging isn't ideal, especially for mda_set_ignore.  Ideally we'd
like to display the device name and offset in this case but this
requires a bit more work and a per-format 'mda_description' function
pointer definition (we don't have access to mda_context in
metadata.c).

14 years agoMove code into pv_change_metadataignore library function.
Dave Wysochanski [Tue, 29 Jun 2010 21:32:44 +0000 (21:32 +0000)]
Move code into pv_change_metadataignore library function.

In preparation to call this from both pvcreate as well as pvchange,
move the guts of metadataignore into a library function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd error message if backup_to_file fails because of empty in_use mdas list.
Dave Wysochanski [Tue, 29 Jun 2010 15:03:59 +0000 (15:03 +0000)]
Add error message if backup_to_file fails because of empty in_use mdas list.

14 years agoAdd more initializations of 'mda->flags' field.
Dave Wysochanski [Tue, 29 Jun 2010 14:52:56 +0000 (14:52 +0000)]
Add more initializations of 'mda->flags' field.

Mda allocation needs refactored into a single function but as an
interim step, ensure mda->flags is initialized properly.

14 years agoAttempt to fix intermittent failure with non-debug configured vgcfgbackup.
Dave Wysochanski [Tue, 29 Jun 2010 13:29:53 +0000 (13:29 +0000)]
Attempt to fix intermittent failure with non-debug configured vgcfgbackup.

There's an intermittent failure with vgcfgbackup that seems to have been
introduced with the metadataignore / vgmetadatacopies patchset.
Intermittent failures are often the result of uninitialized data,
so this patch calls zalloc in a few places it might matter.

14 years agoUpdate WHATS_NEW for --metadataignore and --vgmetadatacopies changes.
Dave Wysochanski [Tue, 29 Jun 2010 12:06:14 +0000 (12:06 +0000)]
Update WHATS_NEW for --metadataignore and --vgmetadatacopies changes.

14 years agoUpdate t-covercmd pvck to take proper device argument.
Dave Wysochanski [Mon, 28 Jun 2010 21:49:31 +0000 (21:49 +0000)]
Update t-covercmd pvck to take proper device argument.

14 years agoFix compile warning in vgchange.c regarding mda_copies initialization.
Dave Wysochanski [Mon, 28 Jun 2010 21:35:00 +0000 (21:35 +0000)]
Fix compile warning in vgchange.c regarding mda_copies initialization.

14 years agoUpdate tests to handle phase 2 (vg based) metadata balance.
Dave Wysochanski [Mon, 28 Jun 2010 20:40:27 +0000 (20:40 +0000)]
Update tests to handle phase 2 (vg based) metadata balance.

Test vgcreate/vgchange --vgmetadatacopies, vgextend, vgreduce,
vgsplit, vgmerge.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoUpdate example.conf.in to describe vgmetadatacopies.
Dave Wysochanski [Mon, 28 Jun 2010 20:40:15 +0000 (20:40 +0000)]
Update example.conf.in to describe vgmetadatacopies.

Update example.conf to describe vgmetadatacopies.  Provide an
explanation for the '0' ("unmanaged") value.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAllow 'all' and 'unmanaged' values for --vgmetadatacopies.
Dave Wysochanski [Mon, 28 Jun 2010 20:40:01 +0000 (20:40 +0000)]
Allow 'all' and 'unmanaged' values for --vgmetadatacopies.

Allowing an 'all' and 'unmanaged' value is more intuitive, and
provides a simple way for users to get back to original LVM behavior
of metadata written to all PVs in the volume group.

If the user requests "--vgmetadatacopies unmanaged", this instructs
LVM not to manage the ignore bits to achieve a specific number of
metadata copies in the volume group.  The user is free to use
"pvchange --metadataignore" to control the mdas on a per-PV basis.
If the user requests "--vgmetadatacopies all", this instructs LVM
to do 2 things: 1) clear all ignore bits, and 2) set the "unmanaged"
policy going forward.

Internally, we use the special MAX_UINT32 value to indicate 'all'.
This 'just' works since it's the largest value possible for the
field and so all 'ignore' bits on all mdas in the VG will get
cleared inside _vg_metadata_balance().  However, after we've
called the _vg_metadata_balance function, we check for the special
'all' value, and if set, we write the "unmanaged" value into the
metadata.  As such, the 'all' value is never written to disk.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoEnsure --metadatacopies parameter gets interpreted based on command.
Dave Wysochanski [Mon, 28 Jun 2010 20:39:39 +0000 (20:39 +0000)]
Ensure --metadatacopies parameter gets interpreted based on command.

Now that we have both --pvmetadatacopies and --vgmetadatacopies,
we need to make sure --metadatacopies gets interpreted correctly.

For pv commands, --metadatacopies should imply --pvmetadatacopies,
and for vg commands, --vgmetadatacopies.

Note: this will change the behavior of vgcreate with --metadatacopies
to be a synonym for --vgmetadatacopies.  Previously, --metadatacopies
would apply to any PVs given with vgcreate that needed an implicit
pvcreate.  As a result, one small change is needed to one of the nightly
tests - t-vgcreate-usage.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd --vgmetadatacopies to vgsplit man page and command.
Dave Wysochanski [Mon, 28 Jun 2010 20:39:24 +0000 (20:39 +0000)]
Add --vgmetadatacopies to vgsplit man page and command.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoUpdate _vgmerge_single() to move fid->metadata_areas_ignored.
Dave Wysochanski [Mon, 28 Jun 2010 20:39:08 +0000 (20:39 +0000)]
Update _vgmerge_single() to move fid->metadata_areas_ignored.

When vgmerge is called we move the mdas from the source to the
destination.  With metadata balancing we now have another mda
list, fid->metadata_areas_ignored, so move the mdas on this list
as well.

This patch should not matter as the code is written today.  However
we include it for completeness in the case that _vgmerge_single()
is refactored and/or moved into a library function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoUpdate check in vg_split_mdas to account for ignored mdas list.
Dave Wysochanski [Mon, 28 Jun 2010 20:38:56 +0000 (20:38 +0000)]
Update check in vg_split_mdas to account for ignored mdas list.

The check in vg_split_mdas will trigger an error if the 'from' vg
list is empty.  However, this might be ok in some instances now
that we have ignored mdas.  Relax this check so an error is triggered
only in the case where there's truly no more mdas in the 'from'
vg.

One example of where this makes a difference is with vgreduce.
If we try to vgreduce a PV with un-ignored mdas, this should trigger
the balancing function to un-ignore mdas on another PV in the VG.
However, we don't get to vg_write() before we fail because this
list size check fails, and we see an error message indicating:
"Cannot remove final metadata area ..."

Another example is with vgsplit into a new VG, where the PVs
being moved contain all ignored mdas.  We must move the mdas on
fid->metadata_areas_ignored from 'vg_from' to 'vg_to'.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoEnsure fid mda lists are populated correctly during vgextend.
Dave Wysochanski [Mon, 28 Jun 2010 20:38:39 +0000 (20:38 +0000)]
Ensure fid mda lists are populated correctly during vgextend.

The vgextend path calls add_pv_to_vg().  Inside add_pv_to_vg(),
we must ensure we pass the correct mdas list into pv_setup(), as
copies of mdas are placed on the vg->fid list.  If we don't place
the mdas on the correct vg->fid list, the various counts may be
incorrect and the metadata balance algorithm will not work when
called from vg_write() path.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd --vgmetadatacopies to vgcreate man page, command, and lvm.conf.
Dave Wysochanski [Mon, 28 Jun 2010 20:38:23 +0000 (20:38 +0000)]
Add --vgmetadatacopies to vgcreate man page, command, and lvm.conf.

Allow parsing of --vgmetadatacopies for vgcreate.  Accept
--metadatacopies as a synonym for --vgmetadatacopies.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoSet vg_mda_copies when pvchange --metadataignore is given.
Dave Wysochanski [Mon, 28 Jun 2010 20:38:06 +0000 (20:38 +0000)]
Set vg_mda_copies when pvchange --metadataignore is given.

When a user explicitly sets a new mda ignore value for a PV, we
should update vg_mda_copies accordingly.  When the VG is written
out, the user would not want the new ignore state to get lost as
a result of the vg_mda_copies value and logic in the vg_write
path.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoImplement _vg_adjust_ignored_mdas and call from vg_write() path.
Dave Wysochanski [Mon, 28 Jun 2010 20:37:54 +0000 (20:37 +0000)]
Implement _vg_adjust_ignored_mdas and call from vg_write() path.

Compare the value of the newly added vg_mda_copies field
(--vgmetadatacopies parameter) with the current count of
in-use mdas and ignoring or unignoring mdas as necessary to
get to the target count.  Also, as a safety check before
returning, ensure we have at least one mda enabled.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoUpdate vgchange tool to accept --vgmetadatacopies.
Dave Wysochanski [Mon, 28 Jun 2010 20:37:37 +0000 (20:37 +0000)]
Update vgchange tool to accept --vgmetadatacopies.

Update logic in vgchange to handle --vgmetadatacopies, allow
--metadatacopies as a synonym to --vgmetadatacopies,
and add these parameters to args.h and commands.h
Forbit both --vgmetadatacopies and --metadatacopies as only
one allowed.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd vg_mda_copies display field to 'vgs' command.
Dave Wysochanski [Mon, 28 Jun 2010 20:37:23 +0000 (20:37 +0000)]
Add vg_mda_copies display field to 'vgs' command.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoMake vg->mda_copies persistent in on disk vg metadata.
Dave Wysochanski [Mon, 28 Jun 2010 20:37:10 +0000 (20:37 +0000)]
Make vg->mda_copies persistent in on disk vg metadata.

This patch adds the ability to read/write the vg->mda_copies values
from/to the vg metadata.

If we read the VG metadata and this field does not exist, we set
mda_copies to the default value of 0.  Later in the code, we use
this special '0' value to indicate a disable of metadata balancing.
This should preserve existing LVM behavior and ensure metadata balancing
can be turned off should the need arise.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoAdd vg get/set methods for VG metadata copies.
Dave Wysochanski [Mon, 28 Jun 2010 20:36:56 +0000 (20:36 +0000)]
Add vg get/set methods for VG metadata copies.

This patch adds the get and partially implemented set function.
The 'set' function should probably ignore or un-ignore metadata areas
based on new values.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This page took 0.067914 seconds and 5 git commands to generate.