]> sourceware.org Git - lvm2.git/log
lvm2.git
14 years agoShow a warning message when libudev not found and we're using --enable-udev_sync.
Peter Rajnoha [Mon, 11 Jan 2010 15:51:44 +0000 (15:51 +0000)]
Show a warning message when libudev not found and we're using --enable-udev_sync.

Just to emphasize what one can expect - we won't be able to get udev state
and we will consider that udev is not running at all.

14 years agoDefine {DM, LVM}_UDEV_DISABLE_CHECKING=1 env. variables for tests.
Peter Rajnoha [Mon, 11 Jan 2010 15:48:49 +0000 (15:48 +0000)]
Define {DM, LVM}_UDEV_DISABLE_CHECKING=1 env. variables for tests.

We need to disable udev checking for our tests since they use their own
location for device nodes and symlinks.

14 years agoEnable udev_sync and udev_rules in lvm.conf by default while running tests.
Peter Rajnoha [Mon, 11 Jan 2010 15:43:19 +0000 (15:43 +0000)]
Enable udev_sync and udev_rules in lvm.conf by default while running tests.

14 years agoAdd support to disable udev checking: LVM_UDEV_DISABLE_CHECKING=1 env. var.
Peter Rajnoha [Mon, 11 Jan 2010 15:40:03 +0000 (15:40 +0000)]
Add support to disable udev checking: LVM_UDEV_DISABLE_CHECKING=1 env. var.

LVM_UDEV_DISABLE_CHECKING=1 applies for /dev/<vgname> content only.
We still need to define DM_UDEV_DISABLE_CHECKING=1 for /dev/mapper content.

14 years agoAdd support to disable udev checking: DM_UDEV_DISABLE_CHECKING=1 env. variable.
Peter Rajnoha [Mon, 11 Jan 2010 15:36:24 +0000 (15:36 +0000)]
Add support to disable udev checking: DM_UDEV_DISABLE_CHECKING=1 env. variable.

Sometimes it is really needed to switch off udev checking and the warnings we show when
we detect that udev has not done its job right - the messages like "Udev should have done
this and that. Falling back to direct node creation/removal. " etc.

This would be especially handy while setting DM_DEV_DIR env var that could be set to a
different location than standard /dev (udev can't create nodes/symlinks out of that one
directory that is configured into udevd). The exact same situation happens while we're
running our tests.

14 years agoremove unused variable 'i' that was recently introduced in lv_add_segment
Mike Snitzer [Sun, 10 Jan 2010 20:44:09 +0000 (20:44 +0000)]
remove unused variable 'i' that was recently introduced in lv_add_segment

14 years agoupdate comment
Jonathan Earl Brassow [Fri, 8 Jan 2010 23:06:36 +0000 (23:06 +0000)]
update comment

14 years agoAdd the new mirror log type "redundant". The options are now:
Jonathan Earl Brassow [Fri, 8 Jan 2010 22:32:35 +0000 (22:32 +0000)]
Add the new mirror log type "redundant".  The options are now:
--mirrorlog core: in-memory log
--mirrorlog disk: persistent log
--mirrorlog redundant: redundant persistent log

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
14 years agoudpate WHATS_NEW file for --splitmirror checkin
Jonathan Earl Brassow [Fri, 8 Jan 2010 22:28:54 +0000 (22:28 +0000)]
udpate WHATS_NEW file for --splitmirror checkin

14 years agoThis patch adds the capability to split off a mirror legs.
Jonathan Earl Brassow [Fri, 8 Jan 2010 22:00:31 +0000 (22:00 +0000)]
This patch adds the capability to split off a mirror legs.
It is pretty much the same as reducing the number of
mirror legs, but we just don't delete them afterwards.

The following command line interface is enforced:
  prompt> lvconvert --splitmirror <n> -n <name> <VG>/<LV>
where 'n' is the number of images to split off, and
where 'name' is the name of the newly split off logical volume.

If more than one leg is split off, a new mirror will be the
result.  The newly split off mirror will have a 'core' log.
Example:
[root@bp-01 LVM2]# !lvs
lvs -a -o name,copy_percent,devices
  LV            Copy%  Devices
  lv            100.00 lv_mimage_0(0),lv_mimage_1(0),lv_mimage_2(0),lv_mimage_3(0)
  [lv_mimage_0]        /dev/sdb1(0)
  [lv_mimage_1]        /dev/sdc1(0)
  [lv_mimage_2]        /dev/sdd1(0)
  [lv_mimage_3]        /dev/sde1(0)
  [lv_mlog]            /dev/sdi1(0)
