]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agolvmanip: fix last commit and drop else
Zdenek Kabelac [Thu, 14 Jan 2016 10:54:37 +0000 (11:54 +0100)]
lvmanip: fix last commit and drop else

In last commit when removing if() branch
this 'else' now has to be dropped.

8 years agocleanup: order ac members
Zdenek Kabelac [Thu, 14 Jan 2016 10:21:47 +0000 (11:21 +0100)]
cleanup: order ac members

8 years agocleanup: spaces
Zdenek Kabelac [Mon, 11 Jan 2016 13:11:37 +0000 (14:11 +0100)]
cleanup: spaces

8 years agocleanup: replace log_warn
Zdenek Kabelac [Fri, 8 Jan 2016 10:08:07 +0000 (11:08 +0100)]
cleanup: replace log_warn

8 years agocleanup: explicit prohibition for virtual segs
Zdenek Kabelac [Wed, 6 Jan 2016 12:54:15 +0000 (13:54 +0100)]
cleanup: explicit prohibition for virtual segs

Internal _alloc_init() is only called from allocate_extents(),
which already does prevent usage of virtual segments.

So mark as internal error early and do not process it any further.

8 years agocleanup: simplier formula
Zdenek Kabelac [Fri, 8 Jan 2016 10:07:47 +0000 (11:07 +0100)]
cleanup: simplier formula

8 years agocleanup: more readable check
Zdenek Kabelac [Tue, 15 Dec 2015 14:13:11 +0000 (15:13 +0100)]
cleanup: more readable check

8 years agosnapshot: relocate alloc_snapshot_seg
Zdenek Kabelac [Thu, 7 Jan 2016 11:16:18 +0000 (12:16 +0100)]
snapshot: relocate alloc_snapshot_seg

Move alloc_snapshot_seg to snapshot_manip and make it local static.

8 years agosegtype: check for activation
Zdenek Kabelac [Thu, 17 Dec 2015 11:23:33 +0000 (12:23 +0100)]
segtype: check for activation

Before setting static variable with check passed state,
detect if we are allowed to talk to driver.

8 years agolvresize: check for poolmetadatasize arg earlier
Zdenek Kabelac [Wed, 16 Dec 2015 10:23:45 +0000 (11:23 +0100)]
lvresize: check for poolmetadatasize arg earlier

Since we check for poolmetadatasize, we need to detect it before
actual test.

8 years agolvmanip: add lv_is_snapshot
Zdenek Kabelac [Thu, 7 Jan 2016 13:30:21 +0000 (14:30 +0100)]
lvmanip: add lv_is_snapshot

Add new test for  lv_is_snapshot().
Also move few other bitchecks into same place as remaining bit tests.

TODO: drop lv_is_merging_origin() and keep using lv_is_merging().

8 years agovgcfgrestore: Retain allocatable PV attribute.
Alasdair G Kergon [Thu, 14 Jan 2016 00:46:45 +0000 (00:46 +0000)]
vgcfgrestore: Retain allocatable PV attribute.

pvchange -xn was getting lost.
All PVs were set to allocatable again after restore.

Moved setting ALLOCATABLE_PV outside pv_setup().

8 years agovgchange: fix lockd_gl results
David Teigland [Wed, 13 Jan 2016 21:55:41 +0000 (15:55 -0600)]
vgchange: fix lockd_gl results

The wrong error value was being checked from lockd_gl()
in two cases.

Clarify the use of lockd_gl() in the lock-start case.

8 years agolvmlockd: fix exit code
David Teigland [Wed, 13 Jan 2016 20:44:01 +0000 (14:44 -0600)]
lvmlockd: fix exit code

libdaemon uses 1 for success

8 years agoprocess_each_pv: remove unnecessary workaround
David Teigland [Wed, 13 Jan 2016 16:43:01 +0000 (10:43 -0600)]
process_each_pv: remove unnecessary workaround

The problem addressed by this workaround no longer
seems to exist, so remove it.  PVs with no mdas
no longer appear in both their actual VG and in
the orphan VG.

8 years agolv: fix check for NULL origin_lv in _do_lv_origin_dup, cleanup _do_lvconvert_lv_dup
Peter Rajnoha [Wed, 13 Jan 2016 16:11:00 +0000 (17:11 +0100)]
lv: fix check for NULL origin_lv in _do_lv_origin_dup, cleanup _do_lvconvert_lv_dup

