]> sourceware.org Git - lvm2.git/log
lvm2.git
14 years agoUse macro outsize() with check for error return value.
Zdenek Kabelac [Thu, 7 Jan 2010 14:46:51 +0000 (14:46 +0000)]
Use macro outsize() with check for error return value.

14 years agoExport function out_text_with_comment() and add outfc() macro that checks
Zdenek Kabelac [Thu, 7 Jan 2010 14:45:28 +0000 (14:45 +0000)]
Export function out_text_with_comment() and add outfc() macro that checks
for error.

14 years agoAdd macros outsize() for out_size() and outhint() for out_hint() that check
Zdenek Kabelac [Thu, 7 Jan 2010 14:40:46 +0000 (14:40 +0000)]
Add macros outsize() for out_size() and outhint() for out_hint() that check
for errors in a similar way as outf() for out_text().

14 years agoUse offsetof() macro and avoid defining dummy static union for FIELD() macro.
Zdenek Kabelac [Thu, 7 Jan 2010 14:37:11 +0000 (14:37 +0000)]
Use offsetof() macro and avoid defining dummy static union for FIELD() macro.
Makes it compilable by clang compiler.

14 years agoError message prints unrecognized key.
Zdenek Kabelac [Thu, 7 Jan 2010 14:32:44 +0000 (14:32 +0000)]
Error message prints unrecognized key.

14 years agoShow all fields for 'dmsetup info -c -o all'.
Zdenek Kabelac [Thu, 7 Jan 2010 14:30:47 +0000 (14:30 +0000)]
Show all fields for 'dmsetup info -c -o all'.

14 years agoJust add '.' at the end of error message.
Zdenek Kabelac [Thu, 7 Jan 2010 14:29:53 +0000 (14:29 +0000)]
Just add '.' at the end of error message.

14 years agoFix typo fsdam -> fsadm (closes bug 552721)
Zdenek Kabelac [Thu, 7 Jan 2010 09:42:51 +0000 (09:42 +0000)]
Fix typo  fsdam -> fsadm   (closes bug 552721)

14 years ago. update documentation for --poll in the vgchange and lvchange man pages
Mike Snitzer [Wed, 6 Jan 2010 19:08:58 +0000 (19:08 +0000)]
. update documentation for --poll in the vgchange and lvchange man pages
. add high-level --poll FIXMEs to vgchange.c and lvchange.c

14 years agoRename mirror_device_fault_policy to mirror_image_fault policy
Milan Broz [Wed, 6 Jan 2010 13:27:06 +0000 (13:27 +0000)]
Rename mirror_device_fault_policy to mirror_image_fault policy

14 years agoRemove empty "repaired" devices if empty in lvconvert.
Milan Broz [Wed, 6 Jan 2010 13:26:21 +0000 (13:26 +0000)]
Remove empty "repaired" devices if empty in lvconvert.

The logic was that lvconvert repair volumes, marking
PV as MISSING and following vgreduce --removemissing
removes these missing devices.

Previously dmeventd mirror DSO removed all LV and PV
from VG by simply relying on
vgreduce --removemissing --force.

Now, there are two subsequent calls:
lvconvert --repair --use-policies
vgreduce --removemissing

So the VG is locked twice, opening space for all races
between other running lvm processes. If the PV reappears
with old metadata on it (so the winner performs autorepair,
if locking VG for update) the situation is even worse.

Patch simply adds removemissing PV functionality into
lvconcert BUT ONLY if running with --repair and --use-policies
and removing only these empty missing PVs which are
involved in repair.
(This combination is expected to run only from dmeventd.)

14 years agoUse fixed buffer to prevent stack overflow in persistent filter dump.
Milan Broz [Wed, 6 Jan 2010 13:25:36 +0000 (13:25 +0000)]
Use fixed buffer to prevent stack overflow in persistent filter dump.

14 years agoupdate WHATS_NEW and WHATS_NEW_DM with previous commits' changes
Mike Snitzer [Tue, 5 Jan 2010 21:32:59 +0000 (21:32 +0000)]
update WHATS_NEW and WHATS_NEW_DM with previous commits' changes

14 years agoUse snapshot metadata usage to determine if snapshot is empty
Mike Snitzer [Tue, 5 Jan 2010 21:14:04 +0000 (21:14 +0000)]
Use snapshot metadata usage to determine if snapshot is empty

