1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00
Commit Graph

1603 Commits

Author SHA1 Message Date
Milan Broz
c493f56e1b Document undocumented commits which fixed some bugs.
Go WHATS_NEW!
2010-01-22 14:33:33 +00:00
Milan Broz
c40380f72a Move error message to locking constructor and print
more descriptive message if locking fails instead of
"Locking type -1 initialisation failed."

Use read-only locking instead of misleading ignorelocking option
in message.
2010-01-22 09:45:29 +00:00
Alasdair Kergon
8e44e884a2 post-release 2010-01-22 01:09:09 +00:00
Alasdair Kergon
6107f4a02a pre-release 2010-01-21 23:55:17 +00:00
Alasdair Kergon
2ce63814e9 Add libdevmapper-event-lvm2.so to serialise dmeventd plugin liblvm2cmd use. 2010-01-21 22:15:45 +00:00
Dave Wysochanski
8ba508f8f7 Call _alloc_pv() inside _pv_read() and clean up error paths.
We should be consistent with pv constructors so call _alloc_pv()
here as we do from pv_create().
2010-01-21 21:09:23 +00:00
zkabelac
3555d0ecd5 Log entry for the last lvmcmdline.c commit 2010-01-21 17:14:18 +00:00
Mike Snitzer
f6d5837e5e Add t-topology-support.sh and t-snapshot-merge.sh tests. 2010-01-19 23:02:04 +00:00
Milan Broz
1fb910411e Never scan suspended devices in clvmd.
For mirror repair (and similar tasks) it can happen that full
device rescan is issued from clvmd.

Because code can be in the middle of repair (calling suspend)
clvmd should never try to scan suspended devices
(otherwise it causes deadlock).

Also code must not change ignore_suspended_device flag when
doing refresh_filters (called from lvmcache scan code).
2010-01-19 13:25:00 +00:00
Jonathan Earl Brassow
938b25b986 Initial version of the cmirrord init script
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 20:47:52 +00:00
Jonathan Earl Brassow
040b76f1e6 initial cmirrord man page
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 20:24:04 +00:00
Jonathan Earl Brassow
66226207ce Make the intermachine communication structures architecture independant
to allow for mixed architecture clusters.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 19:49:35 +00:00
Jonathan Earl Brassow
999b4168c1 When moving the cluster log server into the LVM tree, the in memory
bitmap tracking was switched from the e2fsprogs implementation to
the device-mapper implementation (dm_bitset_t).  The latter has a
leading uin32_t field designed to hold the number of bits that are
being tracked.  The code was not properly handling this change in
all places.  Specifically, when getting the bitmap to/from disk.

Endian adjustments will likely need to be made on the accounting
field as well, since bitmaps are passed between machines on
start-up.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 18:48:24 +00:00
Mike Snitzer
df675ed9fb Improve target type compatibility checking in _percent_run().
Add 'target_status_compatible' method to 'struct segtype_handler'.
2010-01-15 16:35:26 +00:00
Jonathan Earl Brassow
4a13ae4c95 udpate WHATS_NEW* 2010-01-15 16:18:14 +00:00
Alasdair Kergon
f6d95e19c4 post-release 2010-01-14 14:42:06 +00:00
Alasdair Kergon
801eff0c52 pre-release 2010-01-14 14:02:34 +00:00
zkabelac
c1993e76c2 Update entry for few previous gcc cleanup commits. 2010-01-14 10:19:43 +00:00
Mike Snitzer
b4affd607d update WHATS_NEW and WHATS_NEW_DM to include snapshot-merge changes 2010-01-13 21:48:39 +00:00
Milan Broz
c7007c98d7 Fix clvmd automatic target module loading crash. 2010-01-13 17:40:17 +00:00
Alasdair Kergon
4e09e6ca10 Fix allocation code not to stop at the first area of a PV that fits.
This spurious 'break' has been here since this code was first committed
in June 2005 and stopped the algorithm behaving as described in the
comment above it and rendered the variable 'already_found_one' useless.
2010-01-12 20:53:20 +00:00
Alasdair Kergon
af6dd44048 post-release 2010-01-12 14:46:59 +00:00
Alasdair Kergon
d30ec9fd1e pre-release 2010-01-12 14:39:07 +00:00
Alasdair Kergon
627409ec38 Revert so-called "redundant" log until after next release. 2010-01-12 14:00:51 +00:00
Alasdair Kergon
42783a54db Add missing items to WHATS_NEW files.
Continue to use 'field' to describe reporting elements.
2010-01-11 21:28:04 +00:00
Peter Rajnoha
8b70a0d0b7 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.
2010-01-11 15:40:03 +00:00
Jonathan Earl Brassow
82b34e06f2 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>
2010-01-08 22:32:35 +00:00
Jonathan Earl Brassow
bc178df8f0 udpate WHATS_NEW file for --splitmirror checkin 2010-01-08 22:28:54 +00:00
Mike Snitzer
b8774d7aac 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>
2010-01-08 21:53:07 +00:00
Petr Rockai
891246562f Allow vgremove of a VG with PVs missing. 2010-01-08 14:03:54 +00:00
Jonathan Earl Brassow
e896691b0f - forgot to update WHATS_NEW along with bug fix for keeping
log type consistent when using lvconvert to change the
  number of mirror images.
