]> sourceware.org Git - lvm2.git/log
lvm2.git
15 years agoAbort if automatic metadata correction fails when reading VG to update it.
Alasdair Kergon [Fri, 26 Jun 2009 09:19:13 +0000 (09:19 +0000)]
Abort if automatic metadata correction fails when reading VG to update it.

15 years agoAbort operation if automatic metadata correction in lvconvert fails.
Alasdair Kergon [Fri, 26 Jun 2009 09:03:59 +0000 (09:03 +0000)]
Abort operation if automatic metadata correction in lvconvert fails.

15 years agoFix backward compatibility for major:minor query.
Milan Broz [Wed, 17 Jun 2009 20:55:24 +0000 (20:55 +0000)]
Fix backward compatibility for major:minor query.

Is an application uses query and set major:minor
to device, it should not fallback to default major by default.

Add new function whoich allows that (and use it in lvm2).

15 years agoProperly destroy toolcontext.
Milan Broz [Wed, 17 Jun 2009 20:54:20 +0000 (20:54 +0000)]
Properly destroy toolcontext.

(fixes previous commit)

15 years agoVarious vgimportclone fixes:
Mike Snitzer [Wed, 17 Jun 2009 15:47:01 +0000 (15:47 +0000)]
Various vgimportclone fixes:
- validate the specified device is a PV and that it is in a VG
- automatically enable DEBUG (-d) if >= 4 -v instances were supplied
- preserve TMP_LVM_SYSTEM_DIR if it contains an lvm.conf and -d was
  specified
- fix handling of special-case where PV is listed as "unknown device"
- more descriptive error when a PV is missing ("unknown device")
- unset LVM_SYSTEM_DIR if it was not originally set
- skip final vgscan if no changes were made

15 years agoCleanup pvs, vgs, and lvs "-o" section in man pages (rhbz 500861).
Dave Wysochanski [Mon, 15 Jun 2009 17:09:32 +0000 (17:09 +0000)]
Cleanup pvs, vgs, and lvs "-o" section in man pages (rhbz 500861).

http://bugzilla.redhat.com/show_bug.cgi?id=500861
- Update list of fields/columns for each command (a few missing).
- Update list order to match "-o help" output (easier to verify field list)
- Add "{pv|vg|lv}_all" description.
- Move "-o help" sentence above column/field list.

New sample man page for lvs (pvs and vgs are similar):
       -o, --options
              Comma-separated ordered list of columns.  Precede the list  with  ’+’  to  append  to  the
              default selection of columns instead of replacing it.

              Use  -o  lv_all to select all logical volume columns, and -o seg_all to select all logical
              segment columns.

              Use -o help to view the full list of columns available.

              Column names  include:  lv_uuid,  lv_name,  lv_attr,  lv_major,  lv_minor,  lv_read_ahead,
              lv_kernel_major,  lv_kernel_minor,  lv_kernel_read_ahead, lv_size, seg_count, origin, ori-
              gin_size, snap_percent, copy_percent, move_pv, convert_lv, lv_tags,  mirror_log,  modules,
              segtype,  stripes,  stripesize,  regionsize, chunksize, seg_start, seg_start_pe, seg_size,
              seg_tags, seg_pe_ranges, devices.

              With --segments, any "seg_" prefixes  are  optional;  otherwise  any  "lv_"  prefixes  are
              optional.  Columns mentioned in vgs (8) can also be chosen.

              The lv_attr bits are:

15 years agoAdd WHATS_NEW items.
Milan Broz [Mon, 15 Jun 2009 15:09:02 +0000 (15:09 +0000)]
Add WHATS_NEW items.

15 years ago- Ignore suspended devices during repair (Milan).
Petr Rockai [Mon, 15 Jun 2009 14:47:39 +0000 (14:47 +0000)]
- Ignore suspended devices during repair (Milan).
- Call vgreduce --removemissing (without --force) automatically to clean up bad
  PVs (Milan).

15 years agoSuggest use lvchange --resync when up converting not yet synced mirror.
Milan Broz [Mon, 15 Jun 2009 13:43:15 +0000 (13:43 +0000)]
Suggest use lvchange --resync when up converting not yet synced mirror.

15 years agoDo not fork daemon when dmeventd cannot be found.
Milan Broz [Mon, 15 Jun 2009 12:29:41 +0000 (12:29 +0000)]
Do not fork daemon when dmeventd cannot be found.