Version >= 1.8.0 of the DM snapshot target appends metadata sectors used
to a snapshot's status.  This patch allows LVM2 to accurately determine
if the snapshot store is empty.  Knowing when a snapshot store is empty
is important in the context of snapshot-merge (means merge is complete).

Also update LVM2 to be aware of the possibility for "Merge failed" in
the snapshot-merge target's status.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoAdd missing 'stack;' for all activate_lv and deactivate_lv callers.
Mike Snitzer [Tue, 5 Jan 2010 21:08:34 +0000 (21:08 +0000)]
Add missing 'stack;' for all activate_lv and deactivate_lv callers.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoAdd missing 'stack;' for all suspend_lv and resume_lv callers.
Mike Snitzer [Tue, 5 Jan 2010 21:07:31 +0000 (21:07 +0000)]
Add missing 'stack;' for all suspend_lv and resume_lv callers.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoReturn error to dm_tree_deactivate_children() callers.
Mike Snitzer [Tue, 5 Jan 2010 21:06:26 +0000 (21:06 +0000)]
Return error to dm_tree_deactivate_children() callers.

Otherwise deactivate_lv can fail silently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoReturn error to dm_tree_suspend_children() callers.
Mike Snitzer [Tue, 5 Jan 2010 21:05:40 +0000 (21:05 +0000)]
Return error to dm_tree_suspend_children() callers.

Otherwise suspend_lv and its variants can fail silently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoReturn error to dm_tree_preload_children() and
Mike Snitzer [Tue, 5 Jan 2010 21:04:37 +0000 (21:04 +0000)]
Return error to dm_tree_preload_children() and
dm_tree_activate_children() callers.

Otherwise resume_lv and its variants can fail silently.

Catching these failures is especially important now that dm targets like
crypt and snapshot-merge can fail in .preresume

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoAdd a [--poll {y|n}] flag to vgchange and lvchange to control whether
Mike Snitzer [Tue, 5 Jan 2010 20:56:51 +0000 (20:56 +0000)]
Add a [--poll {y|n}] flag to vgchange and lvchange to control whether
the background polldaemon is allowed to start.  It can be used
standalone or in conjunction with --refresh or --available y.

Control over when the background polldaemon starts will be particularly
important for snapshot-merge of a root filesystem.

Dracut will be updated to activate all LVs with: --poll n

The lvm2-monitor initscript will start polling with: --poll y

NOTE: Because we currently have no way of knowing if a background
polldaemon is active for a given LV the following limitations exist and
have been deemed acceptable:
1) it is not possible to stop an active polldaemon; so the lvm2-monitor
   initscript doesn't stop running polldaemon(s)
2) redundant polldaemon instances will be started for all specified LVs
   if vgchange or lvchange are repeatedly used with '--poll y'

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoPropagate commit and revert metadata event to other nodes in cluster.
Milan Broz [Tue, 5 Jan 2010 16:09:33 +0000 (16:09 +0000)]
Propagate commit and revert metadata event to other nodes in cluster.

This patch tries to correctly track changes in lvmcache related to commit/revert.

For vg_commit: if there is cached precommitted metadata, after successfull commit
these metadata must be tracked as committed.

For vg_revert: remote nodes must drop precommitted metadata and its flag in lvmcache.

(N.B. Patch do not touch LV locks here in any way.)

All this machinery is needed to properly solve remote node cache invalidaton which
cause several problems recently observed.

14 years agoProper mask lock mode for vg lock.
Milan Broz [Tue, 5 Jan 2010 16:07:56 +0000 (16:07 +0000)]
Proper mask lock mode for vg lock.

Lock mode is int masked by LCK_TYPE_MASK, always.

Patch also remove uneccessary masking lock flag on sender side,
if masking is needed, it is don on client side already.

14 years agoAdd possibility to handle precommitted metadata in lvmcache.
Milan Broz [Tue, 5 Jan 2010 16:06:42 +0000 (16:06 +0000)]
Add possibility to handle precommitted metadata in lvmcache.

 - Add drop_precommitted flag to force drop precommitted metadata
 - add lvmcache_commit_metadata() which upgrades precommitted metadata in cache

No functional change in this patch - just preparation for following change.

14 years agoMove processing of VG locks to separate function (similar to LV locks).
Milan Broz [Tue, 5 Jan 2010 16:05:12 +0000 (16:05 +0000)]
Move processing of VG locks to separate function (similar to LV locks).