2010-01-07 20:55:01 +00:00
Peter Rajnoha
94a434e9e7 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.
2010-01-07 20:01:55 +00:00
Peter Rajnoha
e829c626da Add activation/udev_rules config option in lvm.conf.
Add dm_tree_add_dev_with_udev_flags to provide wider support for udev flags.
2010-01-07 19:54:21 +00:00
zkabelac
b3975f5098 Export function out_text_with_comment() and add outfc() macro that checks
for error.
2010-01-07 14:45:28 +00:00
zkabelac
b90f909289 Add macros outsize() for out_size() and outhint() for out_hint() that check
for errors in a similar way as outf() for out_text().
2010-01-07 14:40:46 +00:00
zkabelac
d098e4def6 Use offsetof() macro and avoid defining dummy static union for FIELD() macro.
Makes it compilable by clang compiler.
2010-01-07 14:37:11 +00:00
Milan Broz
6f5e1c3d73 Rename mirror_device_fault_policy to mirror_image_fault policy 2010-01-06 13:27:06 +00:00
Milan Broz
d4421b12ba 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.)
2010-01-06 13:26:21 +00:00
Milan Broz
099b03f038 Use fixed buffer to prevent stack overflow in persistent filter dump. 2010-01-06 13:25:36 +00:00
Mike Snitzer
f84d2eeec9 update WHATS_NEW and WHATS_NEW_DM with previous commits' changes 2010-01-05 21:32:59 +00:00
Mike Snitzer
f02531802c 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>
2010-01-05 21:14:04 +00:00
Mike Snitzer
7a4fa925fc 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>
2010-01-05 20:56:51 +00:00
Milan Broz
ff442c1e28 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.
2010-01-05 16:09:33 +00:00
Milan Broz
5cedaa972a 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.
2010-01-05 16:07:56 +00:00
Milan Broz
2c8f647e0c 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.
2010-01-05 16:06:42 +00:00
Milan Broz
3be5edae0e Move processing of VG locks to separate function (similar to LV locks).
And print some debugging info.

No functional change in this patch.
2010-01-05 16:05:12 +00:00
Milan Broz
1078f24d5a 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).
2010-01-05 16:03:37 +00:00
Milan Broz
c02cc5321a 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).
2010-01-05 16:01:22 +00:00
Milan Broz
e60a7ff1d0 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.)
2010-01-05 15:58:11 +00:00
Milan Broz
ec4daa5936 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.
2009-12-18 12:45:41 +00:00
Milan Broz
2743fb9771 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.
2009-12-18 12:44:20 +00:00
zkabelac
abc760c8e4 Destroy allocated mempool in _vg_read_orphans() error path. 2009-12-11 13:14:44 +00:00
zkabelac
0331a34d58 Fix unlocking vg in some pvresize and toollib error paths. 2009-12-11 13:11:56 +00:00
Milan Broz
448e4251f8 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.)
2009-12-09 19:53:39 +00:00
Milan Broz
a3c8fbc6b6 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).
2009-12-09 19:29:04 +00:00
Milan Broz
e9dc6880af Add memlock information to do_lock_lv debug output.
This helps a lot to detect that something strange happened.
2009-12-09 19:01:27 +00:00
Milan Broz
25fb2c4fb6 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.)
2009-12-09 19:00:16 +00:00
Milan Broz
97d28ae4d7 Allow implicit lock conversion for pre/post callbacks.
This is unnoticed regression from commit 31672ff60e

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.
2009-12-09 18:55:53 +00:00
Milan Broz
b5bad15dae 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.
2009-12-09 18:45:12 +00:00
Milan Broz
3098ef4a6e 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)
2009-12-09 18:42:02 +00:00
Milan Broz
0a22655ff3 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.
2009-12-09 18:09:52 +00:00
Peter Rajnoha
523a7ed7d3 WHATS_NEW for previous commit. 2009-12-04 14:26:22 +00:00
Milan Broz
3516797b49 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.
2009-12-03 19:23:40 +00:00
Milan Broz
1683e94f0c Fix pvmove test mode to not fail and do not poll.
Test mode should not fail nor try to poll non-existent devices.
2009-12-03 19:22:24 +00:00
Milan Broz
1d249195a4 Print error if VG already exist.
This test have to be moved because of new vg read error handling.
2009-12-03 19:20:48 +00:00
Milan Broz
2f7ee08288 Fix tools to report error when stopped by user.
(And do not produce internal error message.)
2009-12-03 19:18:33 +00:00
Dave Wysochanski
5818b6efb8 Add tests to check for readahead value in lvcreate. 2009-12-03 01:48:05 +00:00
Milan Broz
b17ddc26c0 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.
2009-12-01 19:10:23 +00:00
Milan Broz
6074f58641 Do not allow creating mirrors of more than 8 images.
This is kernel limitation in all kernel versions,
so better detect this early.
2009-11-27 14:35:38 +00:00
Milan Broz
48de09c279 Use locking_type 3 (compiled in cluster locking) in lvmconf. 2009-11-27 14:32:16 +00:00
Dave Wysochanski
032c2cb462 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.
2009-11-25 20:44:07 +00:00
Alasdair Kergon
2008367883 Log failure type and recognise type 'F' (flush) in dmeventd mirror plugin. 2009-11-25 15:59:07 +00:00
Mike Snitzer
165d88cfd8 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.
2009-11-24 22:55:55 +00:00
Alasdair Kergon
0c0e1fbbeb Post-release.
Fingers crossed this one's more successful that the last one!
2009-11-24 19:04:23 +00:00
Alasdair Kergon
3559e20dab . 2009-11-24 18:54:23 +00:00
Alasdair Kergon
e400f6eab9 pre-release 2009-11-24 18:26:08 +00:00
Milan Broz
cffffe0c2e Add missing vg_release to pvs and pvdisplay to fix memory leak. 2009-11-24 17:07:09 +00:00
Milan Broz
70fcdb495a 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
2009-11-24 16:13:02 +00:00
Milan Broz
c1b2049df9 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.
2009-11-24 16:11:37 +00:00
Milan Broz
f6cabc78c0 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.
2009-11-24 16:10:25 +00:00
Milan Broz
b8526452b5 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.)
2009-11-24 16:08:49 +00:00
Milan Broz
a1cefb3e17 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).
2009-11-23 10:55:14 +00:00
Milan Broz
def0f38f3d Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55) 2009-11-23 10:44:50 +00:00
Alasdair Kergon
58a8b00086 post-release 2009-11-19 19:53:58 +00:00
Alasdair Kergon
50a27398b0 . 2009-11-19 19:42:57 +00:00
Alasdair Kergon
eab7cba1f3 pre-release 2009-11-19 19:00:34 +00:00
Petr Rockai
7c79b1c7c5 What's new. 2009-11-19 01:17:01 +00:00
Milan Broz
ee4eb0aa6f Never activate hidden volumes directly in vgchange.
All hidden (not visible) volumes should be activated through
other visible volumes.