15 years agoDestroy toolcontext on exit in clvmd (fixes memory pool leaks).
Milan Broz [Mon, 15 Jun 2009 12:15:23 +0000 (12:15 +0000)]
Destroy toolcontext on exit in clvmd (fixes memory pool leaks).

15 years agoFix lvconvert to not poll mirror if no conversion in progress.
Milan Broz [Mon, 15 Jun 2009 12:08:59 +0000 (12:08 +0000)]
Fix lvconvert to not poll mirror if no conversion in progress.

15 years agoFix memory leaks in toolcontext error path.
Milan Broz [Mon, 15 Jun 2009 11:56:31 +0000 (11:56 +0000)]
Fix memory leaks in toolcontext error path.

E.g.
 # vgscan
  Parse error at byte 2360 (line 54): expected a value
  Failed to load config file /etc/lvm/lvm.conf
You have a memory leak (not released memory pool):
 [0x818c788] library (12 bytes)

...

15 years agoFix WHATS_NEW - Allow metadata correction even when PVs are missing.
Milan Broz [Fri, 12 Jun 2009 08:34:15 +0000 (08:34 +0000)]
Fix WHATS_NEW - Allow metadata correction even when PVs are missing.

15 years agoRe-instate partial activation support in clustered mode. (mornfall)
Milan Broz [Fri, 12 Jun 2009 08:30:19 +0000 (08:30 +0000)]
Re-instate partial activation support in clustered mode. (mornfall)

15 years agoAllow metadata correction even when PVs are missing.
Petr Rockai [Wed, 10 Jun 2009 20:17:32 +0000 (20:17 +0000)]
Allow metadata correction even when PVs are missing.

15 years agoIn the new _vg_read_for_update(), we always do the check for CLUSTERED vg
Dave Wysochanski [Wed, 10 Jun 2009 16:14:40 +0000 (16:14 +0000)]
In the new _vg_read_for_update(), we always do the check for CLUSTERED vg
status flag after reading the volume group.  Thus, no need to set the flag
in vg_read() or clear it later before calling _vg_bad_status_bits().

Also, add back in the !lockingfailed() as part of the CLUSTERED flag check.
It's unclear why it was removed when the check was moved from
_vg_bad_status_bits() to inside _vg_lock_and_read().
There was an open question about the last check in the 'if' stmt for
lockingfailed() with a previous patch submitted.  However, I would
defer that right now as it is a separate item and this patch should
be no functional change by including the !lockingfailed().

Petr acked this patch on 5/26 I just forgot to check it in.

Acked-by: Petr Rockai <prockai@redhat.com>
15 years agoComplain when lvconvert --repair is used on non-mirror LV.
Petr Rockai [Wed, 10 Jun 2009 15:27:57 +0000 (15:27 +0000)]
Complain when lvconvert --repair is used on non-mirror LV.

15 years agoFix compiler warning.
Milan Broz [Wed, 10 Jun 2009 11:21:10 +0000 (11:21 +0000)]
Fix compiler warning.

15 years agoUnlock VG in recover_vg if metadata read failed.
Milan Broz [Wed, 10 Jun 2009 11:15:29 +0000 (11:15 +0000)]
Unlock VG in recover_vg if metadata read failed.

15 years agoUnlock vg when requested automatic update failed.
Milan Broz [Wed, 10 Jun 2009 10:15:28 +0000 (10:15 +0000)]
Unlock vg when requested automatic update failed.

(fixes previous commit)

15 years agoSupport crypt segment in libdevmapper tree.
Milan Broz [Tue, 9 Jun 2009 16:10:20 +0000 (16:10 +0000)]
Support crypt segment in libdevmapper tree.

- it can support multiple segments, but note that
to work properly, correct IV (initialization vector)
offset parameter must be set properly.

Because most usage of IV start offset is when we join
several crypto segments together (so iv_offset is the segment
start offset), DM_CRYPT_IV_DEFAULT is defined to simplify
the process.

Function accepts the string in cipher agrument (already
including chainmode and iv type; chainmode and iv parameters are NULL
in this case) or user can provide split parameters which will
join into dm-crypt cipher specification "cipher-chainmode-iv".

All these parameters must be supplied in correct dm-crypt format.