And print some debugging info.

No functional change in this patch.

14 years agoProperly decode flags even for VG locks.
Milan Broz [Tue, 5 Jan 2010 16:03:37 +0000 (16:03 +0000)]
Properly decode flags even for VG locks.

And decode flags in humar readable form in client.
And clean some trailing whitespaces.

No functional change in this patch (only debugging messages changed).

14 years agoDo not set precommitted flag in cache when precommitted metadata does not exist.
Milan Broz [Tue, 5 Jan 2010 16:01:22 +0000 (16:01 +0000)]
Do not set precommitted flag in cache when precommitted metadata does not exist.

The use_precommitted flag indicates, that we want to use precommitted metadata
(used in suspend call to preload table with precommitted data).

But if there are no such data, committed metadata are read but the cache
still contains that precommitted flag.

(The problem is that later possible drop_metadata call will not invalidate
device in cache.)

The wrong precommitted state is stored in on remote nodes during normal
suspend/resume cycle _without_ vg_write/commit.

Use the PRECOMMITTED status flag here instead (which is always set if using
precommited metadata here).

14 years agoResume volumes in reverse order to preserve memlock pairing.
Milan Broz [Tue, 5 Jan 2010 15:58:11 +0000 (15:58 +0000)]
Resume volumes in reverse order to preserve memlock pairing.

If renaming snapshot with virtual origin, the origin is renamed too.
But the code must resume LVs in reverse order to properly
pair memlock (in cluster locking).

(The resume of snapshot resumes origin too and later resume
is ignored otherwise.)

14 years agoFix previous vgcreate commit to not call unpaired unlock.
Milan Broz [Mon, 28 Dec 2009 18:34:45 +0000 (18:34 +0000)]
Fix previous vgcreate commit to not call unpaired unlock.

14 years agoExplicitly use non-clustered vgcreate in test.
Milan Broz [Mon, 28 Dec 2009 18:33:04 +0000 (18:33 +0000)]
Explicitly use non-clustered vgcreate in test.
(So the tests can run under cluster locking and do not require
cluster mirror or snapshots.)

Add vgscan before block device readahead change
(flush long running process - clvmd - dev cache.)

14 years agoDrop metadata cache after device was autorepaired and removed from VG.
Milan Broz [Fri, 18 Dec 2009 12:45:41 +0000 (12:45 +0000)]
Drop metadata cache after device was autorepaired and removed from VG.

All long running processes must reload metadata when some
device becomes orphan after repair.

14 years agoRemove missing flag if PV reappeared and is empty.
Milan Broz [Fri, 18 Dec 2009 12:44:20 +0000 (12:44 +0000)]
Remove missing flag if PV reappeared and is empty.

When PV device reappears with old metadata, it is
always updated to new version byt atutomatic metadata
repair.

Remove missing flag if device is empty.

If device contains allocated extents, issue warning that
user must remove volumes and re-add this PV before
manipulating with this volume.

This partially solves bug 547842 when one PV (log) is failed,
dmeventd removes that device and later this device reappears and
is wrongly added into VG marked missing.

14 years agoRevert another unintended change that snuck in.
Petr Rockai [Thu, 17 Dec 2009 15:59:53 +0000 (15:59 +0000)]
Revert another unintended change that snuck in.

14 years agoFix removal of multiple devices from a mirror (+ regression test).
Petr Rockai [Thu, 17 Dec 2009 15:38:29 +0000 (15:38 +0000)]
Fix removal of multiple devices from a mirror (+ regression test).

14 years agoAlso clean up MISSING devices in --removemissing --force in vgreduce.
Petr Rockai [Thu, 17 Dec 2009 13:54:46 +0000 (13:54 +0000)]
Also clean up MISSING devices in --removemissing --force in vgreduce.

14 years agoRevert unintended change that slipped in with last checkin.
Petr Rockai [Wed, 16 Dec 2009 19:26:20 +0000 (19:26 +0000)]
Revert unintended change that slipped in with last checkin.

14 years ago#define an INTERNAL_ERROR macro and use it throughout LVM.
Petr Rockai [Wed, 16 Dec 2009 19:22:11 +0000 (19:22 +0000)]
#define an INTERNAL_ERROR macro and use it throughout LVM.