8 years agocleanup: rename 'invisible devices' to 'hidden devices'
Peter Rajnoha [Wed, 13 Jan 2016 15:43:25 +0000 (16:43 +0100)]
cleanup: rename 'invisible devices' to 'hidden devices'

8 years agoconf: fix 'the volume list' vs 'volume list' and '@*'
Peter Rajnoha [Wed, 13 Jan 2016 14:47:26 +0000 (15:47 +0100)]
conf: fix 'the volume list' vs 'volume list' and '@*'

8 years agocleanup: rename 'invisible devices' to 'hidden devices'
Peter Rajnoha [Wed, 13 Jan 2016 14:37:15 +0000 (15:37 +0100)]
cleanup: rename 'invisible devices' to 'hidden devices'

8 years agocleanup: rename 'invisible devices' to 'hidden devices'
Peter Rajnoha [Wed, 13 Jan 2016 14:21:05 +0000 (15:21 +0100)]
cleanup: rename 'invisible devices' to 'hidden devices'

8 years agoWHATS_NEW: reports and invisible devices
Peter Rajnoha [Wed, 13 Jan 2016 13:45:49 +0000 (14:45 +0100)]
WHATS_NEW: reports and invisible devices

8 years agotest: add report-invisible.sh test
Peter Rajnoha [Wed, 13 Jan 2016 13:17:50 +0000 (14:17 +0100)]
test: add report-invisible.sh test

8 years agotests: update tests to deal with invisible devices consistently
Peter Rajnoha [Wed, 13 Jan 2016 12:55:24 +0000 (13:55 +0100)]
tests: update tests to deal with invisible devices consistently

8 years agocleanup: cleanup lv.h and put fns into categories for better readability
Peter Rajnoha [Tue, 12 Jan 2016 10:45:17 +0000 (11:45 +0100)]
cleanup: cleanup lv.h and put fns into categories for better readability

8 years agoconf: update command_profile_template.profile.in
Peter Rajnoha [Wed, 13 Jan 2016 11:15:28 +0000 (12:15 +0100)]
conf: update command_profile_template.profile.in

8 years agoconf: regenerate
Peter Rajnoha [Wed, 13 Jan 2016 10:58:12 +0000 (11:58 +0100)]
conf: regenerate

8 years agoconf: add report/mark_invisible_devices
Peter Rajnoha [Wed, 13 Jan 2016 10:30:07 +0000 (11:30 +0100)]
conf: add report/mark_invisible_devices

8 years agolv: use brackets for invisible devices when formatting device segments
Peter Rajnoha [Tue, 12 Jan 2016 13:49:56 +0000 (14:49 +0100)]
lv: use brackets for invisible devices when formatting device segments

Include brackets for the name if the dev is invisible.
This change applies to all callers of _format_pvsegs fn:
  - lvseg_devices (the "lvs -o devices")
  - lvseg_metadata_devices (the "lvs -o metadata_devices)
  - lvseg_seg_pe_ranges (the "lvs -o seg_pe_ranges")
  - lvseg_seg_metadata_le_ranges (the "lvs -o seg_metadata_le_ranges")

8 years agolv: add common lv_pool_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 10:53:39 +0000 (11:53 +0100)]
lv: add common lv_pool_lv fn for use in report and dup, use brackets for invisible devices

The common lv_pool_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_metadata_lv fn for use in report and dup, use brackets for invisibl...
Peter Rajnoha [Tue, 12 Jan 2016 10:23:56 +0000 (11:23 +0100)]
lv: add common lv_metadata_lv fn for use in report and dup, use brackets for invisible devices

The common lv_metadata_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_data_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 10:15:22 +0000 (11:15 +0100)]
lv: add common lv_data_lv fn for use in report and dup, use brackets for invisible devices

The common lv_data_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_mirror_log_lv for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 10:05:16 +0000 (11:05 +0100)]
lv: add common lv_mirror_log_lv for use in report and dup, use brackets for invisible devices

The common lv_mirror_log_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_origin_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 09:52:34 +0000 (10:52 +0100)]
lv: add common lv_origin_lv fn for use in report and dup, use brackets for invisible devices

The common lv_origin_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_convert_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 09:44:59 +0000 (10:44 +0100)]
lv: add common lv_convert_lv fn for use in report and dup, use brackets for invisible devices

The common lv_convert_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agoman lvmlockd: mention pvmove restriction
David Teigland [Tue, 12 Jan 2016 18:01:53 +0000 (12:01 -0600)]
man lvmlockd: mention pvmove restriction