15 years agoUse 'lvm lvresize' instead of 'lvresize' in fsadm.
Zdenek Kabelac [Tue, 9 Jun 2009 15:31:36 +0000 (15:31 +0000)]
Use 'lvm lvresize' instead of 'lvresize' in fsadm.
Do not use '-n' realine option in fsadm for busybox compatiblity.

15 years agoUpdate WHATS_NEW
Dave Wysochanski [Tue, 9 Jun 2009 14:43:59 +0000 (14:43 +0000)]
Update WHATS_NEW

15 years agoUpdate vgsplit to use new vg_reserve_newname() function.
Dave Wysochanski [Tue, 9 Jun 2009 14:31:20 +0000 (14:31 +0000)]
Update vgsplit to use new vg_reserve_newname() function.

15 years agoUpdate vgcreate to use new vg_lock_newname().
Dave Wysochanski [Tue, 9 Jun 2009 14:30:44 +0000 (14:30 +0000)]
Update vgcreate to use new vg_lock_newname().

15 years agoUpdate vgrename to use vg_lock_newname.
Dave Wysochanski [Tue, 9 Jun 2009 14:30:16 +0000 (14:30 +0000)]
Update vgrename to use vg_lock_newname.

15 years agoAdd vg_lock_newname() library function.
Dave Wysochanski [Tue, 9 Jun 2009 14:29:10 +0000 (14:29 +0000)]
Add vg_lock_newname() library function.

Various tools need to check for existence of a VG before doing something
(vgsplit, vgrename, vgcreate).  Currently we don't have an interface to
check for existence, but the existence check is part of the vg_read* call(s).
This patch is an attempt to pull out some of that functionality into a
separate function, and hopefully simplify our vg_read interface, and
move those patches along.

vg_lock_newname() is only concerned about checking whether a vg exists in
the system.  Unfortunately, we cannot just scan the system, but we must first
obtain a lock.  Since we are reserving a vgname, we take a WRITE lock on
the vgname.  Once obtained, we scan the system to ensure the name does
not exist.  The return codes and behavior is in the function header.
You might think of this function as similar to an open() call with
O_CREAT and O_EXCL flags (returns failure with -EEXIST if file already
exists).

NOTE: I think including the word "lock" in the function name is important,
as it clearly states the function obtains a lock and makes the code more
readable, especially when it comes to cleanup / unlocking.  The ultimate
function name is somewhat open for debate though so later we may rename.

15 years agoFix the same readahead rounding in lvcreate.
Milan Broz [Sat, 6 Jun 2009 22:06:54 +0000 (22:06 +0000)]
Fix the same readahead rounding in lvcreate.

(fixes previous commit)

15 years agoRound readahead more inteligently and print warning.
Milan Broz [Sat, 6 Jun 2009 22:00:20 +0000 (22:00 +0000)]
Round readahead more inteligently and print warning.

Round readahead at least to one page up.
Print warning instead of verbose message.

15 years agoFix various problems in tests
Milan Broz [Sat, 6 Jun 2009 16:40:39 +0000 (16:40 +0000)]
Fix various problems in tests

- PPC uses 64k page, some caculations are wrong in tests
- file utility is buggy on PPC and cannot detect swap, use blkid instead
- read ahead is quietly rounded down according to page size
(for now use some common divisor value in test)

15 years agoSuspend virtual origin before real snapshot.
Milan Broz [Sat, 6 Jun 2009 16:37:15 +0000 (16:37 +0000)]
Suspend virtual origin before real snapshot.

Because preload of table for snapshot can produce snapshot
metadata (in kernel cow header) read.

Code should suspend origin first to avoid possible deadlock
when preloading (thus calling snapshot in-kernel constructor)
for origin with suspended cow device.

(fixes previous commit)

15 years agoFix double releasing of vg when repairing of vg is requested.
Milan Broz [Fri, 5 Jun 2009 20:00:52 +0000 (20:00 +0000)]
Fix double releasing of vg when repairing of vg is requested.

Several commands calls process_each_vg() and in provided
callback it explicitly recovers VG if inconsistent.
(vgchange, vgconvert, vgscan)

It means that old VG is released and reread  but the function
above (process_one_vg) tries to unlock and release old VG.

Patch moves the repair logic into _process_one_vg() function.

It always tries to read vg (even inconsistent) and then decides
what to do according new defined parameter.

Also patch unifies inconsistent error messages.