14 years agoCleanup returns for void functions.
Zdenek Kabelac [Fri, 11 Dec 2009 13:16:37 +0000 (13:16 +0000)]
Cleanup returns for void functions.

14 years agoDestroy allocated mempool in _vg_read_orphans() error path.
Zdenek Kabelac [Fri, 11 Dec 2009 13:14:44 +0000 (13:14 +0000)]
Destroy allocated mempool in _vg_read_orphans() error path.

14 years agoFix unlocking vg in some pvresize and toollib error paths.
Zdenek Kabelac [Fri, 11 Dec 2009 13:11:56 +0000 (13:11 +0000)]
Fix unlocking vg in some pvresize and toollib error paths.

14 years agoFix coredump and memory leak for 'dmsetup help -c'
Zdenek Kabelac [Fri, 11 Dec 2009 13:04:30 +0000 (13:04 +0000)]
Fix coredump and memory leak for 'dmsetup help -c'

14 years agos/=/==/ Typo was causing sub test to always return success.
Jonathan Earl Brassow [Thu, 10 Dec 2009 22:06:15 +0000 (22:06 +0000)]
s/=/==/  Typo was causing sub test to always return success.

14 years agoCall explicitly suspend for temporary mirror layer.
Milan Broz [Wed, 9 Dec 2009 19:53:39 +0000 (19:53 +0000)]
Call explicitly suspend for temporary mirror layer.

The memlock_inc() fix is wrong, memlock count is not
propagated to long living process (clvmd) and just
it underflow there.
Also suspend is needed to pre-load precommited metadata
on other nodes (remapping to error taget in this case).

With explicit suspend we generate lock request and code
can update memlock count.

(Infinitely "locked" memory caused that fs_unlock() was not
called properly and on cluster nodes remains
old links in /dev/mapper for not active devices.)

(N.B. failing of suspend call here is not handled as fatal
error - the LV is going to be removed later anyway.)

14 years agoUse more descriptive variable name for temporary layer lv.
Milan Broz [Wed, 9 Dec 2009 19:43:39 +0000 (19:43 +0000)]
Use more descriptive variable name for temporary layer lv.

14 years agoFix missing include.
Milan Broz [Wed, 9 Dec 2009 19:30:56 +0000 (19:30 +0000)]
Fix missing include.

14 years agoAllow manipulation with precommited metadata even when a PV is missing.
Milan Broz [Wed, 9 Dec 2009 19:29:04 +0000 (19:29 +0000)]
Allow manipulation with precommited metadata even when a PV is missing.

The new recovery code first tries to repair LV and then removes failed PV
from VG. It means that during operation there can be VG with PV missing,
and vg_read code handles it like not consistent VG.

We already allows returning "inconsistent" commited metadata,
for mirror repair we need this for precommited too.
(The suspend call prepares precommited metadata to inactive table on
other cluster nodes.)

"Inconsistent" here means - correct metadata, just with some metadata areas
not found (obviously on missing or failed PVs).

14 years agoAdd memlock information to do_lock_lv debug output.
Milan Broz [Wed, 9 Dec 2009 19:01:27 +0000 (19:01 +0000)]
Add memlock information to do_lock_lv debug output.

This helps a lot to detect that something strange happened.

14 years agoNever ever use distributed lock for LV in non-clustered VG.
Milan Broz [Wed, 9 Dec 2009 19:00:16 +0000 (19:00 +0000)]
Never ever use distributed lock for LV in non-clustered VG.

The LV locks make sense only for clustered LVs.

Properly check cluster flag and never issue cluster lock here.

There are several places in code, where it is already checked, this
patch add this check to all needed calls.

In previous code the lock behaviour was inconsistent,
for example, the pre/post callback can take lock even for local volume,
but deactivate call do not released this lock and it remains held forever.

The local LV lock request now just let run the underlying activation code
on local node, the same process like in local locking.

(Again, this is important for new mirror repair calls, here for local
mirrors but with cluster locking enabled.)

14 years agoAllow implicit lock conversion for pre/post callbacks.
Milan Broz [Wed, 9 Dec 2009 18:55:53 +0000 (18:55 +0000)]
Allow implicit lock conversion for pre/post callbacks.

This is unnoticed regression from commit 31672ff60e405795cad70d6d7888ac011f5373ce

The pre/post callback need to convert lock always, local node
is going to modify metadata in this case, it it fails conversion,
the call is ignored.