8 years agopvmove: disallow moving PVs under sanlock leases
David Teigland [Tue, 12 Jan 2016 17:51:12 +0000 (11:51 -0600)]
pvmove: disallow moving PVs under sanlock leases

Fail with an error message if pvmove tries to move PVs
under the lvmlock LV.

8 years agoreport: use proper string reference in _string_disp call for _cache_policy_disp fn
Peter Rajnoha [Tue, 12 Jan 2016 15:13:56 +0000 (16:13 +0100)]
report: use proper string reference in _string_disp call for _cache_policy_disp fn

8 years agotest: conditional skip of auto-activation bg polling test
Ondrej Kozina [Tue, 12 Jan 2016 12:24:12 +0000 (13:24 +0100)]
test: conditional skip of auto-activation bg polling test

if dm-snapshot-merge target not present skip whole test

8 years agovgchange: drop redundant check
Ondrej Kozina [Tue, 12 Jan 2016 09:15:10 +0000 (10:15 +0100)]
vgchange: drop redundant check

check for background polling option is performed from
within vgchange_background_polling routine as well.

8 years agotest: add test for autoactivation regression
Ondrej Kozina [Thu, 7 Jan 2016 14:30:22 +0000 (15:30 +0100)]
test: add test for autoactivation regression

add test for a regression fixed in
40701af9696a302c904fad30951385eb5a5adb85

8 years agopvscan: restore polling in autoactivation handler
Ondrej Kozina [Thu, 7 Jan 2016 14:17:08 +0000 (15:17 +0100)]
pvscan: restore polling in autoactivation handler

This commit fixes regression in auto-activation code introduced
in commit: c26d81d6e6939906729d91fae83cd8bbdd743bb7.

- resolves rhbz1295562

8 years agoreport: use brackets to signify LVs which are not visible when reporting lv_parent
Peter Rajnoha [Mon, 11 Jan 2016 14:34:35 +0000 (15:34 +0100)]
report: use brackets to signify LVs which are not visible when reporting lv_parent

Use common _lvname_disp to report lv_parent. The _lvname_disp
takes care of properly marking LVs which are not visible - such
LVs are always enclosed in brackets when reported within any
other field.

For example, thin pool over RAID.

Before:

$ lvs -a -o name,lv_parent,data_lv,metadata_lv vg
  LV                          Parent           Data               Meta
  cache_pool                                   [cache_pool_tdata] [cache_pool_tmeta]
  [cache_pool_tdata]          cache_pool
  [cache_pool_tdata_rimage_0] cache_pool_tdata
  [cache_pool_tdata_rimage_1] cache_pool_tdata
  [cache_pool_tdata_rmeta_0]  cache_pool_tdata
  [cache_pool_tdata_rmeta_1]  cache_pool_tdata
  [cache_pool_tmeta]          cache_pool
  [cache_pool_tmeta_rimage_0] cache_pool_tmeta
  [cache_pool_tmeta_rimage_1] cache_pool_tmeta
  [cache_pool_tmeta_rmeta_0]  cache_pool_tmeta
  [cache_pool_tmeta_rmeta_1]  cache_pool_tmeta
  [lvol0_pmspare]

With this patch applied:

$ lvs -a -o name,lv_parent,data_lv,metadata_lv vg
  LV                          Parent             Data               Meta
  cache_pool                                     [cache_pool_tdata] [cache_pool_tmeta]
  [cache_pool_tdata]          cache_pool
  [cache_pool_tdata_rimage_0] [cache_pool_tdata]
  [cache_pool_tdata_rimage_1] [cache_pool_tdata]
  [cache_pool_tdata_rmeta_0]  [cache_pool_tdata]
  [cache_pool_tdata_rmeta_1]  [cache_pool_tdata]
  [cache_pool_tmeta]          cache_pool
  [cache_pool_tmeta_rimage_0] [cache_pool_tmeta]
  [cache_pool_tmeta_rimage_1] [cache_pool_tmeta]
  [cache_pool_tmeta_rmeta_0]  [cache_pool_tmeta]
  [cache_pool_tmeta_rmeta_1]  [cache_pool_tmeta]
  [lvol0_pmspare]

8 years agocleanup: use _field_set_value and _string_disp consistently in report.c
Peter Rajnoha [Mon, 11 Jan 2016 14:01:35 +0000 (15:01 +0100)]
cleanup: use _field_set_value and _string_disp consistently in report.c