The only slight change if for vgremove command, where
it now tries to repair VG before it removes if force arg is given.
(It works similar way before, just the order of operation changed).

15 years agoAdd vgrename test to check for existence of new vg.
Dave Wysochanski [Fri, 5 Jun 2009 10:42:22 +0000 (10:42 +0000)]
Add vgrename test to check for existence of new vg.

15 years agotest commit
Alasdair Kergon [Thu, 4 Jun 2009 13:23:10 +0000 (13:23 +0000)]
test commit

15 years agotest commit
Alasdair Kergon [Thu, 4 Jun 2009 13:16:49 +0000 (13:16 +0000)]
test commit

15 years agotest commit
Alasdair Kergon [Thu, 4 Jun 2009 13:11:58 +0000 (13:11 +0000)]
test commit

15 years agoUse lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall)
Milan Broz [Thu, 4 Jun 2009 12:01:15 +0000 (12:01 +0000)]
Use lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall)
Introduce lvconvert --use_policies (mornfall)

15 years agoAdd splitname.
Alasdair Kergon [Wed, 3 Jun 2009 20:44:42 +0000 (20:44 +0000)]
Add splitname.

15 years agoAdd subsystem, vg_name, lv_name, lv_layer fields to dmsetup reports.
Alasdair Kergon [Wed, 3 Jun 2009 18:35:39 +0000 (18:35 +0000)]
Add subsystem, vg_name, lv_name, lv_layer fields to dmsetup reports.

15 years agoFix clvmd-corosync to match the new corosync API.
Christine Caulfield [Wed, 3 Jun 2009 13:42:02 +0000 (13:42 +0000)]
Fix clvmd-corosync to match the new corosync API.

15 years agoWHATS_NEW!
Milan Broz [Wed, 3 Jun 2009 11:49:05 +0000 (11:49 +0000)]
WHATS_NEW!

15 years agoMake mempool optional in dm_split_lvm_name()
Alasdair Kergon [Wed, 3 Jun 2009 11:40:23 +0000 (11:40 +0000)]
Make mempool optional in dm_split_lvm_name()

15 years agoBuild shared parts with 'make' command (mpatocka)
Milan Broz [Wed, 3 Jun 2009 11:31:06 +0000 (11:31 +0000)]
Build shared parts with 'make' command (mpatocka)

When some parts of lvm are built as shared libraries (for example with
--with-snapshots=shared), the 'make' command does not build these parts.
The shared parts are built with 'make install' command.

This bug can be seen if you go to 'lib' subdirectory and type 'make'.
If you type 'make', the shared libraries are not built, if you type
'make all', the shared libraries are built.

The reason for the bug is the line $(SUBDIRS): $(LIB_STATIC)
If make is executed without any arguments, it makes the first target
in the Makefile. If the first target is '$(SUBDIRS): $(LIB_STATIC)',
it only builds static libraries.

This patch moves '$(SUBDIRS): $(LIB_STATIC)' after
include $(top_srcdir)/make.tmpl. make.tmpl contains the 'all' target
as its first target, so 'make' will be equivalent to 'make all' and
shared libraries will be build with 'make' command.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
15 years agoFix rename of active snapshot with virtual origin.
Milan Broz [Mon, 1 Jun 2009 15:55:06 +0000 (15:55 +0000)]
Fix rename of active snapshot with virtual origin.

Code must suspend/resume virtual origin too when renaming
snaphsot otherwise in kernel old name remains.

15 years agoFix convert polling to ignore LV with different UUID.
Milan Broz [Mon, 1 Jun 2009 14:43:27 +0000 (14:43 +0000)]
Fix convert polling to ignore LV with different UUID.

When mirror convert polling is started (mainly as backgound process,
in lvchange -a y or in lvconvert itself) it tries to read VG
and LV identified by its name.

Unfortunatelly, the VG can have already different LV under the same name,
and various more or less funny things can happen (note that
_finish_lvconvert_mirror suspends the volume for example).

(the typical example is our testing script which continuously recreates
LVs under the same name in the same VG.)

This patch adds optional uuid parameter which helps to properly
select the monitoring object. For lvconvert polling it is set to LV UUID
and both _get_lvconvert_vg and _get_lvconvert_lv uses it to read proper VG/LV.

(In the pvmove case it is NULL, here we poll for physical volume name).