(There are already exceptions like snapshot, mirror log and image,
which should be cleaned one day...)

This solves problems for future types of hidden volumes,
which can have special meaning and must not be activated implicitly
(e.g. key store volume).
2009-11-18 17:20:18 +00:00
Milan Broz
07e27cac02 Fix pvmove region_size overflow for very large PVs.
Fixes problem reported in
https://www.redhat.com/archives/dm-devel/2009-November/msg00104.html

The region size multiplication can overflow when using 32bit integer.
2009-11-18 16:48:10 +00:00
Milan Broz
16d385ac6a Fix lvcreate processing of %PVS argument.
- fix missing unlocking of VG
lvcreate -l 100%PVS -n lv1 vg_test
  Please specify physical volume(s) with %PVS
  Internal error: Volume Group vg_test was not unlocked

- if no PVS specified, use all available

Fix segfault if %PVS in lvresize without PVs list.
2009-11-04 14:47:27 +00:00
Alasdair Kergon
44e1f095d1 Tidy some uses of arg_count and introduce arg_is_set. 2009-11-03 15:50:42 +00:00
zkabelac
90c39b8371 Update for outnl and indent functions 2009-11-03 11:17:46 +00:00
zkabelac
bbf486f890 Add fflush for the case the log is redirected to the buffered file.
Without this patch it have not been obvious, why the application
waits on the stdin as the prompt might be still buffered in memory.
2009-11-03 10:50:57 +00:00
Dave Wysochanski
3f74391b87 Update vgsplit to call vg_set_clustered(). 2009-10-31 17:43:57 +00:00
Alasdair Kergon
9abd966a80 Insert some missing stack macros into activation code. 2009-10-30 13:07:49 +00:00
Milan Broz
a1dbd7156c Recognise DRBD device part and handle it similar to MD devices.
The DRBD uses underlying device so code should prefer top
device if duplicate is found.

Patch also introduce
        dev_subsystem_part_major and dev_subsytem_name
functions to easily handle all these replication susbystems
and not hardcode md_major call.

See https://bugzilla.redhat.com/show_bug.cgi?id=530881
for full problem description.
2009-10-27 17:00:44 +00:00
Alasdair Kergon
b74e5b870c post-release 2009-10-27 01:13:20 +00:00
Alasdair Kergon
bcb021296f . 2009-10-27 00:52:45 +00:00
Alasdair Kergon
972b11e39e pre-release 2009-10-26 21:56:23 +00:00
Dave Wysochanski
963cf98df1 Document --all option in man pages, cleanup {pv|vg|lv}{s|display} man pages.
Option --all is only partially documented currently, so document in all
commands.  Also make {pv|vg|lv}{display|s} man pages consistent with help
output.  Remove ununsed 'disk_ARG' parameter.  Leave --trustcache out of
the man page output.  Update --units argument to show all possible units.
2009-10-26 14:37:09 +00:00
Alasdair Kergon
2d1118a26f Permit snapshots of mirrors. (brassow) 2009-10-26 10:01:56 +00:00
Alasdair Kergon
3f647cdf32 Cleanup mimagetmp LV if allocation fails for new lvconvert mimage. 2009-10-23 01:24:17 +00:00
Alasdair Kergon
9a0dc6d522 Fix clvmd segfault when refresh_toolcontext fails. (brassow, bz 506986) 2009-10-22 17:45:23 +00:00
Alasdair Kergon
c819525e81 Remember to clear 'global lock held during cache refresh' state after use. 2009-10-22 17:33:09 +00:00
Peter Rajnoha
9359586fde Use udev flags support in LVM and provide dm_tree_add_new_dev_with_udev_flags wrapper for dm_tree_add_new_dev. 2009-10-22 13:00:07 +00:00
Alasdair Kergon
6a00ceeb66 . 2009-10-22 11:25:46 +00:00
Petr Rockai
02a2afb64f Handle metadata with unknown segment types more gracefully. 2009-10-16 17:41:49 +00:00
fabbione
f042834068 configure.in: don't set default file owner and group
Per discussion on lvm-devel mailing list and part of debian patch set,
don't set defaults for owner and group, since nobody seems to use them, and
still allow override.
2009-10-14 04:10:41 +00:00
Alasdair Kergon
63130374b9 Attempt to build dmeventd.static. 2009-10-13 02:35:26 +00:00
fabbione
6f751afae4 Disable realtime support by default.
This code is used only in a under development feature and it's not used
anywhere in the tree.