Also it fixes bug when the lock is not yet held, we cannot set LKF_CONVERT
in this case, it will fail because this lock do not exist.

Note that the automatic conversion is still disabled in activate
call, so the original fix (reactivation of exlusive LV) should
be still in place.

14 years agoAllow implicit "convert" to the same lock mode.
Milan Broz [Wed, 9 Dec 2009 18:45:12 +0000 (18:45 +0000)]
Allow implicit "convert" to the same lock mode.

(Code already not fail if unlocking not locked resource.)

This is needed in pre/post lock_lv call, where we can
request the same lock on local node becuase of suspend call.

14 years agoGet rid of magic masks in cluster locking code - clvmd part.
Milan Broz [Wed, 9 Dec 2009 18:42:02 +0000 (18:42 +0000)]
Get rid of magic masks in cluster locking code - clvmd part.

- do_command and lock_vg expect flags (no change here)

Bug fixes:
- lock_vg should check for NONBLOCK on lock_cmd, flags have this bit masked-out

- do_pre/post_command expect do not mask flag at all, this causes that
the code inside is never run! (see following patches, these functions
expect plain command without flags)

14 years agoGet rid of magic masks in cluster locking code.
Milan Broz [Wed, 9 Dec 2009 18:28:27 +0000 (18:28 +0000)]
Get rid of magic masks in cluster locking code.

Patch should not cause any problems, only real change is
removing LCK_LOCAL bit from lock type flag, it is never used there.
(LCK_LOCAL is part arg[1] bits anyway.)

14 years agoGet rid of hardcoded 0xffdf cluster lock flag.
Milan Broz [Wed, 9 Dec 2009 18:16:38 +0000 (18:16 +0000)]
Get rid of hardcoded 0xffdf cluster lock flag.

There is hidded change - the upper flags (0xffff0000)
and now not cleared, but there are unused anyway.

14 years agoRemove newly created log volume if initial deactivation fails.
Milan Broz [Wed, 9 Dec 2009 18:09:52 +0000 (18:09 +0000)]
Remove newly created log volume if initial deactivation fails.

If there is problem deactivate LV and
_init_mirror_log is called with remove_on_failure = 1,
remove the newly created log LV from metadata.

(This can happen if there is active device with the same name
but different UUID.)

The main reason for this "workaround" patch is to
 - do not keep _mlog volume in metadata, so user can repeat the action
 - print better error message describing the real problem

# lvcreate -m 2 -n lv1 -l 1 --nosync vg_bar
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  /dev/vg_bar/lv1_mlog: not found: device not cleared
  Aborting. Failed to wipe mirror log.
  Error locking on node bar-01: Input/output error
  Unable to deactivate mirror log LV. Manual intervention required.
  Failed to create mirror log.

# lvcreate -m 2 -n lv1 -l 1 --nosync vg_bar
  WARNING: New mirror won't be synchronised. Don't read what you didn't write!
  Aborting. Unable to deactivate mirror log.
  Failed to initialise mirror log.

14 years agoFix activated/deactivated log_verbose message
Dave Wysochanski [Mon, 7 Dec 2009 19:32:28 +0000 (19:32 +0000)]
Fix activated/deactivated log_verbose message

I see "Deactivated" message when I activate and "Activated" message when
I deactivate.  The code uses "activate" as boolean but it can be any one
of the enum values from CHANGE_AY, CHANGE_AN, CHANGE_AE, etc.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Dave Wysochanski <dwysocha@redhat.com>
14 years agoDisable udev rules on change event with DISK_RO=1.
Peter Rajnoha [Mon, 7 Dec 2009 12:03:47 +0000 (12:03 +0000)]
Disable udev rules on change event with DISK_RO=1.

There's a new change udev event generated since kernel 2.6.32 that
notifies userspace about a change in read-only attribute for block
devices (with DISK_RO=1 environment variable set).

We need to detect this and disable the rule application so the
meaning of this change event is not interchanged with the regular
change event used while resuming/renaming DM devices.

If there's anybody awaiting this notification in foreign rules,
he can still check for this env var and do the appropriate actions
separately.

14 years agoUpdate a few more uint64_t's related to the 64-bit status change.
Dave Wysochanski [Fri, 4 Dec 2009 17:48:32 +0000 (17:48 +0000)]
Update a few more uint64_t's related to the 64-bit status change.