15 years agoFix log allocation segfault (fix previous commits).
Milan Broz [Mon, 1 Jun 2009 14:23:38 +0000 (14:23 +0000)]
Fix log allocation segfault (fix previous commits).

If there is no free area for log, code should break the loop.
(Otherwise it uses uninitializes areas later.)

Easily reproducible using lvconvert --repair
 - kill device with log
 - run lvconvert --repair vg/lv (with no PV usable for log)

15 years agoFix readahead calculation problems.
Milan Broz [Mon, 1 Jun 2009 12:43:31 +0000 (12:43 +0000)]
Fix readahead calculation problems.

During vgreduce is failed mirror image replaced with error segment,
this segmant type has always area_count == 0.
Current code expects that there is at least one area with device,
patch fixes it by additional check (fixes segfault during vgreduce).

Also do not calculate readahead in every lv_info call, we only need
to cache PV readahead before activation calls which locks memory.

15 years agoRemove verbose 'visited' messages.
Alasdair Kergon [Sat, 30 May 2009 01:54:29 +0000 (01:54 +0000)]
Remove verbose 'visited' messages.

15 years agoHandle multi-extent mirror log allocation when smallest PV has only 1 extent.
Alasdair Kergon [Sat, 30 May 2009 00:09:27 +0000 (00:09 +0000)]
Handle multi-extent mirror log allocation when smallest PV has only 1 extent.

15 years agoFix 'service-default-enabled' rpmlint in clvmd initscript
Mike Snitzer [Fri, 29 May 2009 18:54:48 +0000 (18:54 +0000)]
Fix 'service-default-enabled' rpmlint in clvmd initscript

15 years agoFix rpmlint in clvmd initscript
Mike Snitzer [Fri, 29 May 2009 18:34:10 +0000 (18:34 +0000)]
Fix rpmlint in clvmd initscript

Added missing LSB stanza lines.
Added reload capability.
Remaining warning (incoherent-init-script-name) is not relevant.

15 years agoWhen creating new LV, double-check that name is not already in use.
Alasdair Kergon [Thu, 28 May 2009 01:59:37 +0000 (01:59 +0000)]
When creating new LV, double-check that name is not already in use.

15 years agoRemove /dev/vgname/lvname symlink automatically if LV is no longer visible.
Alasdair Kergon [Thu, 28 May 2009 01:11:29 +0000 (01:11 +0000)]
Remove /dev/vgname/lvname symlink automatically if LV is no longer visible.

15 years agoRename internal vorigin LV to match visible LV.
Alasdair Kergon [Thu, 28 May 2009 00:29:14 +0000 (00:29 +0000)]
Rename internal vorigin LV to match visible LV.

15 years agoSuppress 'removed' messages displayed when internal LVs are removed.
Alasdair Kergon [Wed, 27 May 2009 18:19:21 +0000 (18:19 +0000)]
Suppress 'removed' messages displayed when internal LVs are removed.
Fix lvchange -a and -p for sparse LVs.
Fix lvcreate --virtualsize to activate the new device immediately.

15 years agoMake --snapshot optional with lvcreate --virtualsize.
Alasdair Kergon [Wed, 27 May 2009 16:30:29 +0000 (16:30 +0000)]
Make --snapshot optional with lvcreate --virtualsize.
Generalise --virtualoriginsize to --virtualsize.

15 years agoSkip virtual origins in process_each_lv_in_vg(). (mbroz)
Alasdair Kergon [Wed, 27 May 2009 13:23:41 +0000 (13:23 +0000)]
Skip virtual origins in process_each_lv_in_vg(). (mbroz)

15 years agoFix counting of virtual origin LVs in vg_validate. (mbroz)
Alasdair Kergon [Wed, 27 May 2009 13:19:34 +0000 (13:19 +0000)]
Fix counting of virtual origin LVs in vg_validate. (mbroz)

15 years ago0->NULL (mbroz)
Alasdair Kergon [Wed, 27 May 2009 13:07:37 +0000 (13:07 +0000)]
0->NULL (mbroz)

15 years agoAttempt to load dm-zero module if zero target needed but not present. (mbroz)
Alasdair Kergon [Wed, 27 May 2009 13:05:53 +0000 (13:05 +0000)]
Attempt to load dm-zero module if zero target needed but not present. (mbroz)

15 years agopost-release
Alasdair Kergon [Fri, 22 May 2009 15:23:10 +0000 (15:23 +0000)]
post-release