Allow to build it conditionally.
2009-10-12 16:59:20 +00:00
Christine Caulfield
8fd85fb6e6 Make clvmd return 0 on success rather than 1. 2009-10-12 08:33:30 +00:00
Dave Wysochanski
4257485ff2 Add --pvmetadatacopies as a synonym for --metadatacopies in various commands.
Going forward, we would like to allow users to specify the total
number of metadatacopies in a VG rather than on a per-PV basis.  In
order to facilitate that, introduce --pvmetadatacopes to replace
--metadatacopies everywhere.  We still allow --metadatacopies for
pv commands, but require --pvmetadatacopies for vg commands.
Eventually we will introduce --vgmetadatacopies.  Once we do that,
we should either deprecate --metadatacopies or make it a synonym based
on the command (pvmetadatacopies for pv commands, and vgmetadatacopies
for vg commands).  The latter option would likely just require a simple
'strncpy' check against cmd->command->name to qualify the merge_synonym
call.

Update nightly tests to cover the pvmetadatacopies synonym.

Note that this patch is the result of an eariler review comment for
the implicit pvcreate patches.  Should apply cleanly on top of the
implicit pvcreate patches (I applied after patch 10/10 in that series).

NOTE: This patch will require --pvmetadatacopies for vgconvert as
--metadatacopies is no longer accepted.
2009-10-05 20:55:56 +00:00
Dave Wysochanski
930820b738 Add implicit tests for implicit pvcreate during vgcreate and vgextend.
Update tests and WHATS_NEW for implicit pvcreate support.
2009-10-05 20:04:40 +00:00
Alasdair Kergon
1ddcf370a7 Correct example.conf to indicate that lvm2 not lvm1 is the default format.
Remove an unused stray LVM1_SUPPORT ifdef.
2009-10-05 12:44:20 +00:00
Alasdair Kergon
e0559e4fda Only include selinux libs in libdevmapper.pc when selinux build enabled. 2009-10-05 12:11:30 +00:00
Alasdair Kergon
eeefbfd38d Allow for a build directory separate from the source. 2009-10-02 19:10:31 +00:00
Zdeněk Kabeláč
60ba4943ec Update distclean target for rename clogd to cmirrord. (2.02.52) 2009-10-02 11:41:54 +00:00
Christine Caulfield
31672ff60e Stop clvmd from automatically doing lock conversions. Now, if a lock
is granted at one mode and an attempt to convert it wthout the LCK_CONVERT
flag set then it will return errno=EBUSY.

This fixes a pretty bad bug in which an LV could be activated exclusively on
one node and lvchange -ay on another would convert it to shared!

It might break some things in other areas, but I doubt it.
2009-10-01 14:14:17 +00:00
Alasdair Kergon
2ccdb165e3 Introduce percent_range_t and centralise snapshot full/mirror in-sync checks. 2009-10-01 00:35:29 +00:00
Alasdair Kergon
4e2e8954dc Factor out poll_mirror_progress and introduce progress_t. 2009-09-30 17:43:51 +00:00
Alasdair Kergon
bce3ac2c73 Distinguish between powers of 1000 and powers of 1024 in unit suffixes. 2009-09-30 14:19:00 +00:00
Alasdair Kergon
08b540dd78 look up pvmove by pvmove LV when PVMOVE flag is set 2009-09-29 20:33:49 +00:00
Alasdair Kergon
22e91979bb Don't attempt to restart pvmoves when deactivating LVs in vgchange.
Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
2009-09-29 20:22:35 +00:00
Alasdair Kergon
e3730ecfc3 Generalise polldaemon code by changing mirror-specific variable names. 2009-09-29 19:35:26 +00:00
Alasdair Kergon
9cfc9b3ee2 Don't attempt to deactivate an LV if any of its snapshots are in use. 2009-09-29 18:50:28 +00:00
Milan Broz
c0ff3805c8 Return fail if lv_deactivate did not removed device from kernel.
lv_deactivate now returns always success, because tree deactivation
functions (see dm_tree_deactivate_children) always returns success.

Because code should return failure in lv_deactivate at least,
fix it by checking for device existence after real deactivation call.

(After discussion this was prefered solution to dm tree function rewrite
which affects snapshots and mirrors.)
2009-09-29 15:17:54 +00:00
Alasdair Kergon
79bcc98e9b Provide alternative implementation of obsolete siginterrupt(). 2009-09-28 21:23:02 +00:00
Alasdair Kergon
a58980fe82 Consolidate LV allocation into alloc_lv(). 2009-09-28 17:46:15 +00:00
Alasdair Kergon
fe67a86a5f Treat input units of both 's' and 'S' as 512-byte sectors. (2.02.49)
's' and 'S' are special suffixes representing sectors and are always 512 bytes,
regardless of whether you're using powers of 1000 or 1024.
2009-09-28 16:36:03 +00:00
Alasdair Kergon
4d85bb13d1 Add global/si_unit_consistency to enable cleaned-up use of units in output.
Add configure --enable-units-compat to set si_unit_consistency off by default.

Use standard output units for 'PE Size' and 'Stripe size' in pv/lvdisplay.
2009-09-28 16:23:44 +00:00
Alasdair Kergon
0501c06745 post-release 2009-09-26 00:42:47 +00:00
Alasdair Kergon
0670c8f60f pre-release 2009-09-25 18:30:27 +00:00
Alasdair Kergon
dfdcb92f3d pre-release 2009-09-25 18:30:26 +00:00
Alasdair Kergon
47c0c71e19 Fix dmeventd _temporary_log_fn parameters. (2.02.50) 2009-09-17 10:37:23 +00:00
Alasdair Kergon
7d26a86071 Enable dmeventd monitoring section of config file by default. 2009-09-16 23:48:41 +00:00
Alasdair Kergon
4ee50ed6de Update lvm2_monitoring script. 2009-09-16 23:22:40 +00:00
Dave Wysochanski
b1b5a9d8fa Fix lvm2app test to run under test/api subdirectory only when configured. 2009-09-15 19:59:04 +00:00
Dave Wysochanski
62d8848bee Add vg_is_resizeable() and cleanup references.
Clean up VG_RESIZEABLE flag by creating vg_is_resizeable().
Update comment - we no longer have ALLOW_RESIZEABLE.
Also use vg_is_exported() in one place missed by earlier patch.
Should be no functional change.
2009-09-15 18:35:13 +00:00
Alasdair Kergon
d32a6f15bf post-release 2009-09-15 13:54:28 +00:00
Alasdair Kergon
918abadb6c pre-release cleanup 2009-09-15 13:49:10 +00:00
Alasdair Kergon
b1ce301520 dm release cleanup 2009-09-15 11:41:38 +00:00
Alasdair Kergon
cd93201e46 pre-release 2009-09-15 10:57:16 +00:00
Dave Wysochanski
c9aaf5fb24 Fix process_each_vg / _process_one_vg when vg_read() returns FAILED_LOCKING.
Remove the checks for vg_read_error() in most of the tools callback
functions and instead make the check in _process_one_vg() more general.