Do not mix dm_report_field_set_value and _field_set_value and
use single function call throughout for clarity. The same applies
for dm_report_field_string and _string_disp.

8 years agoreport: fix invalid memory read when reporting cache LV policy name
Peter Rajnoha [Mon, 11 Jan 2016 11:51:08 +0000 (12:51 +0100)]
report: fix invalid memory read when reporting cache LV policy name

Fix regression caused by commit c2d4330f27277717bc3b684b702189079b257b77
which removed the dm_pool_strdup for the cache policy name in
_cache_policy_disp report function.

This regression was hit with buffered reporting only (which is
used by default). The reason is that for buffered reporting, we're
iterating over LVs in VG (process_each_lv) while gathering
all the information that is needed for the report. In this case,
the LV's cache policy name has not been duped, but only the pointer
to the original VG buffer was stored. When the LV iteration finished,
the VG buffer was freed and any report to output called later
(dm_report_output call) accessed already freed VG data.

This didn't appear if unbuffered reporting was used (--unbuffered)
because in this case, the data were reported to output as
soon as they were processed, hence it was reported to output
before the VG data was freed.

8 years agopost-release
Alasdair G Kergon [Fri, 8 Jan 2016 18:51:08 +0000 (18:51 +0000)]
post-release

8 years agopre-release v2_02_139
Alasdair G Kergon [Fri, 8 Jan 2016 18:46:41 +0000 (18:46 +0000)]
pre-release

8 years agodocument commits since last release
David Teigland [Fri, 8 Jan 2016 15:53:58 +0000 (09:53 -0600)]
document commits since last release

8 years agoman: lvs: document F,D and M thin pool health status chars for lv_attr in lvs man...
Peter Rajnoha [Fri, 8 Jan 2016 14:47:01 +0000 (15:47 +0100)]
man: lvs: document F,D and M thin pool health status chars for lv_attr in lvs man page

8 years agolvmdump: also add lvm2-activation{-early,-net}.service systemd status for lvmdump -s
Peter Rajnoha [Mon, 4 Jan 2016 14:10:07 +0000 (15:10 +0100)]
lvmdump: also add lvm2-activation{-early,-net}.service systemd status for lvmdump -s

The lvm2-activation{-early,-net}.service systemd unit statuses were missing
in dump gathered by lvmdump -s. These are quite important when debugging
scenarios with systemd environment and where lvmetad is not used.

9 years agolvmlockd: update VG lock version earlier
David Teigland [Tue, 15 Dec 2015 22:14:49 +0000 (16:14 -0600)]
lvmlockd: update VG lock version earlier

Have commands send lvmlockd the update message
in vg_write instead of vg_commit, so that it's
not done while LVs are suspended.  If the vg_write
is not committed, and the seqno sent to lvmlockd
is not used, then lvmlockd can detect this when
the next update uses the same seqno.

9 years agovgrename: use process_each_vg
David Teigland [Tue, 1 Dec 2015 20:09:01 +0000 (14:09 -0600)]
vgrename: use process_each_vg

Use process_each_vg() to lock and read the old VG,
and then call the main vgrename code.

When real VG names are used (not a UUID in place of the
old name), the command still pre-locks the new name
(when strcmp wants it locked first), before calling
process_each_vg on the old name.

In the case where the old name is replaced with a UUID,
process_each_vg now translates that UUID into the real
VG name, which it locks and reads.  In this case, we
cannot do pre-locking to maintain lock ordering because
the old name is unknown.  So, in this case the strcmp
based lock ordering is suppressed and the old name is
always locked first.  This opens a remote chance for
lock ordering conflict between racing vgrenames between
two names where one or both commands use the UUID.

9 years agopvscan: Remove duplicate filter wipe.
Alasdair G Kergon [Mon, 14 Dec 2015 20:14:59 +0000 (20:14 +0000)]
pvscan: Remove duplicate filter wipe.

Also always clear the internal lvmcache after rescanning, and
reinstate a test for --trustcache so that 'pvs --trustcache'
(for example) avoids rescanning.

9 years agoprocess_each_pv: do full scan earlier to find new devices
David Teigland [Fri, 11 Dec 2015 20:02:36 +0000 (14:02 -0600)]
process_each_pv: do full scan earlier to find new devices

Before commit c1f246fedfc349c25749da501e68a7f70bd122b0,
_get_all_devices() did a full device scan before
get_vgnameids() was called.  The full scan in
_get_all_devices() is from calling dev_iter_create(f, 1).
The '1' arg forces a full scan.