15 years agoTemporary disable one of lvconvert tests.
Milan Broz [Fri, 22 May 2009 14:56:17 +0000 (14:56 +0000)]
Temporary disable one of lvconvert tests.

15 years agoRename liblvm.so to liblvm2app.so and use configure --enable-applib.
Alasdair Kergon [Fri, 22 May 2009 14:44:59 +0000 (14:44 +0000)]
Rename liblvm.so to liblvm2app.so and use configure --enable-applib.

15 years agoReinstate version in liblvm2cmd.so soname. (2.02.44)
Alasdair Kergon [Thu, 21 May 2009 11:11:29 +0000 (11:11 +0000)]
Reinstate version in liblvm2cmd.so soname. (2.02.44)

15 years agoPre-release cleanups.
Alasdair Kergon [Thu, 21 May 2009 03:04:52 +0000 (03:04 +0000)]
Pre-release cleanups.

15 years agoMissing entries.
Alasdair Kergon [Wed, 20 May 2009 22:44:10 +0000 (22:44 +0000)]
Missing entries.

15 years agoRevert:
Alasdair Kergon [Wed, 20 May 2009 22:24:48 +0000 (22:24 +0000)]
Revert:
    Use lvconvert --repair in dmeventd mirror DSO.
for now.

It replaces bad behaviour in one set of circumstances with bad behaviour
in a different set.  We think the behaviour needs to be more configurable.

15 years agoFix locking query compatibility with old external locking libraries.
Milan Broz [Wed, 20 May 2009 12:58:03 +0000 (12:58 +0000)]
Fix locking query compatibility with old external locking libraries.

15 years agoFix readahead test.
Milan Broz [Wed, 20 May 2009 11:27:14 +0000 (11:27 +0000)]
Fix readahead test.

15 years agoUse readahead of underlying device and not default (smaller) one.
Milan Broz [Wed, 20 May 2009 11:09:49 +0000 (11:09 +0000)]
Use readahead of underlying device and not default (smaller) one.

When we are stacking LV over device, which has for some reason
increased read_ahead (e.g. MD RAID), the read_ahead hint
for libdevmapper is wrong (it is zero).

If the calculated read_ahead hint is zero, patch uses read_ahead of underlying device
(if first segment is PV) when setting DM_READ_AHEAD_MINIMUM_FLAG.

Because we are using dev-cache, it also store this value to cache for future use
(if several LVs are over one PV, BLKRAGET is called only once for underlying device.)

This should fix all the reamining problems with readahead mismatch reported
for DM over MD configurations (and similar cases).

15 years agoUse lock query instead of activate_lv_excl
Milan Broz [Wed, 20 May 2009 09:55:33 +0000 (09:55 +0000)]
Use lock query instead of activate_lv_excl

 - switch lvremove to not force activate volume when removing
 - ditto for force resync

 - fix some wrong return codes in lvchange_resync()

15 years agoUse suspend with flush when device size was changed during table preload.
Milan Broz [Wed, 20 May 2009 09:52:37 +0000 (09:52 +0000)]
Use suspend with flush when device size was changed during table preload.

This allows online mirror resize, also removes condition to preventing
code to do this.

15 years agoAdd test - lvconvert from linear (on multiple PVs) to mirror.
Dave Wysochanski [Tue, 19 May 2009 15:47:50 +0000 (15:47 +0000)]
Add test - lvconvert from linear (on multiple PVs) to mirror.

15 years agoAdd infrastructure for queriying for remote locks.
Milan Broz [Tue, 19 May 2009 10:38:58 +0000 (10:38 +0000)]
Add infrastructure for queriying for remote locks.

Current code, when need to ensure that volume is not
active on remote node, it need to try to exclusive
activate volume.

Patch adds simple clvmd command which queries all nodes
for lock for given resource.

The lock type is returned in reply in text.

(But code currently uses CR and EX modes only.)

15 years agoFix lvconvert check for multiple-segment mirrors (mornfall)
Milan Broz [Tue, 19 May 2009 10:27:47 +0000 (10:27 +0000)]
Fix lvconvert check for multiple-segment mirrors (mornfall)

15 years agoUse lvconvert --repair in dmeventd DSO (mornfall)
Milan Broz [Tue, 19 May 2009 10:25:16 +0000 (10:25 +0000)]
Use lvconvert --repair in dmeventd DSO (mornfall)