[root@bp-01 LVM2]# lvconvert --splitmirrors 2 --name split vg/lv /dev/sd[ce]1
  Logical volume lv converted.
[root@bp-01 LVM2]# !lvs
lvs -a -o name,copy_percent,devices
  LV               Copy%  Devices
  lv               100.00 lv_mimage_0(0),lv_mimage_2(0)
  [lv_mimage_0]           /dev/sdb1(0)
  [lv_mimage_2]           /dev/sdd1(0)
  [lv_mlog]               /dev/sdi1(0)
  split            100.00 split_mimage_0(0),split_mimage_1(0)
  [split_mimage_0]        /dev/sde1(0)
  [split_mimage_1]        /dev/sdc1(0)

It can be seen that '--splitmirror <n>' is exactly the same
as '--mirrors -<n>' (note the minus sign), except there is the
additional notion to keep the image being detached from the
mirror instead of just throwing it away.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
14 years agoChange background polldaemon's process name to "(lvm2)".
Mike Snitzer [Fri, 8 Jan 2010 21:53:07 +0000 (21:53 +0000)]
Change background polldaemon's process name to "(lvm2)".

Made .update_metadata optional in 'struct poll_functions' definitions;
eliminated _update_lvconvert_mirror() stub.

Tweak a mirror-specific error message in the generic polldaemon code.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
14 years agoAllow vgremove of a VG with PVs missing.
Petr Rockai [Fri, 8 Jan 2010 14:03:54 +0000 (14:03 +0000)]
Allow vgremove of a VG with PVs missing.

14 years agoIn lvconvert --repair --use-policies, for the allocate policies, return success
Petr Rockai [Fri, 8 Jan 2010 13:04:10 +0000 (13:04 +0000)]
In lvconvert --repair --use-policies, for the allocate policies, return success
even if allocation fails, as long as the downconversion or corelog conversion
succeeded.

14 years agoorig_status preserves 64bit status.
Zdenek Kabelac [Fri, 8 Jan 2010 10:50:11 +0000 (10:50 +0000)]
orig_status preserves 64bit status.

14 years ago- forgot to update WHATS_NEW along with bug fix for keeping
Jonathan Earl Brassow [Thu, 7 Jan 2010 20:55:01 +0000 (20:55 +0000)]
- forgot to update WHATS_NEW along with bug fix for keeping
  log type consistent when using lvconvert to change the
  number of mirror images.

14 years agoThe patch fixes some lvconvert issues (WRT mirror <-> mirror).
Jonathan Earl Brassow [Thu, 7 Jan 2010 20:42:55 +0000 (20:42 +0000)]
The patch fixes some lvconvert issues (WRT mirror <-> mirror).

The default log option for a mirror is 'disk'.  If the log
type is not explicitly stated on the command line when
converting from an X-way mirror to a Y-way mirror, 'disk'
is chosen.  So, if you have a 'core' log mirror and you
convert, your result will contain a 'disk' log.

This patch remembers what the old log type was.  If the
user is merely trying to switch the number of mirror
images, the log type is now kept the same.

There is one historical behaviour I left in place...
If you have a 2-way, core-log mirror and you use lvconvert to
specify you want a 2-way mirror - without specifying the
log type - you will get a 2-way, disk-log mirror.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Informal-IRC-ACK-by: agk
14 years agoAlways set environment variables for an LVM2 device in 11-dm-lvm.rules.
Peter Rajnoha [Thu, 7 Jan 2010 20:01:55 +0000 (20:01 +0000)]
Always set environment variables for an LVM2 device in 11-dm-lvm.rules.

This way we can still use DM_LV_NAME, DM_VG_NAME and DM_LV_LAYER in all
the other rules.

14 years agoAdd activation/udev_rules config option in lvm.conf.
Peter Rajnoha [Thu, 7 Jan 2010 19:54:21 +0000 (19:54 +0000)]
Add activation/udev_rules config option in lvm.conf.
Add dm_tree_add_dev_with_udev_flags to provide wider support for udev flags.

14 years agoAdd --noudevrules option for dmsetup to disable /dev node management by udev.
Peter Rajnoha [Thu, 7 Jan 2010 19:45:12 +0000 (19:45 +0000)]
Add --noudevrules option for dmsetup to disable /dev node management by udev.

14 years agoAdd few const modifiers.
Zdenek Kabelac [Thu, 7 Jan 2010 14:47:57 +0000 (14:47 +0000)]
Add few const modifiers.

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!

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