By doing a full scan in _get_all_devices(), new devices
were added to dev-cache before get_vgnameids() began
scanning labels.  So, labels would be read from new devices.
(e.g. by the first 'pvs' command after the new device appeared.)

After that commit, _get_all_devices() was called
after get_vgnameids() was finished scanning labels.
So, new devices would be missed while scanning labels.
When _get_all_devices() saw the new devices (after
labels were scanned), those devices were added to
the .cache file.  This meant that the second 'pvs'
command would see the devices because they would be
in .cache.

Now, the full device scan is factored out of
_get_all_devices() and called by itself at the
start of the command so that new devices will
be known before get_vgnameids() scans labels.

9 years agopost-release
Alasdair G Kergon [Mon, 14 Dec 2015 12:25:48 +0000 (12:25 +0000)]
post-release

9 years agopre-release v2_02_138
Alasdair G Kergon [Mon, 14 Dec 2015 12:24:21 +0000 (12:24 +0000)]
pre-release

9 years agoChange messages from verbose to debug
David Teigland [Fri, 11 Dec 2015 21:28:46 +0000 (15:28 -0600)]
Change messages from verbose to debug

These messages about outdated PVs should not
be verbose because they always appear, even
when there are no outdated PVs.

9 years agocleanup: add missing WHATS_NEW
Zdenek Kabelac [Fri, 11 Dec 2015 19:13:20 +0000 (20:13 +0100)]
cleanup: add missing WHATS_NEW

9 years agotests: check lvrename of stacked cache pool
Zdenek Kabelac [Fri, 11 Dec 2015 19:11:11 +0000 (20:11 +0100)]
tests: check lvrename of stacked cache pool

9 years agofix static linking
Riku Voipio [Tue, 8 Dec 2015 14:40:08 +0000 (16:40 +0200)]
fix static linking

Static linking fails currently, as -lm and -lpthread are missing:

gcc -O2  -fPIC -O2  -L../libdm -L../lib -L../libdaemon/client -static
-L../libdm/ioctl \
      -o dmsetup.static dmsetup.o -ldevmapper    -lrt
../libdm/ioctl/libdevmapper.a(libdm-stats.o): In function
`dm_stats_create_region':
libdm-stats.c:(.text+0x2d69): undefined reference to `log10'
libdm-stats.c:(.text+0x2d6e): undefined reference to `lround'
../libdm/ioctl/libdevmapper.a(pool.o): In function `dm_pool_create':
pool.c:(.text+0x134): undefined reference to `pthread_mutex_lock'
pool.c:(.text+0x14f): undefined reference to `pthread_mutex_unlock'

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
9 years agotests: fix logging
Zdenek Kabelac [Thu, 10 Dec 2015 19:47:30 +0000 (20:47 +0100)]
tests: fix logging

Actually  file redirection must be before stderr redir.

9 years agolvrename: always allow to rename pools
Zdenek Kabelac [Wed, 9 Dec 2015 12:52:47 +0000 (13:52 +0100)]
lvrename: always allow to rename pools

Since we mark cache-pool as 'hidden/private' while it is in-use,
we may still allow user to change it's name.

It should not cause any harm and user may prefer better naming
for a cache-pool in use.

9 years agocache: support stacked rename
Zdenek Kabelac [Mon, 7 Dec 2015 12:53:00 +0000 (13:53 +0100)]
cache: support stacked rename

Preserve skip_pool flag when running for_each_sub_lv() so
lvrename continues to work when thin-pool is using cached
data LV.

9 years agolvmlockd: reconnect to lvmetad if it's restarted
David Teigland [Thu, 10 Dec 2015 16:50:19 +0000 (10:50 -0600)]
lvmlockd: reconnect to lvmetad if it's restarted

If lvmetad is restarted after lvmlockd has connected
to it, then lvmlockd should reconnect.

9 years agolvrename: move the lvmlockd LV lock
David Teigland [Wed, 9 Dec 2015 17:51:25 +0000 (11:51 -0600)]
lvrename: move the lvmlockd LV lock

The function it was in is used for various
internal renaming of hidden LVs where a lock
from lvmlockd does not apply.

9 years agodmeventd: Don't trust fifo with wrong attrs.
Alasdair G Kergon [Tue, 8 Dec 2015 01:48:17 +0000 (01:48 +0000)]
dmeventd: Don't trust fifo with wrong attrs.