In all but vgcfgbackup, we do not want to proceed if we get any error
from vg_read().  In vgcfgbackup's case, we may proceed if the backup
is to proceed with inconsistent VGs.  This is a special case though,
and we mark it with the READ_ALLOW_INCONSISTENT flag passed to
process_each_vg (and subsequently to _process_one_vg).

NOTE: More cleanup is needed in the vg_read_error() path cases.
This patch is a start.
2009-09-15 01:38:59 +00:00
Alasdair Kergon
013f27e3e6 Add lots of missing stack debug messages to tools.
Make readonly locking available as locking type 4.
Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
2009-09-14 22:47:49 +00:00
Peter Rajnoha
10019a9d96 Add manpage entry for dmsetup's udevcomplete_all and udevcookies commands. 2009-09-11 16:06:31 +00:00
Peter Rajnoha
4515bcf289 Several changes in udev rules:
- add DM_UDEV_RULES_VSN to provide a variable to be checked for in the other
  rules (e.g. to check that DM rules are actually installed, we can alternate
  functionality in the other rules based on this information, also we have
  versioning support for the rules)
- set proper sbin path for dmsetup and blkid, /sbin first, then /usr/sbin.
  This is necessary for anaconda to work properly.
- add 'last_rule' for cryptsetup's temporary devices (symlinks in /dev/mapper
  only)
2009-09-11 16:05:20 +00:00
Peter Rajnoha
f2d3b3661b Check that udev is running and set internal state appropriately. 2009-09-11 15:56:06 +00:00
Peter Rajnoha
24b598b1be Add libudev configuration check. 2009-09-11 15:55:07 +00:00
Dave Wysochanski
dd9f42172f Add lvm2app.sh to nightly testsuite.
More tests to come but for now just call into vgtest.
Fix warning in vgtest.c
2009-09-04 12:54:23 +00:00
Dave Wysochanski
202aea4dda Update lvm_vg_write() to handle the deferred commit of lvm_vg_write().
Now that we've refactored the internal library functions that do the
vg_remove, we can handle the deferred commit of a lvm_vg_remove() inside
lvm_vg_write().  This makes the VG create/remove API more consistent in
terms of disk commits - they now both require an lvm_vg_write() to commit
the create or remove to disk.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:40:10 +00:00
Dave Wysochanski
a9851f5e95 Enforce an alphabetical lock ordering for vgname locks.
Add a new constraint that vgname locks must be obtained in
alphabetical order.  At this point, we have test coverage for
the 3 commands affected - vgsplit, vgmerge, and vgrename.
Tests have been updated to cover these commands.
Going forward any command or library call that must obtain
more than one vgname lock must do so in alphabetical order.
Future patches will update lvm2app to enforce this ordering.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:34:11 +00:00
Petr Rockai
a859e44630 Implement write lock prioritisation for file locking and make it default. 2009-09-02 14:47:39 +00:00
fabbione
1c1a248277 Fix cmirrod build directory while we wait to do a proper rename of the
directory and move files.
2009-09-02 11:49:03 +00:00
fabbione
e0e2165c8e Drop clogd Makefile from CVS since it's always autogenerated from Makefile.in
at configure time.
2009-09-01 19:13:38 +00:00
fabbione
957f8315e3 Fix --with-clvmd=all to deal with the case where no cluster managers are available.
Also simplify the check by removing an unnecessary variable and update
configure messages.
2009-09-01 19:11:45 +00:00
fabbione
d279ed7dd6 Remove unwanted Makefiles and don't purge lvm2.po that's
under RCS.
2009-09-01 18:11:14 +00:00
Christine Caulfield
827480b9d6 Add some code to clvmd to look in the corosync confdb to see what cluster
interface it should be using, it can still be overriden with -I.

If corosync isn't running or there is no information then the usual
checking will happen.

This code only builds if corosync is available.
2009-09-01 09:48:01 +00:00
Alasdair Kergon
1a0af097a6 change clogd to cmirrord
make pidfile locn configurable
2009-08-28 20:51:40 +00:00
Alasdair Kergon
d408fc2864 Rewrite clvmd configuration code. 2009-08-28 19:22:05 +00:00
Milan Broz
352f7d7f2b Fix global locking in PV reporting commands (2.02.49). 2009-08-24 11:37:20 +00:00
Milan Broz
0f07768d6b Fix uuid warning in pvcreate to use terminated (and dash formatted) UUID string.
# pvcreate -u udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi /dev/sdc
   uuid udwxr7BoKYEeKMr033xK6o4og7F13sGi|��� already in use on "/dev/sdb1"
 is now
# pvcreate -u udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi /dev/sdc
   uuid udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi already in use on "/dev/sdb1"