At this point they probably do not matter but going forward they
may - depends on future patches for replicator, etc.  I think
these probably got missed because they were 'flags' so I changed
the name to 'status' to be consistent.  So the on-disk
things 'flags' and the in structure 'status' (bits).
NOTE: WHATS_NEW already has entry for this in current release.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
14 years agoWHATS_NEW for previous commit.
Peter Rajnoha [Fri, 4 Dec 2009 14:26:22 +0000 (14:26 +0000)]
WHATS_NEW for previous commit.

14 years agoGive better message for pvmove when all data on source PV is skipped.
Peter Rajnoha [Fri, 4 Dec 2009 14:03:18 +0000 (14:03 +0000)]
Give better message for pvmove when all data on source PV is skipped.

14 years agoFix memory lock imbalance in lv_suspend if already suspended.
Milan Broz [Thu, 3 Dec 2009 19:23:40 +0000 (19:23 +0000)]
Fix memory lock imbalance in lv_suspend if already suspended.

pvmove suspends all moved LVs + pvmoveX mirrored LV itself.

This suspends even underlying pvmoveX and following explicit
suspend call is just noop.

But in resume the pvmoveX volume is no longer underlying
device for moved LVs, so it performs full resume with memlock
decrease.

Code must call memlock_inc() if suspend is requested, volume
is already suspended and error is not requested.

14 years agoFix pvmove test mode to not fail and do not poll.
Milan Broz [Thu, 3 Dec 2009 19:22:24 +0000 (19:22 +0000)]
Fix pvmove test mode to not fail and do not poll.

Test mode should not fail nor try to poll non-existent devices.

14 years agoPrint error if VG already exist.
Milan Broz [Thu, 3 Dec 2009 19:20:48 +0000 (19:20 +0000)]
Print error if VG already exist.

This test have to be moved because of new vg read error handling.

14 years agoFix tools to report error when stopped by user.
Milan Broz [Thu, 3 Dec 2009 19:18:33 +0000 (19:18 +0000)]
Fix tools to report error when stopped by user.

(And do not produce internal error message.)

14 years agominor indent change
Zdenek Kabelac [Thu, 3 Dec 2009 10:01:30 +0000 (10:01 +0000)]
minor indent change

14 years agoskip cast from (void*)
Zdenek Kabelac [Thu, 3 Dec 2009 09:59:54 +0000 (09:59 +0000)]
skip cast from (void*)

14 years agominor whitespace indentation
Zdenek Kabelac [Thu, 3 Dec 2009 09:58:30 +0000 (09:58 +0000)]
minor whitespace indentation

14 years agoAdd tests to check for readahead value in lvcreate.
Dave Wysochanski [Thu, 3 Dec 2009 01:48:05 +0000 (01:48 +0000)]
Add tests to check for readahead value in lvcreate.

14 years agoFix setting of readahead in lvcreate.
Dave Wysochanski [Thu, 3 Dec 2009 01:47:33 +0000 (01:47 +0000)]
Fix setting of readahead in lvcreate.

The default comes from the configuration settings, with possible
commandline override.

14 years agoFix memory leak in lv_info_by_lvid
Milan Broz [Tue, 1 Dec 2009 19:10:23 +0000 (19:10 +0000)]
Fix memory leak in lv_info_by_lvid

The lv_from_lvid calls internally vg_read(),
we must release vg structure afterwards.

Code is called only from clvmd.

14 years agoIf aborting due to an internal error, always print the message causing this.
Petr Rockai [Tue, 1 Dec 2009 13:54:27 +0000 (13:54 +0000)]
If aborting due to an internal error, always print the message causing this.