If an existing fifo has the wrong attributes it cannot be trusted
so we must unlink it and recreate it correctly.
(Replaces 2c8d6f5c90d5be62b48ba2881f2a6631091dc5af: if the other end of
the fifo already got opened while its mode was insecure, delaying the
chmod isn't going to make any difference!)

9 years agodmeventd: Extend checks on client socket.
Alasdair G Kergon [Tue, 8 Dec 2015 00:54:32 +0000 (00:54 +0000)]
dmeventd: Extend checks on client socket.

Reinstate and extend checks removed by e1b111b02accb4145b82b8b47ce57ed93b1a7184.

The code has always assumed that only root has access to the directory
containing the fifos and that they are under the complete control of
dmeventd code.  If anything is found not to be as expected, then open()
should certainly not be attempted!

9 years agopost-release
Alasdair G Kergon [Sat, 5 Dec 2015 15:36:22 +0000 (15:36 +0000)]
post-release

9 years agopre-release v2_02_137
Alasdair G Kergon [Sat, 5 Dec 2015 15:33:19 +0000 (15:33 +0000)]
pre-release

9 years agotests: extend test
Zdenek Kabelac [Fri, 4 Dec 2015 21:09:05 +0000 (22:09 +0100)]
tests: extend test

9 years agoarchiver: fix reporting for check_current_backup
Zdenek Kabelac [Fri, 4 Dec 2015 21:04:14 +0000 (22:04 +0100)]
archiver: fix reporting for check_current_backup

It's getting a bit more complex here.

Basic idea behind is - check_current_backup() should not
log error when a user is using a read-only filesystem,
so e.g.  vgscan  will not report any error when it tries
to take missing backup.

We still have cases when error could be reported though,
e.g. the backup this would be a symbolic link, but these
are rather misconfiguration and unexpected case.

9 years agodebug: correct stack tracing
Zdenek Kabelac [Fri, 4 Dec 2015 21:02:24 +0000 (22:02 +0100)]
debug: correct stack tracing

Here the 'goto' is correct path, as  !device_is_usable
is traceable with <backtrace>.

Keep the 'stack' for unusable device.

9 years agolibdm: add some doc for mirror status
Zdenek Kabelac [Fri, 4 Dec 2015 19:24:47 +0000 (20:24 +0100)]
libdm: add some doc for mirror status

Comment content of struct for mirror status.

9 years agolvconvert: Reinstate raid merge after splitmirror.
Alasdair G Kergon [Thu, 3 Dec 2015 17:40:10 +0000 (17:40 +0000)]
lvconvert: Reinstate raid merge after splitmirror.

After commit 46c8d6bb8ae91ee67c8633496cc6c3d92bb4f3ce
(lvconvert: Improve message for raid without -m)

9 years agotests: check read-only backup archive
Zdenek Kabelac [Thu, 3 Dec 2015 17:16:07 +0000 (18:16 +0100)]
tests: check read-only backup archive

9 years agovgextend: reinstantiate archiving
Zdenek Kabelac [Thu, 3 Dec 2015 17:15:02 +0000 (18:15 +0100)]
vgextend: reinstantiate archiving

Since commit f5d06efbab4c7c77298b18b95c23111575a8db1a we lost archiving.
Restore it now with process_each_vg.

9 years agocleanup: drop log_suppress(2) usage
Zdenek Kabelac [Thu, 3 Dec 2015 16:51:43 +0000 (17:51 +0100)]
cleanup: drop log_suppress(2) usage

No longer need to use  log_suppress(2) instance so dropped.

9 years agoarchiver: inital change toward proper logging
Zdenek Kabelac [Thu, 3 Dec 2015 16:32:47 +0000 (17:32 +0100)]
archiver: inital change toward proper logging

We have to modes of  'archive()' usage -
1. compulsory - fail stops command and user may try '-An' option
to do a command.

2. non-compulsory - some fails in archiving are ignorable (i.e.
read-only filesystem where archive dir is located).

Those 2 cases needs to be properly handle - i.e. the non-compulsory
logging should not be tampering  error logging message production.

So more work here is needed

9 years agolog: use full buffer size for printf
Zdenek Kabelac [Thu, 3 Dec 2015 14:28:01 +0000 (15:28 +0100)]
log: use full buffer size for printf

Pass full buffer size to printf() function - no reason to make
buffer 1 char smaller.

Also rename locn buffer to message buffer directly since it's
not used for anything else.

TODO: we may use same buffer also for 'buf[]' since there is
no collision - so may safe 1K on stack usage.

9 years agocleanup: use try_id_read_format
Zdenek Kabelac [Thu, 3 Dec 2015 14:26:44 +0000 (15:26 +0100)]
cleanup: use try_id_read_format

Better then using log_suppress in this case.

9 years agouuid: add id_read_format_try
Zdenek Kabelac [Thu, 3 Dec 2015 14:25:09 +0000 (15:25 +0100)]
uuid: add id_read_format_try

Provide id_read_format() functionality without log_error
when ID is not valid one - it will just return 0.

Does not need to use log_suppress() then.

9 years agolvconvert: Reinstate mirror to raid conversions.
Alasdair G Kergon [Thu, 3 Dec 2015 14:40:14 +0000 (14:40 +0000)]
lvconvert: Reinstate mirror to raid conversions.

Reinstate conversions from mirror to raid stopped
by commit 46c8d6bb8ae91ee67c8633496cc6c3d92bb4f3ce
(lvconvert: Improve message for raid without -m).

9 years agoman lvm: add section about unique VG names
David Teigland [Wed, 2 Dec 2015 16:37:25 +0000 (10:37 -0600)]
man lvm: add section about unique VG names

9 years agotoollib: only interpret vgname arg as uuid for vgrename
David Teigland [Tue, 1 Dec 2015 21:50:14 +0000 (15:50 -0600)]
toollib: only interpret vgname arg as uuid for vgrename

In general, --select should be used to specify a VG by UUID,
but vgrename already allows a uuid to be substituted for
the name, so continue to allow it in that case.

9 years agotoollib: allow VG UUID to be used in place of VG name
David Teigland [Tue, 1 Dec 2015 18:00:57 +0000 (12:00 -0600)]
toollib: allow VG UUID to be used in place of VG name

If the VG arg from the command line does not match the
name of any known VGs, then check if the arg looks like
a UUID.  If it's a valid UUID, then compare it to the
UUID of known VGs.  If it matches the UUID of a known VG,
then process that VG.

9 years agolvresize: use process_each_vg
David Teigland [Tue, 1 Dec 2015 17:01:26 +0000 (11:01 -0600)]
lvresize: use process_each_vg

No functional change.

9 years agolvrename: use process_each_vg
David Teigland [Tue, 1 Dec 2015 15:54:33 +0000 (09:54 -0600)]
lvrename: use process_each_vg

No functional change.

9 years agolvcreate: use process_each_vg
David Teigland [Mon, 30 Nov 2015 23:32:49 +0000 (17:32 -0600)]
lvcreate: use process_each_vg

No functional change.

9 years agovgextend: pass single vgname as process_each_vg arg
David Teigland [Mon, 30 Nov 2015 23:00:26 +0000 (17:00 -0600)]
vgextend: pass single vgname as process_each_vg arg

Pass the single vgname as a new process_each_vg arg
instead of setting a cmd flag to tell process_each_vg
to take only the first vgname arg from argv.

Other commands with different argv formats will be
able to use it this way.

9 years agolvmcache: change duplicate VG name warnings to verbose
David Teigland [Mon, 30 Nov 2015 21:28:22 +0000 (15:28 -0600)]
lvmcache: change duplicate VG name warnings to verbose

When two different VGs with the same name exist,
they are both stored in lvmcache using the vginfo->next
list.  Previously, the code would print warnings (sometimes)
when adding VGs to this list.  Now the duplicate VG names
are handled by higher level code, so this list no longer
needs to print warnings about duplicate VG names being found.

9 years agovg_read: look up vgid from name
David Teigland [Mon, 30 Nov 2015 21:12:01 +0000 (15:12 -0600)]
vg_read: look up vgid from name

After recent changes to process_each, vg_read() is usually
given both the vgname and vgid for the intended VG.

However, in some cases vg_read() is given a vgid with
no vgname, or is given a vgname with no vgid.

When given a vgid with no vgname, vg_read() uses lvmcache
to look up the vgname using the vgid.  If the vgname is
not found, vg_read() fails.

When given a vgname with no vgid, vg_read() should also
use lvmcache to look up the vgid using the vgname.
If the vgid is not found, vg_read() fails.

If the lvmcache lookup finds multiple vgids for the
vgname, then the lookup fails, causing vg_read() to fail
because the intended VG is uncertain.

Usually, both vgname and vgid for the intended VG are passed
to vg_read(), which means the lvmcache translations
between vgname and vgid are not done.

9 years agotoollib: remove unused function
David Teigland [Mon, 30 Nov 2015 20:17:33 +0000 (14:17 -0600)]
toollib: remove unused function

9 years agoprocess_each: resolve duplicate VG names
David Teigland [Mon, 30 Nov 2015 18:11:01 +0000 (12:11 -0600)]
process_each: resolve duplicate VG names

If two different VGs with the same name exist on the system,
a command that just specifies that ambiguous name will fail
with a new error:

$ vgs -o name,uuid
  ...
  foo qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf
  foo vfhKCP-mpc7-KLLL-Uh08-4xPG-zLNR-4cnxJX

$ lvs foo
  Multiple VGs found with the same name: foo
  Use the --select option with VG UUID (vg_uuid).

$ vgremove foo
  Multiple VGs found with the same name: foo
  Use the --select option with VG UUID (vg_uuid).

$ lvs -S vg_uuid=qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf
  lv1 foo ...

This is implemented for process_each_vg/lv, and works
with or without lvmetad.  It does not work for commands
that do not use process_each.

This change includes one exception to the behavior shown
above.  If one of the VGs is foreign, and the other is not,
then the command assumes that the intended VG is the local
one and uses it.

9 years agoprocess_each: always use list of vgnames on system
David Teigland [Mon, 30 Nov 2015 18:51:44 +0000 (12:51 -0600)]
process_each: always use list of vgnames on system

This makes process_each_vg/lv always use the list of
vgnames on the system.  When specific VGs are named on
the command line, the corresponding entries from
vgnameids_on_system are moved to vgnameids_to_process.

Previously, when specific VGs were named on the command
line, the vgnameids_on_system list was not created, and
vgnameids_to_process was created from the arg_vgnames
list (which is only names, without vgids).

Now, vgnameids_on_system is always created, and entries
are moved from that list to vgnameids_to_process -- either
some (when arg_vgnames specifies only some), or all (when
the command is processing all VGs, or needs to look at
all VGs for checking tags/selection).

This change adds one new lvmetad lookup (vg_list) to a
command that specifies VG names.  It adds no new work
for other commands, e.g. non-lvmetad commands, or
commands that look at all VGs.

When using lvmetad, 'lvs foo' previously sent one
request to lvmetad: 'vg_lookup foo'.
Now, 'lvs foo' sends two requests to lvmetad:
'vg_list' and 'vg_lookup foo <uuid>'.

(The lookup can now always include the uuid in the request
because the initial vg_list contains name/vgid pairs.)

9 years agomirror: fix condition
Zdenek Kabelac [Tue, 1 Dec 2015 12:59:20 +0000 (13:59 +0100)]
mirror: fix condition

Recent patch tested wrong condition for error

9 years agocleanup: use dm_get_status_mirror
Zdenek Kabelac [Mon, 30 Nov 2015 20:17:25 +0000 (21:17 +0100)]
cleanup: use dm_get_status_mirror

Use libdm function to parse mirror status report.

9 years agolib: pass mem pool to check_transient_status
Zdenek Kabelac [Mon, 30 Nov 2015 20:24:31 +0000 (21:24 +0100)]
lib: pass mem pool to check_transient_status

check_transient_status() may need to allocate some memory,
so pass in already existing mem pool.

9 years agotests: unit test for mirror status
Zdenek Kabelac [Mon, 30 Nov 2015 19:54:52 +0000 (20:54 +0100)]
tests: unit test for mirror status

9 years agolibdm: introduce dm_get_status_mirror
Zdenek Kabelac [Mon, 30 Nov 2015 20:16:43 +0000 (21:16 +0100)]
libdm: introduce  dm_get_status_mirror

Add missing function to parse mirror status.

9 years agolvconvert: Improve message for raid without -m.
Alasdair G Kergon [Mon, 30 Nov 2015 22:36:05 +0000 (22:36 +0000)]
lvconvert: Improve message for raid without -m.

9 years agolvmcache: new function to check if VG is foreign
David Teigland [Mon, 30 Nov 2015 17:54:56 +0000 (11:54 -0600)]
lvmcache: new function to check if VG is foreign

When not using lvmetad, this uses the system_id field in
the cached vginfo structs that are populated during a scan.

When using lvmetad, this requests the VG from lvmetad, and
checks the system_id field in the returned metadata.

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