2009-08-20 07:03:02 +00:00
snitzer
a6a2be6e37 Fix pvcreate on a partition (regressed in 2.02.51).
Eliminate busy loop during pvcreate of a "normal" partition.
_md_sysfs_attribute_snprintf() would busy loop if the device it was
given was not a blkext-based MD partition.

Rather than being cute with a busy-loop prone 'goto check_md_major' in
_md_sysfs_attribute_snprintf(): explicitly check if the provided device
is a blkext-based partition (blkext_major()); and then check that the
get_primary_dev() determined parent is an MD device (md_major()).
2009-08-19 15:34:33 +00:00
Dave Wysochanski
f0153d801e Fix error paths for vgcfgrestore when locking fails. 2009-08-13 17:16:38 +00:00
Jonathan Earl Brassow
319b2d8f32 update WHATS_NEW 2009-08-13 16:36:49 +00:00
Petr Rockai
2997acf9dc Make lvchange --refresh only take a read lock on volume group. 2009-08-13 14:27:32 +00:00
Petr Rockai
1ee9677b8a Refactor file locking, lifting the flock wrapper code into separate
functions. Also fixes a bug, where a nonblocking lock could, in certain race
situations, succeed without actually obtaining the lock.
2009-08-13 13:23:51 +00:00
Dave Wysochanski
9c14c897f5 Update WHATS_NEW 2009-08-13 12:19:30 +00:00
Dave Wysochanski
1e1b8cc2d5 Update WHATS_NEW for recent checkins. 2009-08-13 12:04:01 +00:00
Christine Caulfield
1a0d994305 Fix compilation warning in clvmd.c 2009-08-13 10:39:41 +00:00
Alasdair Kergon
f93a548fe2 post-release 2009-08-06 19:32:26 +00:00
Alasdair Kergon
84b0920fe0 pre-release 2009-08-06 17:08:01 +00:00
Christine Caulfield
cecc0e9dc8 Fix locking in clvmd
The changes to remove LCK_NONBLOCK from the LVM locks broke clvmd because the
code was clearly wrong but working anyway! The constant was being masked rather
than the variable that was supposed to match against it.
2009-08-05 14:18:35 +00:00
Peter Rajnoha
7972728e7c Add --noudevsync option for relevant LVM tools. 2009-08-04 15:55:43 +00:00
Alasdair Kergon
b2155fde1a Add activation/udev_sync to lvm.conf. 2009-08-04 15:36:13 +00:00
Alasdair Kergon
dc4e40a2f6 Only create LV symlinks on ACTIVATE not PRELOAD.
(This is the udev behaviour - but does this change break anything?)
2009-08-03 18:09:25 +00:00
Petr Rockai
d77b03d6c9 Make lvconvert honour log mirror options combined with downconversion.
(RHBZ 463272)
2009-08-02 21:59:21 +00:00
Petr Rockai
d5ef8e037d Allow LV suspend while --ignorelockingfailure is in force. 2009-08-02 21:03:09 +00:00
Petr Rockai
fd09a32d5e Update synopsis in lvconvert manpage to mention --repair. 2009-08-02 21:01:51 +00:00
snitzer
4422423315 Add devices/data_alignment_detection to lvm.conf.
Adds 'data_alignment_detection' config option to the devices section of
lvm.conf.  If your kernel provides topology information in sysfs (linux
>= 2.6.31) for the Physical Volume, the start of data area will be
aligned on a multiple of the ’minimum_io_size’ or ’optimal_io_size’
exposed in sysfs.