14 years agoOptionally abort on internal errors (and leverage this option in the
Petr Rockai [Mon, 30 Nov 2009 17:17:11 +0000 (17:17 +0000)]
Optionally abort on internal errors (and leverage this option in the
testsuite). (This is showing a problem in the pvmove test for me, so I expect
the tests to start failing -- this needs to be fixed separately though.)

14 years agoThe sourcedir instances of the test scripts are not PHONY.
Petr Rockai [Mon, 30 Nov 2009 16:58:53 +0000 (16:58 +0000)]
The sourcedir instances of the test scripts are not PHONY.

14 years agoDon't fail in the builddir == srcdir case, though. (testsuite)
Petr Rockai [Mon, 30 Nov 2009 16:56:42 +0000 (16:56 +0000)]
Don't fail in the builddir == srcdir case, though. (testsuite)

14 years agoFix test/api to work with srcdir != builddir.
Petr Rockai [Mon, 30 Nov 2009 15:12:34 +0000 (15:12 +0000)]
Fix test/api to work with srcdir != builddir.

14 years agoMore fixes for the testsuite in the $(builddir) != $(srcdir) situation.
Petr Rockai [Mon, 30 Nov 2009 14:59:26 +0000 (14:59 +0000)]
More fixes for the testsuite in the $(builddir) != $(srcdir) situation.

14 years agoDo not allow creating mirrors of more than 8 images.
Milan Broz [Fri, 27 Nov 2009 14:35:38 +0000 (14:35 +0000)]
Do not allow creating mirrors of more than 8 images.

This is kernel limitation in all kernel versions,
so better detect this early.

14 years agoUse locking_type 3 (compiled in cluster locking) in lvmconf.
Milan Broz [Fri, 27 Nov 2009 14:32:16 +0000 (14:32 +0000)]
Use locking_type 3 (compiled in cluster locking) in lvmconf.

14 years agoRemove unnecessary / duplicate dm_list macros and functions.
Dave Wysochanski [Wed, 25 Nov 2009 20:44:07 +0000 (20:44 +0000)]
Remove unnecessary / duplicate dm_list macros and functions.

These are no longer used by anyone.  The dm_list defines are all in
libdevmapper.h and libdm/datastruct/list.c contains any function definitions.
There is some code in "old-tests" that still use this but this code is not
being maintained.

Thanks to Zdenek for spotting this.

14 years agoLog failure type and recognise type 'F' (flush) in dmeventd mirror plugin.
Alasdair Kergon [Wed, 25 Nov 2009 15:59:07 +0000 (15:59 +0000)]
Log failure type and recognise type 'F' (flush) in dmeventd mirror plugin.

14 years agoSwitch status from 32-bit to 64-bit
Mike Snitzer [Tue, 24 Nov 2009 22:55:55 +0000 (22:55 +0000)]
Switch status from 32-bit to 64-bit

The physical_volume, volume_group, logical_volume and lv_segment
structures' 'status' member is now uint64_t.

The alignment of these structures was also audited to remove holes.  The
movement of some members in 'volume_group' and 'lv_segment' eliminates
holes.  The 'physical_volume' structure still has one 4-byte hole after
'pe_size'; the other structures no longer have any holes.  Each
structures' size has not changed.

14 years agoPost-release.
Alasdair Kergon [Tue, 24 Nov 2009 19:04:23 +0000 (19:04 +0000)]
Post-release.
Fingers crossed this one's more successful that the last one!

14 years ago.
Alasdair Kergon [Tue, 24 Nov 2009 18:54:23 +0000 (18:54 +0000)]
.

14 years agopre-release
Alasdair Kergon [Tue, 24 Nov 2009 18:26:08 +0000 (18:26 +0000)]
pre-release

14 years agoAdd missing vg_release to pvs and pvdisplay to fix memory leak.
Milan Broz [Tue, 24 Nov 2009 17:07:09 +0000 (17:07 +0000)]
Add missing vg_release to pvs and pvdisplay to fix memory leak.

14 years agoDo not try to unlock VG which is not locked.
Milan Broz [Tue, 24 Nov 2009 16:13:02 +0000 (16:13 +0000)]
Do not try to unlock VG which is not locked.

If the vg_read() returned error, no lock was taken,
so always call vg_release().

Otherwise this can happen because of missing FAILED_*:

# vgchange -a y x --ignorelockingfailure
  Volume group "x" not found
  Internal error: Attempt to unlock unlocked VG x

14 years agoMove persistent filter dump to more appropriate place.
Milan Broz [Tue, 24 Nov 2009 16:11:37 +0000 (16:11 +0000)]
Move persistent filter dump to more appropriate place.

After context_refresh is cache empty, the cache flush
does nothing.

Call it after lvmcache full rescan if running from
log lived process.

14 years agoRefresh device filters before full device rescan in lvmcache.
Milan Broz [Tue, 24 Nov 2009 16:10:25 +0000 (16:10 +0000)]
Refresh device filters before full device rescan in lvmcache.

The sysfs filter initialise hash of available devices using
scan of /sys/block. We need to refresh even this hash
when performing full scan otherwise the newly appeared
device could be rejected, because there is no entry
in sysfs filter.

This easily could happen when attaching new device
to cluster node. (Only force refresh of context
in clvmd -R works here now).

Unfortunately consequences of this are much worse,
missing device part on that node is replaced with missing segment
(even when no partial arg is selected) and this directly
lead to data corruption.

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

Simply fix it by refreshing device filters in lvmcache
before performing the full device scan.

14 years agoReturn error status if vgchange fails to activate some volume.
Milan Broz [Tue, 24 Nov 2009 16:08:49 +0000 (16:08 +0000)]
Return error status if vgchange fails to activate some volume.

(on one node a storage connection failed):

# vgchange -a y vg_bar ; echo $?
  Error locking on node bar-02: Refusing activation of partial LV lv1. Use --partial to override.
    1 logical volume(s) in volume group "vg_bar" now active
    0

So activation fails on one node, error is correctly printed but
status code is wrong.

This patch fixes the top level (vgchange) to return proper code
(and print # of activated LVs).

(lvchange returns error properly here.)

14 years agoFix memory lock imbalance in locking code.
Milan Broz [Mon, 23 Nov 2009 10:55:14 +0000 (10:55 +0000)]
Fix memory lock imbalance in locking code.

(This affects only cluster locking because only cluster
locking module set LCK_PRE_MEMLOCK.)

With currect code you get
# vgchange -a n
  Internal error: _memlock_count has dropped below 0.
when using cluster locking.

It is caused by _unlock_memory calls here

  if ((flags & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_RESUME)
     memlock_dec();

Unfortunately it is also (wrongly) called in immediate unlock
(when LCK_HOLD is not set) from lock_vol
(LCK_UNLOCK is misinterpreted as LCK_LV_RESUME).

Avoid this by comparing original flags and provide memlock
code type of operation (suspend/resume).

14 years agoRevert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55)
Milan Broz [Mon, 23 Nov 2009 10:44:50 +0000 (10:44 +0000)]
Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55)

15 years agopost-release
Alasdair Kergon [Thu, 19 Nov 2009 19:53:58 +0000 (19:53 +0000)]
post-release

15 years ago.
Alasdair Kergon [Thu, 19 Nov 2009 19:42:57 +0000 (19:42 +0000)]
.

15 years agopre-release
Alasdair Kergon [Thu, 19 Nov 2009 19:00:34 +0000 (19:00 +0000)]
pre-release

15 years agoAdd a basic test for snapshots of mirrors, thanks to Jon Brassow.
Petr Rockai [Thu, 19 Nov 2009 13:55:40 +0000 (13:55 +0000)]
Add a basic test for snapshots of mirrors, thanks to Jon Brassow.

15 years agoIn case we refuse to continue due to missing PVs, print a hint about using
Petr Rockai [Thu, 19 Nov 2009 13:44:37 +0000 (13:44 +0000)]
In case we refuse to continue due to missing PVs, print a hint about using
vgreduce --removemissing to remedy the situation.

15 years agoThe double resume in remove_mirror_images does not happen *always*. Only call
Petr Rockai [Thu, 19 Nov 2009 13:42:38 +0000 (13:42 +0000)]
The double resume in remove_mirror_images does not happen *always*. Only call
memlock_inc() when it actually does happen.

15 years agoUn-export vg_read_internal.
Petr Rockai [Thu, 19 Nov 2009 12:13:37 +0000 (12:13 +0000)]
Un-export vg_read_internal.

15 years agoAdd a missing #include (fix compiler warning).
Petr Rockai [Thu, 19 Nov 2009 12:09:53 +0000 (12:09 +0000)]
Add a missing #include (fix compiler warning).

15 years agoFix the dmeventd LD_LIBRARY_PATH in the testsuite.
Petr Rockai [Thu, 19 Nov 2009 12:01:39 +0000 (12:01 +0000)]
Fix the dmeventd LD_LIBRARY_PATH in the testsuite.

15 years agoWhat's new.
Petr Rockai [Thu, 19 Nov 2009 01:17:01 +0000 (01:17 +0000)]
What's new.

15 years agoFix another bug in memlock handling, this time the "global" dmeventd memlock
Petr Rockai [Thu, 19 Nov 2009 01:11:57 +0000 (01:11 +0000)]
Fix another bug in memlock handling, this time the "global" dmeventd memlock
was preventing device scans in lvconvert --repair running from inside dmeventd.

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