This means two things:

1) Non-mirrored LVs will be no longer affected by mirror monitoring. (Before,
if you had a LV that went partially missing on a VG where a mirror leg failed,
this LV would be removed automatically by dmeventd... Probably not an
unrecoverable dataloss bug, but still quite unpleasant.)

2) If enough parallel PV space is available at the time of the mirror failure,
the failed devices will be automatically replaced using this spare space. Which
(and whether) free space may be used is still not configurable, but is a
planned feature. Since it is relatively easy to undo the action by converting
the mirror manually, I don't consider this to be a showstopper. In fact, I
think the compromise is much better than what we have now.

15 years agoFix compilation warning.
Milan Broz [Tue, 19 May 2009 10:12:41 +0000 (10:12 +0000)]
Fix compilation warning.

15 years agoIf pvmove fails activating mirror volume, try restore to previous state.
Milan Broz [Tue, 19 May 2009 09:51:02 +0000 (09:51 +0000)]
If pvmove fails activating mirror volume, try restore to previous state.

pvmove now keep suspended devices if temporary mirror creation fails.

We can try to restore previous state if it is first attempt to activate
pvmove (code basically run the same code as --abort automatically).

15 years agoUse PV UUID in hash for device name when exporting metadata.
Milan Broz [Tue, 19 May 2009 09:48:32 +0000 (09:48 +0000)]
Use PV UUID in hash for device name when exporting metadata.

Currently code uses pv_dev_name() for hash when getting internal
"pvX" name.

This produce corrupted metadata if PVs are missing, pv->dev
is NULL and all these missing devices returns one name
(using "unknown device" for all missing devices as hash key).

15 years agovgcfgrestore should not quietly fail when backup file has missing PVs.
Milan Broz [Tue, 19 May 2009 09:45:33 +0000 (09:45 +0000)]
vgcfgrestore should not quietly fail when backup file has missing PVs.

(fixes previous commit: Fix segfault for vgcfgrestore on VG with missing PVs.)

15 years agoAdd vgimportclone and install it and the man page by default.
Mike Snitzer [Thu, 14 May 2009 16:46:12 +0000 (16:46 +0000)]
Add vgimportclone and install it and the man page by default.

15 years agoCheck max_lv on only place and force the check only for new volume.
Milan Broz [Wed, 13 May 2009 21:29:10 +0000 (21:29 +0000)]
Check max_lv on only place and force the check only for new volume.

We can temporarily violate max_lv during mirror conversion etc.

(If the operation fails, orphan mirror images are visible to administrator
for manual remove for example. Not that this should ever happen:-)

Force limit only for lvcreate (and vg merge) command.

Patch also adds simple max_lv tests into testsuite

15 years agoRemove unneeded import parameter from lv_create_empty.
Milan Broz [Wed, 13 May 2009 21:28:31 +0000 (21:28 +0000)]
Remove unneeded import parameter from lv_create_empty.

15 years agoMerge lv_is_displayable and lv_is_visible.
Milan Broz [Wed, 13 May 2009 21:27:43 +0000 (21:27 +0000)]
Merge lv_is_displayable and lv_is_visible.

Displayable and visible is the same thing.

volumes_count(vg) is now vg_visible_lvs() and always
returns number of LVs from user perspective.

15 years agoIntroduce lv_set_visible & lv_set_invisible and use lv_is_visible always.
Milan Broz [Wed, 13 May 2009 21:26:45 +0000 (21:26 +0000)]
Introduce lv_set_visible & lv_set_invisible and use lv_is_visible always.

The vg->lv_count parameter now includes always number of visible
logical volumes.

Note that virtual snapshot volume (snapshotX) is never visible,
but it is stored in metadata with visible flag.

15 years agoFix lv_is_visible to handle virtual origin.
Milan Broz [Wed, 13 May 2009 21:25:45 +0000 (21:25 +0000)]
Fix lv_is_visible to handle virtual origin.

Snapshot is visible if its origin is marked visible,
or if the origin is virtual.

15 years agoIntroduce link_lv_to_vg and unlink_lv_from_vg functions.
Milan Broz [Wed, 13 May 2009 21:25:01 +0000 (21:25 +0000)]
Introduce link_lv_to_vg and unlink_lv_from_vg functions.

link_lv_to_vg and unlink_lv_from_vg are the only functions
for adding/removing logical volume from volume group.