minimum_io_size is used if optimal_io_size is undefined (0).  If both
md_chunk_alignment and data_alignment_detection are enabled the result
of data_alignment_detection is used.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-08-01 17:08:43 +00:00
snitzer
6c88b6c660 Add devices/data_alignment_offset_detection to lvm.conf.
If the pvcreate --dataalignmentoffset option is not specified the start
of a PV's aligned data area will be shifted by the associated
'alignment_offset' exposed in sysfs (unless
devices/data_alignment_offset_detection is disabled in lvm.conf).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-08-01 17:07:36 +00:00
Alasdair Kergon
39270f9647 Set cookies in activation code and wait for udev to complete processing. 2009-07-31 18:30:31 +00:00
Alasdair Kergon
3b6a147653 Add udevcomplete and --noudevwait to dmsetup. 2009-07-31 17:51:45 +00:00
Alasdair Kergon
dfed228991 Add libdevmapper functions to support synchronisation with udev. 2009-07-31 15:53:11 +00:00
Alasdair Kergon
ec76533493 configure --udevdir 2009-07-31 13:31:53 +00:00
Alasdair Kergon
709e1afd31 Prepare for udev synchronisation code. (options don't work yet) 2009-07-31 11:49:53 +00:00
snitzer
217bbd0dcb Disable the "new pe_start policy"
Documented which use-cases force the reinstatement of the nuanced
handling of pe_start.  As soon as orphan PVs are eliminated much of this
will no longer be a concern ('preserve_pe_start' can be reenabled in
.pv_setup).

Added defensive 'if (pv->pe_align)' check in _text_pv_write()'s pe_start
loop.
2009-07-30 21:15:17 +00:00
snitzer
e32f9edc3d Revert 'preserve_pe_start' related code in _text_pv_setup
If pv_setup was given a non-zero pe_start it would short-circuit
establishing a default pv->pe_align.  pv->pe_align=0 would result
in a divide by zero in _mda_setup().  'vgconvert -M2 $vgname' hit this.

.pv_write still properly preserves pe_start if it was supplied.
2009-07-30 18:40:22 +00:00
snitzer
282029eb45 Add --dataalignmentoffset to pvcreate to shift start of aligned data area
Adds pe_align_offset to 'struct physical_volume'; is initialized with
set_pe_align_offset().  After pe_start is established pe_align_offset is
added to it.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:45:28 +00:00
snitzer
0ae88174b8 Preserve pe_start in .pv_setup and .pv_write if pe_start was supplied.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:42:33 +00:00
snitzer
48416fcdc1 Fix _mda_setup() to not check first mda's size before pe_align rounding.
Without this fix rounding the end of the first mda to a pe_align
boundary could silently exceed the disk_size.

Final 'if (start1 + mda_size1 > disk_size)' block serves as a safety
net.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:19:31 +00:00
snitzer
5dab79f1c7 Formalize pe_start policy as split between .pv_setup and .pv_write.
Document existing pe_start policy.
Fix issue in _text_pv_setup() where existing pe_start case could have
the pv->pe_start set to pv->pe_align even though pe_start shouldn't ever
change.

vgconvert and pvcreate have a facility to preserve the existing start
of the on-disk data extents, known as pe_start.
They indicate this by passing the existing value to the pvsetup function
which must preserve it.

This patch avoids one particular case where the value could get
changed incorrectly now that the alignment settings are configurable.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:18:03 +00:00
Christine Caulfield
cfe2d71862 Document the -I option to clvmd 2009-07-30 13:32:38 +00:00
Alasdair Kergon
36a1405360 Fix configure script to handle multiple clvmd selections. 2009-07-30 12:25:42 +00:00
Alasdair Kergon
85d1fe36e1 Fix lvm2app.pc installation filename. 2009-07-29 19:24:11 +00:00
Alasdair Kergon
84ae15e8d1 Remove pv_t, vg_t & lv_t handles from lib. Only liblvm uses them.
Rename lvm.h to lvm2app.h for now.
2009-07-29 13:26:01 +00:00
Alasdair Kergon
ca897d8d15 post-release 2009-07-28 20:47:40 +00:00
Alasdair Kergon
93148f9334 clean up a bit for release 2009-07-28 19:32:26 +00:00
Alasdair Kergon
bc63df367d pre-release 2009-07-28 17:07:48 +00:00
Dave Wysochanski
7835e2a762 Update WHATS_NEW for latest liblvm changes 2009-07-27 21:10:30 +00:00
Dave Wysochanski
f33e774f4b Update WHATS_NEW for latest liblvm changes 2009-07-26 22:19:14 +00:00
Dave Wysochanski
1523a4953f Update WHATS_NEW for recent checkins 2009-07-26 11:21:32 +00:00
Alasdair Kergon
78af10f81b Add global/wait_for_locks to lvm.conf so blocking on locks can be disabled. 2009-07-24 23:28:55 +00:00
Alasdair Kergon
2b9605e8f5 All LV locks are non-blocking so remove LCK_NONBLOCK from separate macros. 2009-07-24 18:15:06 +00:00
Dave Wysochanski
887e1d5d61 Revert previous patch that moved VG_ORPHAN lock inside vg_extend.
We must hold the VG_ORPHAN lock until we commit to disk.  Otherwise,
we risk a race condition on vgcreate / vgextend.  Reverts the following
commit:

commit 72a41480ba
Author: Dave Wysochanski <dwysocha@redhat.com>
Date:   Fri Jul 10 20:09:21 2009 +0000

    Move orphan lock obtain/release inside vg_extend().

    With this change we now have vgcreate/vgextend liblvm functions.
    Note that this changes the lock order of the following functions as the
    orphan lock is now obtained first.  With our policy of non-blocking
    second locks, this should not be a problem.

    Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2009-07-24 15:01:43 +00:00
Dave Wysochanski
1fbf5728e1 Update WHATS_NEW for liblvm commits 2009-07-23 23:55:01 +00:00
Alasdair Kergon
44482a809e Add liblvm2app Makefile installation targets.
Add liblvm pkgconfig file.
2009-07-22 21:09:13 +00:00
Alasdair Kergon
337d248c5d Use newly-independent LVM_LIBAPI in liblvm soname. E.g. liblvm2app.so.2.1. 2009-07-22 20:12:14 +00:00
Alasdair Kergon
62a636c887 Add an API version number, LVM_LIBAPI, to the VERSION string. 2009-07-22 20:01:28 +00:00
mpatocka
eb77e55fe6 Pass struct cmd_context as a first argument to init_multiple_segtypes.
Remove redundant assignment seglib.cmd = cmd (done already at the beginning
of the function).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2009-07-21 20:00:02 +00:00
Alasdair Kergon
5454ec8f9b Return EINVALID_CMD_LINE not success when invalid VG name format is used. 2009-07-21 11:10:49 +00:00
Dave Wysochanski
9c72fc1d2b Remove extraneous messages for extent_size and alloc_policy upon vgcreate.
When converting to the new liblvm functions, the vgcreate code path
changed to create a new vg, then set values.  As a result of this
change, and the fact that we give a user a message if they try to
set the same value of a VG attribute (extent_size, alloc_policy, etc),
you'll see these 2 extraneous "is already" messages with vgcreate:
tools/lvm vgcreate vg2 /dev/loop2
  Physical extent size of VG vg2 is already 4.00 MB
  Volume group allocation policy is already normal
  Volume group "vg2" successfully created

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-16 03:25:26 +00:00
Alasdair Kergon
5e3369aba3 Add log_errno to set a specific errno and replace log_error in due course. 2009-07-16 00:52:06 +00:00
Alasdair Kergon
7b0fcd79a0 Add lvm_errno and lvm_errmsg to liblvm to obtain failure information.
Change create_toolcontext to still return an object if it fails part-way.
Add EUNCLASSIFIED (-1) as the default LVM errno code.
2009-07-16 00:36:59 +00:00
Alasdair Kergon
0ed40c04c7 Store any errno and error messages issued while processing each command.
(Enabled by default while we test it, but in due course we'll only store
the error messages when we need to.)
2009-07-15 23:57:54 +00:00
Alasdair Kergon
7da36611dc Use log_error macro consistently throughout in place of log_err. 2009-07-15 20:02:46 +00:00
Alasdair Kergon
571cd5a94f post-release 2009-07-15 15:38:41 +00:00
Alasdair Kergon
a044570365 pre-release 2009-07-15 15:16:48 +00:00
Alasdair Kergon
c18595ce31 pre-release clarification 2009-07-15 14:59:14 +00:00
Alasdair Kergon
22ba3c7b41 pre-release 2009-07-15 13:20:06 +00:00
Dave Wysochanski
ae94917e76 Fix pvremove test breakage.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-14 19:59:41 +00:00
Milan Broz
cd93b0470b Enable use of new multi-segment registration for static registration too.
so it allows this use:

#ifdef MYNEWSEG_INTERNAL
        if (!init_mynewseg_segtypes(&seglib))
                        return 0;
#endif
2009-07-14 12:17:14 +00:00
Alasdair Kergon
4665b5aecf Exclude VG_GLOBAL from vg_write_lock_held so scans open devs read-only again. (mbroz) 2009-07-14 11:01:26 +00:00
Dave Wysochanski
1f9b9c6235 Add liblvm test case for creating of a vg.
liblvm unit test case uses the following APIs:
- lvm_create, lvm_destroy
- lvm_vg_create, lvm_vg_extend, lvm_vg_set_extent_size, lvm_vg_write,
lvm_vg_remove, lvm_vg_close

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
2009-07-14 03:08:56 +00:00
Dave Wysochanski
900c634af1 Remove READ_REQUIRE_RESIZEABLE flag from vg_read() interface - no users.
The checks for RESIZEABLE_VG should now be inside the various functions that
have to do such operations.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
2009-07-14 02:19:19 +00:00
mpatocka
4fb0ddedc7 WHATS_NEW 2009-07-13 23:16:17 +00:00
Alasdair Kergon
685bc7ae83 Make cmd->cmd_line const. 2009-07-13 19:49:48 +00:00
Alasdair Kergon
d0d0c1e5e5 Fix dev name mismatch in vgcreate man page example. 2009-07-13 11:25:35 +00:00
Dave Wysochanski
b003ae7270 Update WHATS_NEW for vgremove and ORPAHN_LOCK refactoring 2009-07-10 20:16:15 +00:00
snitzer
e27183d54f Check MD devices for a partition table during device scan. 2009-07-09 22:50:45 +00:00
snitzer
f49c31ddb2 Add extended device (blkext) and MD partition (mdp) types to filters.
Both types were added with a 'max_partitions' of 1 because these devices
are _not_ partitionable (they are the partitions).
2009-07-09 22:34:02 +00:00
Milan Broz
ac959238aa Fix and precise metadata read errors for segment areas. 2009-07-09 11:29:41 +00:00
Milan Broz
563b6561a5 Fix confusing metadata syntax error messages.
If there is syntax error in metadata, it now prints messages
like:
  Couldn't read 'start_extent' for segment 'extent_count'.
  Couldn't read all logical volumes for volume group vg_test.

The segment specification is wrong and confusing.

Patch fixes it by introducing "parent" member in config_node which
points to parent section and config_parent_name function, which
provides pointer to node section name.

Also it adds several LV references where possible.
2009-07-09 11:29:00 +00:00
Milan Broz
bc26690cbf Fix segment import functions to print segment name and logical volume name. 2009-07-09 11:28:09 +00:00
Dave Wysochanski
4f56896f60 Update WHATS_NEW for recent vgcreate changes 2009-07-09 10:19:07 +00:00
Dave Wysochanski
75c22b585e . 2009-07-08 22:22:12 +00:00
Dave Wysochanski
470aa36c91 Update WHATS_NEW for vgread cleanup 2009-07-08 14:41:00 +00:00
Alasdair Kergon
c2cd4d5d15 Permit several segment types to be registered by a single shared object. 2009-07-08 12:36:01 +00:00
snitzer
34fe80f9d9 Reword the WHATS_NEW commandline sizes update. 2009-07-06 19:17:15 +00:00
snitzer
15ae133662 Allow commandline sizes to be specified in terms of bytes and sectors.
Update the man pages to document size units uniformly.
2009-07-06 19:13:26 +00:00
snitzer
c405a5d5b3 Use the MD device's stripe-width, instead of chunk_size, to align the
data blocks of a Physical Volume that is placed directly upon an MD
device.
2009-07-06 19:04:24 +00:00
Alasdair Kergon
7099be8f44 clarification 2009-07-03 11:04:06 +00:00
Dave Wysochanski
86e8c36a75 Update WHATS_NEW for vg_read commits 2009-07-01 17:23:10 +00:00
Alasdair Kergon
8414c57026 post-release 2009-07-01 09:31:46 +00:00
Alasdair Kergon
ae2e7f0603 update date 2009-06-30 18:41:47 +00:00
Alasdair Kergon
7177c3b393 pre-release tidy up 2009-06-30 18:39:31 +00:00
Alasdair Kergon
273511037a pre-release 2009-06-26 10:57:30 +00:00
Alasdair Kergon
56d64f23bf revert last patch - let's do a release first 2009-06-26 10:55:57 +00:00
Dave Wysochanski
cfbeca5e65 Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).
Sun May  3 11:40:51 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).


Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>
2009-06-26 09:47:36 +00:00
Alasdair Kergon
aaf9b56084 Abort if automatic metadata correction fails when reading VG to update it. 2009-06-26 09:19:13 +00:00
Alasdair Kergon
e0a953e27e Abort operation if automatic metadata correction in lvconvert fails. 2009-06-26 09:03:59 +00:00