Only these function should manipulate with vg->lvs list.

15 years agoTidy format1 import LV function.
Milan Broz [Wed, 13 May 2009 21:24:12 +0000 (21:24 +0000)]
Tidy format1 import LV function.

Later patch initializes lv->vg after the LV structure is prepared,
so pass through cmd context and do not use vg->cmd here.
Also move LV id calculation (which uses lv->vg too).

Also properly free memory pool if operation fails.

15 years agoRemove vg->lv_count and use counter function.
Milan Broz [Wed, 13 May 2009 21:22:57 +0000 (21:22 +0000)]
Remove vg->lv_count and use counter function.

This should not cause problems but simplifies code a lot.

(the volumes_count is merged and renamed with lvs_visible
function by following patch.)

15 years agoFix snapshot segment import to not use duplicate segments & replace.
Milan Broz [Wed, 13 May 2009 21:21:58 +0000 (21:21 +0000)]
Fix snapshot segment import to not use duplicate segments & replace.

The snapshot segment (snapshotX) is created twice
during the text metadata segment processing.

This can cause temporary violation of max_lv count.

Simplify the code, snapshot segment is properly initialized
in init_snapshot_seg function now and do not need to be replaced
by vg_add_snapshot call.

The vg_add_snapshot() is now usefull only for adding new
snapshot and it shares the same initialization function.

The snapshot name is always generated, name paramater can be
removed from function call.

15 years agoUpdate test-utils to cope with ":" in device names and allow configurable names.
Dave Wysochanski [Wed, 13 May 2009 19:18:47 +0000 (19:18 +0000)]
Update test-utils to cope with ":" in device names and allow configurable names.

15 years agoDo not query nonexistent devices for readahead.
Zdenek Kabelac [Wed, 13 May 2009 14:13:54 +0000 (14:13 +0000)]
Do not query nonexistent devices for readahead.

15 years agoRemove NON_BLOCKING lock flag from tools and set a policy to auto-set.
Dave Wysochanski [Wed, 13 May 2009 13:02:52 +0000 (13:02 +0000)]
Remove NON_BLOCKING lock flag from tools and set a policy to auto-set.

As a simplification to the tools and further liblvm, this patch pushes
the setting of NON_BLOCKING lock flag inside the lock_vol() call.
The policy we set is if any existing VGs are currently locked, we
set the NON_BLOCKING flag.

Should be no functional change.

15 years agobetter variable name for snapshot counting
Alasdair Kergon [Wed, 13 May 2009 01:48:18 +0000 (01:48 +0000)]
better variable name for snapshot counting

15 years agoRemove snapshot_count from VG and use function instead.
Milan Broz [Tue, 12 May 2009 19:12:09 +0000 (19:12 +0000)]
Remove snapshot_count from VG and use function instead.

15 years agoFix first_seg() call for empty segment list.
Milan Broz [Tue, 12 May 2009 19:09:21 +0000 (19:09 +0000)]
Fix first_seg() call for empty segment list.

The seg variable is temporary variable for list iterator,
code cannot expect that after iteration it remains NULL
(it contains non-NULL pointer here id list is empty).

Patch fixes first_seg function so it now correctly returns NULL
for empty segment list.

15 years agoUpdate t-read-ahead.sh to validate lv_read_ahead and lv_kernel_read_ahead.
Dave Wysochanski [Mon, 11 May 2009 16:17:12 +0000 (16:17 +0000)]
Update t-read-ahead.sh to validate lv_read_ahead and lv_kernel_read_ahead.

- check default values
- check active/inactive values

15 years agoFix previous commit (scripts/Makefile targets order)
Milan Broz [Mon, 11 May 2009 10:35:00 +0000 (10:35 +0000)]
Fix previous commit (scripts/Makefile targets order)

15 years agoIntroduce lvm2_install target.
Milan Broz [Mon, 11 May 2009 10:28:45 +0000 (10:28 +0000)]
Introduce lvm2_install target.

Buildsystem support device-mapper only install,
but generic install tagret includes both dm+lvm2.

For distribution which uses separate install_device-mapper,
there is no way how to install lvm2 only
(so after installing lvm2 for packaging purposes
built system must remove installed device-mapper files).

Fix it by allowing lvm2_install target, similarily like
install_cluster for clvmd.

(install = install_device-mapper + install_lvm2)

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