Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=af330ff842aef4d4…
Commit: af330ff842aef4d473f7dd9e17eb7a066f373528
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2015-10-30 15:35 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2015-10-30 15:35 +0000
annotated tag: v2_02_133 has been created
at af330ff842aef4d473f7dd9e17eb7a066f373528 (tag)
tagging 15a97cc610712efe818f96b9630b72de89a0cf57 (commit)
replaces v2_02_132
Release 2.02.133.
This is a development release that provides us with a checkpoint.
(Any interface changes in this release might be modified further.)
329 files changed, 6524 insertions(+), 4152 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlYzj1YACgkQIoGRwVZ+LBc0rwCeI1s7/WqxlO4EDpeVuAfZvk4x
LyEAniwQZ5fUTo+VBx48GfmqvJHUukOb
=M010
-----END PGP SIGNATURE-----
Alasdair G Kergon (15):
post-release
segtypes: Use SEG_TYPE_NAME_ string constants.
segtypes: Make constants ULL.
style: lv_manip.c changes
segtypes: Add and use new segtype macros.
stripes: Introduce _round_to_stripe_boundary.
alloc: Move _calc_area_multiple.
test: Cope with stripe rounding message change.
libdm: Move status fns from deptree to targets.
raid: Fail if kernel status denominator is zero.
raid: Add metadata dev information to reports.
Revert "log: no file for external logging"
thin: Fix typo in policy threshold message.
device: Tidy DASD CDL format detection code.
pre-release
David Teigland (26):
man lvmthin: use --poolmetadatasize option
lockd: fix changing lock type on VG with pool
lockd: fix rescanning VG metadata
lockd: add debug logging for metadata error
lockd: add VG name to debug logging
config: improve cache_settings description
man lvmcache: updates for mode and policy
lockd: add error message for EEXIST
vgcreate: allow both --shared and --lock-type options
vgcreate: improve error message for multiple lock managers
man lvmsystemd: fix typo
man lvmsystemid: fix typos
Fix segfault when lvmlockd is running but not lvmetad
lvmlockd: use flag to avoid blocking in sanlock_acquire
pvscan: use process_each_pv
libdaemon: allow all debug levels for stderr
libdaemon: fix typo in last log enable commit
man: document possible lvmetad -l values
vg_read: sometimes ignore read errors
vgextend: fix use of the wrong flag
vg_read: remove unused inconsistent check
pvs: fix missing PVs when VG is removed
toollib: fix wrong paren placement
vgs, lvs: ignore error if VG is removed
pvs: don't treat duplicate PVs as missed
New entries for pvs related fixes.
Heinz Mauelshagen (11):
segtypes: Extend flags to 64 bits.
style: Miscellaneous tidying up of metadata/lv*
libdm: Improve raid segment parameter handling.
raid: Fix raid target write_behind parameter.
libdm: fix bogus macro causing false parameter count
raid: Detect whether or not kernel supports raid0.
raid: Add a segtype flag for each raid type.
segtypes: Use flags in raid segtype macros.
raid: Use loop for text uint32_t parameter import.
raid: Introduce DEFAULT_RAID_MAX_IMAGES
raid_manip: fix wrong image size allocation on raid10 "lvconvert --replace ..."
Lidong Zhong (1):
pvcreate: don't support unpartitioned DASD devices with CDL formatted
Marian Csontos (2):
test: Fix timeout handling
cleanup: snapshots of snapshots message
Ondrej Kozina (6):
polldaemon: fix missing mirror in-sync info with lvmpolld
tests: add test for missing mirror in-sync info
lvmetad: add optional timeout option
lvmetad.8.in: update man page with timeout info
tests: add lvmetad shutdown on idle test
tests: replace invalid use of 'fail' with 'die'
Peter Rajnoha (37):
systemd: use {local,remote}-fs-pre.target instead of {local,remote}-fs.target
blkdeactivate: recognize and deactivate MD devices too
report: identify LV hodling sanlock locks as 'private,lockd,sanlock' within lv_role report field
metadata: format_text: provide more detailed error message when metadata too large for PV mda
report: add vg_missing_pv_count field
vgimportclone: cleanup the script and remove dependency on awk, grep, cut and tr
vgimportclone: fix vgimportclone with -n to not add number unnecessarily to base VG name
vgimportclone: make sure there's no prefix in VG name list
tests: test vgimportclone and -n option
wiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1
libdm: add dm_report_compact_given_fields
config: add report/compact_output_cols to control which columns to compact in report output
cleanup: typo in comment: compact_output_fields should be compact-output_cols
conf: regenerate
conf: clarify compact output settings
pvremove: make sure even invalid info is removed from lvmcache on pvremove
lvmcache: update cached info properly when moving from VG to orphan while lvmetad is used
revert: 3d03e504cda6307f692c5879f6850b2e27af7d71: message about VG metadata size vs. PV mda size
metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
metadata: format_text: check VG metadata do not overlap themselves
WHATS_NEW: recent commits
metadata: format_text: better check for metadata overlap
tests: add test for minimum mda size
metadata: format_text: also count with calculated mda size of 0
str_list: also allow memory allocation without memory pool
str_list: add str_list_to_str and str_to_str_list functions
str_list: add str_list_destroy function
refactor: move code detecting report options to a separate function
report: make report options defined by "-o" groupable
report: support "-o -field_name1,field_name2,...."
report: add report_get_field_prefix function
report: recognize known prefix when processing "-o -field_name1,field_name2,..."
report: support "-o #field_name1,field_name2,..."
tests: add report-fields.sh test
man: pvs/vgs/lvs and -o+, -o-, -o#
commands: update command help for -o|--options for reporting commands
WHATS_NEW: reporting commands and -o-/-o+ extension
Zdenek Kabelac (118):
alloc: fix update or area_len
man: update dmsetup and dmstats pages
man: update lvm pages
tests: use proper target name for check
tests: ensure test will not block
cleanup: fix compiler warning
man: fsadm
man: lvcreate continue
tests: check devices with prefix aren't in use
libdm: enforce writethrough mode for cleaner
thin: check for overflown pool earlier
dmeventd: correct ret code for fail
thin: enhance logging
toolcontext: do not change already set dm_log
log: no file for external logging
dmeventd: fix loging report
dmeventd: log all commands with CMD: prefix
libdmevent: add dm_event_log
dmeventd: syslog -> log_xxxxx
dmeventd: use log_ macros in plugins
dmeventd: enable new logging
dmeventd: enable new logging
dmeventd: drop changing logging
dmeventd: add more debug messages
man: dmeventd update
dmeventd: handle snapshot overflow
cleanup: static with _
dmeventd: support logging on stdout
cleanup: more readable code
cleanup: always set nsec
cleanup: remove multilog
cleanup: avoid using private
cleanup: move system defines before structs
cleanup: typo in comment
dmeventd: new initialization of plugin threads
dmeventd: introduce macro for init
dmeventd: use new macros to init mempool
dmeventd: add local mempool for raid and mirror
dmeventd: less locking for snapshot and thin
dmeventd: less locking mirror
dmeventd: rework raid plugin
makefiles: generate Local
makefiles: drop explicit linking
makefiles: src dirs have depth 5
tests: show status in in_sync
tests: better regex check
tests: start logging dmeventd output
tests: wait for initial sync
tests: more extend testing
dmeventd: compilable without DEBUG CFLAG
makefiles: older gcc needs hint with rpath
dmeventd: fix missing '!'
makefiles: switch to rpath-link
thin: enforce local activation when creation new thin
dmeventd: use matching function
lib: better reporting of threshold
memlock: report memlock daemon counter
tools: preselect some setting for memlocked daemons
tools: do not change signals for memlocked daemons
libdm: add dm_hold_control_dev
dmeventd: check for malloc return
dmeventd: lvm2 plugin correctly debug
dmeventd: raid plugin reporting
dmeventd: mirror plugin update
dmeventd: snapshot plugin updates
dmeventd: snapshot plugin device removal
dmeventd: thin plugin update
dmeventd: no registering of 0 event mask
dmeventd: using warning level
dmeventd: move dso handling into single code section
dmeventd: use dm_hold_control_dev
dmeventd: wake up timer when setting new timeout
dmeventd: drop unneded test
dmeventd: minimize locking time for get_imeout
dmeventd: code mode _get_device_status
cleanup: use enums
dmeventd: rework locking code
dmeventd: handle signal from plugin
dmeventd: snapshot plugin unmonitor
dmeventd: debug signals
dmeventd: exit on idle
cleanup: declare vars before code
cleanup: easier to read code
cleanup: drop uneeded header file
cleanup: indents
tests: enable raid test on 4.3
dmeventd: debug error paths
dmeventd: ensure filter is empty
tools: update for lvm2_disable_dmeventd_monitoring
cleanup: gcc warning for old-style
cleanup: fix gcc compile with older pthread
cleanup: drop debug
thin: fix percentage compare
lv_manip: ensure it will fit bellow threshold
libdm: dm_tree_node_size_changed recognizes reduction
dev_manager: enabled no_flush for suspend
dev_manager: no flush for extension
libdm: enable no_flush for driver version > 11
tests: snapshot now respects threshold
dmevent: fix referencing
thin: limit no-flush using only for thin-pool
tests: extend timer for 4 hours
tests: support skip flags
tests: use skip flags
dmeventd: event string parser handles empty field
tests: avoid reading utils when skipping
tests: use more SKIP
tests: using matching type
thin: dmeventd plugin check number of failures
thin: enable usage of kernel low_water_mark
cleanup: easier error messages
cleanup: use same type
cleanup: remove thin low_water_mark from metadata
cleanup: error is not a WARNING
tests: no point in using should
tests: fix wrong line has been commented
tests: let pass bigger readahead
tests: update test for resize
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f1c63c812ba5f79…
Commit: 3f1c63c812ba5f79768f23b8d6d2e2965a458e0e
Parent: dd52721b68a7c393a54149649f518f4e2d9440b5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:50:35 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:50:35 2015 +0100
WHATS_NEW: reporting commands and -o-/-o+ extension
---
WHATS_NEW | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 415efc7..3808cb6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.133 -
======================================
+ Support repeated -o|--options for reporting commands.
+ Support -o- and -o# for reporting commands to remove and compact fields.
Fix missing PVs from pvs output if vgremove is run concurrently.
Remove unwanted error message when running pvs/vgs/lvs and vgremove at once.
Check newly created VG's metadata do not overlap in metadata ring buffer.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b04eda93f903d25…
Commit: 5b04eda93f903d25e25385d148d28b8cfa1157ea
Parent: 77c31d0c39c3ba9caf7a5a70282f1c5a6b0f48e2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:06:49 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
tests: add report-fields.sh test
---
test/shell/report-fields.sh | 91 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 91 insertions(+), 0 deletions(-)
diff --git a/test/shell/report-fields.sh b/test/shell/report-fields.sh
new file mode 100644
index 0000000..e0c7308
--- /dev/null
+++ b/test/shell/report-fields.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+SKIP_WITH_LVMETAD=1
+SKIP_WITH_LVMPOLLD=1
+SKIP_WITH_CLVMD=1
+
+. lib/inittest
+
+# Test only that there's correct set of fields displayed on output.
+
+aux prepare_pvs 1
+
+OPTS="--nameprefixes --noheadings --rows"
+
+aux lvmconf 'report/pvs_cols="pv_name,pv_size"'
+aux lvmconf 'report/compact_output=0'
+aux lvmconf 'report/compact_output_cols=""'
+
+pvs $OPTS > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+
+pvs $OPTS -o pv_attr > out
+grep LVM2_PV_ATTR out
+not grep -v LVM2_PV_ATTR out
+
+pvs $OPTS -o+pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+grep LVM2_PV_ATTR out
+
+pvs $OPTS -o-pv_name > out
+not grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+
+pvs $OPTS -o+pv_attr -o-pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+not grep LVM2_PV_ATTR out
+
+pvs $OPTS -o-pv_attr -o+pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+grep LVM2_PV_ATTR out
+
+pvs $OPTS -o+pv_attr -o-pv_attr -o pv_attr > out
+grep LVM2_PV_ATTR out
+not grep -v LVM2_PV_ATTR out
+
+# -o-size is the same as -o-pv_size - the prefix is recognized
+pvs $OPTS -o-size > out
+not grep LVM2_PV_SIZE out
+
+# PV does not have tags nor is it exported if we haven't done that explicitly.
+# Check compaction per field is done correctly.
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_tags > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+aux lvmconf 'report/compact_output_cols="pv_tags"'
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_exported > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+grep LVM2_PV_TAGS out
+
+aux lvmconf 'report/compact_output=1'
+pvs $OPTS -o pv_name,pv_exported,pv_tags > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_exported > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=17196103e018a34e…
Commit: 17196103e018a34eda016f6bdcd74395210cb114
Parent: ccfc09f79b8d7ba15798a2b6f76545bb7fa3681e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 30 09:05:21 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 30 09:05:21 2015 -0500
New entries for pvs related fixes.
---
WHATS_NEW | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 00e807e..415efc7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.133 -
======================================
+ Fix missing PVs from pvs output if vgremove is run concurrently.
+ Remove unwanted error message when running pvs/vgs/lvs and vgremove at once.
Check newly created VG's metadata do not overlap in metadata ring buffer.
Check metadata area size is at least the minimum size defined for the format.
Thin pool targets uses low_water_mark from profile.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ccfc09f79b8d7ba1…
Commit: ccfc09f79b8d7ba15798a2b6f76545bb7fa3681e
Parent: 9a3b64e81ad1988f4143b5a4b4ac06eaf3035e58
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 12:02:29 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 12:02:34 2015 +0100
metadata: format_text: also count with calculated mda size of 0
When checking minimum mda size, make sure the mda_size after alignment
and calculation is more than 0 - if there's no place for an MDA at the
end of the disk, the _text_pv_add_metadata_area does not try to add it
there and it returns (because we already have the MDA at the start of
the disk at least).
---
lib/format_text/format-text.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 29e9bd2..d4f2c89 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -2241,13 +2241,13 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
FMTu64 ").", pv_dev_name(pv),
mda_size, limit_name, limit);
- if (mda_size < MDA_SIZE_MIN) {
- log_error("Metadata area size too small. "
- "It must be at least %u bytes.", MDA_SIZE_MIN);
- goto bad;
- }
-
if (mda_size) {
+ if (mda_size < MDA_SIZE_MIN) {
+ log_error("Metadata area size too small: %" PRIu64" bytes. "
+ "It must be at least %u bytes.", mda_size, MDA_SIZE_MIN);
+ goto bad;
+ }
+
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,
(size_t) ((mda_size > wipe_size) ?
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c2e88d1107c496d2…
Commit: c2e88d1107c496d2c1b39bbbfb9795e88b3a6b60
Parent: 406d8ff3323dde6860d88b603701aa4dace47af0
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 08:57:34 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 08:57:34 2015 +0100
metadata: format_text: better check for metadata overlap
Actually, we don't need extra condition as introduced in commit
00348c0a630a7e5578edf48052ec695b15de752f. We should fix the last
condition:
(mdac->rlocn.size >= mdah->size)
...which should be:
(MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size))
Where the "mdac" is new metadata, the "rlocn" is old metadata.
So the main problem with the previous condition was that it
didn't count in MDA_HEADER_SIZE properly (and possible existing
metadata - the "rlocn"). This could have caused the error state
where metadata in ring buffer overlap to not be hit.
Replace the new condition introduced in 00348c0a630a7e5578edf48052ec695b15de752f
with the improved one for the condition that existed there
already but it was just incomplete.
---
lib/format_text/format-text.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 84d0947..29e9bd2 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -654,8 +654,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
- (!rlocn && new_wrap && (new_end > mdac->rlocn.offset)) ||
- (mdac->rlocn.size >= mdah->size)) {
+ (MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
goto out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=406d8ff3323dde68…
Commit: 406d8ff3323dde6860d88b603701aa4dace47af0
Parent: 00348c0a630a7e5578edf48052ec695b15de752f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 16:50:09 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:50:09 2015 +0100
WHATS_NEW: recent commits
---
WHATS_NEW | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 03c70d6..00e807e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
Version 2.02.133 -
======================================
- Check metadata area size is at least minimum size of 8 * memory page size.
+ Check newly created VG's metadata do not overlap in metadata ring buffer.
+ Check metadata area size is at least the minimum size defined for the format.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00348c0a630a7e55…
Commit: 00348c0a630a7e5578edf48052ec695b15de752f
Parent: ccb8da404d00288b7d49c7a28006ec5d4687bb55
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 16:33:06 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:46:41 2015 +0100
metadata: format_text: check VG metadata do not overlap themselves
We're already checking whether old and new meta do not overlap in
ring buffer (as we need to keep both old and new meta during vg_write
up until vg_commit).
We also need to check whether the new metadata do not overlap
themselves in case we don't have old metadata yet (...because
we're in vgcreate). This could happen if we're creating a VG so
that the very first metadata written are long enough that it wraps
themselves in metadata ring buffer.
Although we limited the minimum metadata area size better with the
previous commit ccb8da404d00288b7d49c7a28006ec5d4687bb55 which
makes the initial VG metadata overlap in ring buffer to be less
probable, the risk of hitting this overlap condition is still there
if we still manage to generate big enough metadata somehow.
For example, users can provide many and/or long VG tags during vgcreate
so that the VG metadata is long enough to start to wrap in the ring
buffer again...
---
lib/format_text/format-text.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 6c653ca..84d0947 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -654,6 +654,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
+ (!rlocn && new_wrap && (new_end > mdac->rlocn.offset)) ||
(mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ccb8da404d00288b…
Commit: ccb8da404d00288b7d49c7a28006ec5d4687bb55
Parent: 28e54032c092ed4a5592575ac716fe698ce75d22
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 15:59:29 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:00:32 2015 +0100
metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
---
WHATS_NEW | 1 +
lib/format_text/format-text.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f453604..03c70d6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Check metadata area size is at least minimum size of 8 * memory page size.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index e0ec8ed..6c653ca 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -2146,7 +2146,6 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
goto bad;
}
/* Otherwise, give up and take any usable space. */
- /* FIXME: We should probably check for some minimum MDA size here. */
else
mda_size = limit - mda_start;
@@ -2242,6 +2241,12 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
FMTu64 ").", pv_dev_name(pv),
mda_size, limit_name, limit);
+ if (mda_size < MDA_SIZE_MIN) {
+ log_error("Metadata area size too small. "
+ "It must be at least %u bytes.", MDA_SIZE_MIN);
+ goto bad;
+ }
+
if (mda_size) {
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f58c63410327c2bc…
Commit: f58c63410327c2bc49b671df4538dee9e90e577d
Parent: 175119fdcd1a8eb23011e4c25d0df5899dfc42ea
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:18:40 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:38:59 2015 +0100
cleanup: error is not a WARNING
Drop 'WARNING' from error message.
It's plain error message leading to command failure.
---
lib/cache/lvmetad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index c7f6ecb..683c87c 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1331,7 +1331,7 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
log_warn("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
baton.fid->fmt->name, dev_name(dev));
else
- log_error("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
+ log_error("Ignoring obsolete format of metadata (%s) on device %s when using lvmetad.",
baton.fid->fmt->name, dev_name(dev));
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5886ff64ebcac8c1…
Commit: 5886ff64ebcac8c1b53c665c598728e481590964
Parent: a4418b34c150299aa88c6540bb4e3680f8bb4dae
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Oct 27 12:03:57 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Oct 27 12:03:57 2015 -0500
pvs: don't treat duplicate PVs as missed
The recent addition to check for PVs that were
missed during the first iteration of processing
was unintentionally catching duplicate PVs because
duplicates were not removed from the all_devices
list when the primary dev was processed.
Also change a message from warn back to verbose.
---
tools/toollib.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 3804d66..42ac71a 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2885,12 +2885,17 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
}
/*
+ * We have processed the PV on device pv->dev. Now
+ * deal with any duplicates of this PV on other
+ * devices.
+ */
+
+ /*
* This is a very rare and obscure case where multiple
* duplicate devices are specified on the command line
* referring to this PV. In this case we want to
* process this PV once for each specified device.
*/
-
if (!skip && !dm_list_empty(arg_devices)) {
while ((dil = _device_list_find_pvid(arg_devices, pv))) {
_device_list_remove(arg_devices, dil->dev);
@@ -2925,7 +2930,6 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
* we want each of them to be displayed in the context
* of this VG, so that this VG name appears next to it.
*/
-
if (process_all_devices && lvmcache_found_duplicate_pvs()) {
while ((dil = _device_list_find_pvid(all_devices, pv))) {
_device_list_remove(all_devices, dil->dev);
@@ -2942,6 +2946,20 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
lvmcache_replace_dev(cmd, pv, dev_orig);
}
}
+
+ /*
+ * Remove any duplicates of the processed device from
+ * the list of all devices. If they were left in the
+ * list of all devices, they would be considered
+ * "missed" at the end.
+ */
+ if (process_all_pvs && lvmcache_found_duplicate_pvs()) {
+ while ((dil = _device_list_find_pvid(all_devices, pv))) {
+ log_very_verbose("Skip duplicate device %s of processed device %s",
+ dev_name(dil->dev), dev_name(pv->dev));
+ _device_list_remove(all_devices, dil->dev);
+ }
+ }
}
/*
@@ -3160,7 +3178,7 @@ int process_each_pv(struct cmd_context *cmd,
dm_list_init(&arg_missed_orig);
_device_list_copy(cmd, &arg_missed, &arg_missed_orig);
- log_warn("Some PVs were not found in first search, retrying.");
+ log_verbose("Some PVs were not found in first search, retrying.");
lvmcache_destroy(cmd, 0, 0);
lvmcache_init();
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a4418b34c150299a…
Commit: a4418b34c150299aa88c6540bb4e3680f8bb4dae
Parent: 65ec00ce202411f6e6f91955ab9422d44bb86a9b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Oct 27 10:52:01 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Oct 27 10:52:01 2015 -0500
vgs, lvs: ignore error if VG is removed
If a VG is removed between the time that 'vgs'
or 'lvs' (with no args) creates the list of VGs
and the time that it reads the VG to process it,
then ignore the removed VG; don't report an error
that it could not be found, since it wasn't named
by the command.
---
tools/toollib.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 59ba29f..3804d66 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1909,7 +1909,7 @@ int select_match_pv(struct cmd_context *cmd, struct processing_handle *handle,
return 1;
}
-static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
+static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t read_flags,
struct dm_list *vgnameids_to_process,
struct dm_list *arg_vgnames,
struct dm_list *arg_tags,
@@ -1952,8 +1952,8 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
continue;
}
- vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
+ vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
+ if (_ignore_vg(vg, vg_name, arg_vgnames, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
@@ -2020,7 +2020,7 @@ static int _copy_str_to_vgnameid_list(struct cmd_context *cmd, struct dm_list *s
* Call process_single_vg() for each VG selected by the command line arguments.
*/
int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
- uint32_t flags, struct processing_handle *handle,
+ uint32_t read_flags, struct processing_handle *handle,
process_single_vg_fn_t process_single_vg)
{
int handle_supplied = handle != NULL;
@@ -2070,6 +2070,9 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
goto out;
}
+ if (dm_list_empty(&arg_vgnames))
+ read_flags |= READ_OK_NOTFOUND;
+
/*
* If we obtained a full list of VGs on the system, we need to work through them all;
* otherwise we can merely work through the VG names provided.
@@ -2086,7 +2089,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
!init_selection_handle(cmd, handle, VGS))
goto_out;
- ret = _process_vgnameid_list(cmd, flags, &vgnameids_to_process,
+ ret = _process_vgnameid_list(cmd, read_flags, &vgnameids_to_process,
&arg_vgnames, &arg_tags, handle, process_single_vg);
out:
if (!handle_supplied)
@@ -2375,7 +2378,7 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
return ret_max;
}
-static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
+static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t read_flags,
struct dm_list *vgnameids_to_process,
struct dm_list *arg_vgnames,
struct dm_list *arg_lvnames,
@@ -2442,8 +2445,8 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
continue;
}
- vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
+ vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
+ if (_ignore_vg(vg, vg_name, arg_vgnames, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
@@ -2471,7 +2474,7 @@ endvg:
/*
* Call process_single_lv() for each LV selected by the command line arguments.
*/
-int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t flags,
+int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t read_flags,
struct processing_handle *handle, process_single_lv_fn_t process_single_lv)
{
int handle_supplied = handle != NULL;
@@ -2538,6 +2541,9 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t fla
goto out;
}
+ if (dm_list_empty(&arg_vgnames))
+ read_flags |= READ_OK_NOTFOUND;
+
/*
* If we obtained a full list of VGs on the system, we need to work through them all;
* otherwise we can merely work through the VG names provided.
@@ -2547,7 +2553,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t fla
else if ((ret = _copy_str_to_vgnameid_list(cmd, &arg_vgnames, &vgnameids_to_process)) != ECMD_PROCESSED)
goto_out;
- ret = _process_lv_vgnameid_list(cmd, flags, &vgnameids_to_process, &arg_vgnames, &arg_lvnames,
+ ret = _process_lv_vgnameid_list(cmd, read_flags, &vgnameids_to_process, &arg_vgnames, &arg_lvnames,
&arg_tags, handle, process_single_lv);
out:
if (!handle_supplied)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=65ec00ce202411f6…
Commit: 65ec00ce202411f6e6f91955ab9422d44bb86a9b
Parent: 6e1e0e881368be6337599dcf7f627f785ebf415c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 27 15:27:52 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 27 15:27:52 2015 +0000
device: Tidy DASD CDL format detection code.
---
lib/device/dev-dasd.c | 85 +++++++++++++++++++++++++++++++++++--------------
1 files changed, 61 insertions(+), 24 deletions(-)
diff --git a/lib/device/dev-dasd.c b/lib/device/dev-dasd.c
index 28156ca..220293e 100644
--- a/lib/device/dev-dasd.c
+++ b/lib/device/dev-dasd.c
@@ -17,7 +17,28 @@
#include "dev-type.h"
#include <sys/ioctl.h>
-typedef struct dasd_information_t {
+#ifdef __linux__
+
+/*
+ * Interface taken from kernel header arch/s390/include/uapi/asm/dasd.h
+ */
+
+/*
+ * Author(s)......: Holger Smolinski <Holger.Smolinski(a)de.ibm.com>
+ * Copyright IBM Corp. 1999, 2000
+ * EMC Symmetrix ioctl Copyright EMC Corporation, 2008
+ * Author.........: Nigel Hislop <hislop_nigel(a)emc.com>
+ */
+
+#define DASD_IOCTL_LETTER 'D'
+#define DASD_API_VERSION 6
+
+/*
+ * struct dasd_information2_t
+ * represents any data about the device, which is visible to userspace.
+ * including foramt and featueres.
+ */
+typedef struct dasd_information2_t {
unsigned int devno; /* S/390 devno */
unsigned int real_devno; /* for aliases */
unsigned int schid; /* S/390 subchannel identifier */
@@ -34,41 +55,57 @@ typedef struct dasd_information_t {
unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
unsigned int characteristics_size;
unsigned int confdata_size;
- unsigned char characteristics[64];/*from read_device_characteristics */
- unsigned char configuration_data[256];/*from read_configuration_data */
+ char characteristics[64]; /* from read_device_characteristics */
+ char configuration_data[256]; /* from read_configuration_data */
unsigned int format; /* format info like formatted/cdl/ldl/... */
- unsigned int features; /* dasd features like 'ro',... */
- unsigned int reserved0; /* reserved for further use ,... */
- unsigned int reserved1; /* reserved for further use ,... */
- unsigned int reserved2; /* reserved for further use ,... */
- unsigned int reserved3; /* reserved for further use ,... */
- unsigned int reserved4; /* reserved for further use ,... */
- unsigned int reserved5; /* reserved for further use ,... */
- unsigned int reserved6; /* reserved for further use ,... */
- unsigned int reserved7; /* reserved for further use ,... */
-} dasd_information_t;
-
-#define DASD_FORMAT_CDL 2
-#define BIODASDINFO2 _IOR('D', 3, dasd_information_t)
+ unsigned int features; /* dasd features like 'ro',... */
+ unsigned int reserved0; /* reserved for further use ,... */
+ unsigned int reserved1; /* reserved for further use ,... */
+ unsigned int reserved2; /* reserved for further use ,... */
+ unsigned int reserved3; /* reserved for further use ,... */
+ unsigned int reserved4; /* reserved for further use ,... */
+ unsigned int reserved5; /* reserved for further use ,... */
+ unsigned int reserved6; /* reserved for further use ,... */
+ unsigned int reserved7; /* reserved for further use ,... */
+} dasd_information2_t;
+
+#define DASD_FORMAT_CDL 2
+
+/* Get information on a dasd device (enhanced) */
+#define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
+
+/*
+ * End of included interface.
+ */
int dasd_is_cdl_formatted(struct device *dev)
{
int ret = 0;
- dasd_information_t dasd_info;
+ dasd_information2_t dasd_info2;
- if (!dev_open_readonly(dev)) {
- stack;
- return ret;
- }
+ if (!dev_open_readonly(dev))
+ return_0;
- if (ioctl(dev->fd, BIODASDINFO2, &dasd_info) != 0)
- goto_out;
+ if (ioctl(dev->fd, BIODASDINFO2, &dasd_info2)) {
+ log_sys_error("ioctl BIODASDINFO2", dev_name(dev));
+ goto out;
+ }
- if (dasd_info.format == DASD_FORMAT_CDL)
+ if (dasd_info2.format == DASD_FORMAT_CDL)
ret = 1;
+
out:
if (!dev_close(dev))
stack;
return ret;
}
+
+#else
+
+int dasd_is_cdl_formatted(struct device *dev)
+{
+ return 0;
+}
+
+#endif
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76cff10a734a7c1e…
Commit: 76cff10a734a7c1e26b3835ff967dac0b7e46bcb
Parent: 1af2ab10d02c2f02891d5047af563651fbe294bb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 27 15:08:43 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 16:00:09 2015 +0100
tests: avoid reading utils when skipping
Save even more CPU/time and avoid reading utils, when skipping test.
---
test/lib/inittest.sh | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index beb0210..6fde23a 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2011-2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2011-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -9,6 +9,11 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+initskip() {
+ test "$#" -eq 0 || echo "TEST SKIPPED: $@"
+ exit 200
+}
+
# sanitize the environment
LANG=C
LC_ALL=C
@@ -20,19 +25,22 @@ TESTNAME=${0##*/}
PS4='#${BASH_SOURCE[0]##*/}:${LINENO}+ '
export TESTNAME PS4
-unset CDPATH
-
-# grab some common utilities
-. lib/utils
-
if test -n "$LVM_TEST_FLAVOUR"; then
. lib/flavour-$LVM_TEST_FLAVOUR
fi
-test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && skip
-test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && skip
-test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && skip
+test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && initskip
+test -n "$SKIP_WITH_CLVMD" && test "$LVM_TEST_LOCKING" -eq 3 && initskip
+test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && initskip
+test -n "$SKIP_WITH_LVMETAD" && test -n "$LVM_TEST_LVMETAD" && initskip
+
+test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && initskip
+
+unset CDPATH
+
+# grab some common utilities
+. lib/utils
TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1af2ab10d02c2f02…
Commit: 1af2ab10d02c2f02891d5047af563651fbe294bb
Parent: 729f489009b4dfc8488265bc64414edcfeae0755
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Oct 22 13:32:52 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 11:42:48 2015 +0100
cleanup: snapshots of snapshots message
No plans to support thick snapshost of snapshots.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 264b3f7..869e506 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 8029dab..8e20dfa 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7248,8 +7248,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
return NULL;
}
if (lv_is_cow(origin_lv)) {
- log_error("Snapshots of snapshots are not "
- "supported yet.");
+ log_error("Snapshots of snapshots are not supported.");
return NULL;
}
if (lv_is_locked(origin_lv)) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=729f489009b4dfc8…
Commit: 729f489009b4dfc8488265bc64414edcfeae0755
Parent: 5d76bdcdbdf6bef81872e8eef2cce156cfce228f
Author: Lidong Zhong <lzhong(a)suse.com>
AuthorDate: Mon Oct 12 15:09:11 2015 +0800
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 11:42:47 2015 +0100
pvcreate: don't support unpartitioned DASD devices with CDL formatted
The former patch(dab3ebce4c7) is a little bit strict. For example, it is
OK to create PV on unpartitioned DASD devices with LDL formatted. So
after lvm version containing the patch, LVs created on those devices
could not be found.
Signed-off-by: Lidong Zhong <lzhong(a)suse.com>
---
WHATS_NEW | 1 +
lib/Makefile.in | 1 +
lib/device/dev-dasd.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/device/dev-type.c | 2 +-
lib/device/dev-type.h | 1 +
5 files changed, 78 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bced219..264b3f7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 3e0e6f8..00014c2 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -62,6 +62,7 @@ SOURCES =\
device/dev-swap.c \
device/dev-type.c \
device/dev-luks.c \
+ device/dev-dasd.c \
display/display.c \
error/errseg.c \
unknown/unknown.c \
diff --git a/lib/device/dev-dasd.c b/lib/device/dev-dasd.c
new file mode 100644
index 0000000..28156ca
--- /dev/null
+++ b/lib/device/dev-dasd.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "lib.h"
+#include "metadata.h"
+#include "dev-type.h"
+#include <sys/ioctl.h>
+
+typedef struct dasd_information_t {
+ unsigned int devno; /* S/390 devno */
+ unsigned int real_devno; /* for aliases */
+ unsigned int schid; /* S/390 subchannel identifier */
+ unsigned int cu_type : 16; /* from SenseID */
+ unsigned int cu_model : 8; /* from SenseID */
+ unsigned int dev_type : 16; /* from SenseID */
+ unsigned int dev_model : 8; /* from SenseID */
+ unsigned int open_count;
+ unsigned int req_queue_len;
+ unsigned int chanq_len; /* length of chanq */
+ char type[4]; /* from discipline.name, 'none' for unknown */
+ unsigned int status; /* current device level */
+ unsigned int label_block; /* where to find the VOLSER */
+ unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
+ unsigned int characteristics_size;
+ unsigned int confdata_size;
+ unsigned char characteristics[64];/*from read_device_characteristics */
+ unsigned char configuration_data[256];/*from read_configuration_data */
+ unsigned int format; /* format info like formatted/cdl/ldl/... */
+ unsigned int features; /* dasd features like 'ro',... */
+ unsigned int reserved0; /* reserved for further use ,... */
+ unsigned int reserved1; /* reserved for further use ,... */
+ unsigned int reserved2; /* reserved for further use ,... */
+ unsigned int reserved3; /* reserved for further use ,... */
+ unsigned int reserved4; /* reserved for further use ,... */
+ unsigned int reserved5; /* reserved for further use ,... */
+ unsigned int reserved6; /* reserved for further use ,... */
+ unsigned int reserved7; /* reserved for further use ,... */
+} dasd_information_t;
+
+#define DASD_FORMAT_CDL 2
+#define BIODASDINFO2 _IOR('D', 3, dasd_information_t)
+
+int dasd_is_cdl_formatted(struct device *dev)
+{
+ int ret = 0;
+ dasd_information_t dasd_info;
+
+ if (!dev_open_readonly(dev)) {
+ stack;
+ return ret;
+ }
+
+ if (ioctl(dev->fd, BIODASDINFO2, &dasd_info) != 0)
+ goto_out;
+
+ if (dasd_info.format == DASD_FORMAT_CDL)
+ ret = 1;
+out:
+ if (!dev_close(dev))
+ stack;
+
+ return ret;
+}
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 1d03024..a66ef95 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -363,7 +363,7 @@ static int _native_dev_is_partitioned(struct dev_types *dt, struct device *dev)
return 0;
/* Unpartitioned DASD devices are not supported. */
- if (MAJOR(dev->dev) == dt->dasd_major)
+ if ((MAJOR(dev->dev) == dt->dasd_major) && dasd_is_cdl_formatted(dev))
return 1;
if (!dev_open_readonly_quiet(dev)) {
diff --git a/lib/device/dev-type.h b/lib/device/dev-type.h
index 2a49b4b..f1d52ca 100644
--- a/lib/device/dev-type.h
+++ b/lib/device/dev-type.h
@@ -59,6 +59,7 @@ int major_is_scsi_device(struct dev_types *dt, int major);
int dev_is_md(struct device *dev, uint64_t *sb);
int dev_is_swap(struct device *dev, uint64_t *signature);
int dev_is_luks(struct device *dev, uint64_t *signature);
+int dasd_is_cdl_formatted(struct device *dev);
/* Signature wiping. */
#define TYPE_LVM1_MEMBER 0x001
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5d76bdcdbdf6bef8…
Commit: 5d76bdcdbdf6bef81872e8eef2cce156cfce228f
Parent: 3b5939bbbb974913db3ff7ac363cc7f1154b894e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 27 11:12:59 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 11:42:40 2015 +0100
dmeventd: event string parser handles empty field
Improve event string parser to avoid unneeded alloc+free.
Daemon talk function uses '-' to mark NULL/missing field.
So restore the NULL pointer back on parser.
This should have made old tools like 'dmevent_tool' work again.
As now 'uuid' or 'dso' could become NULL and then be
properly used in _want_registered_device() function.
Since lvm2 always fill these parameters, this change should
have no effect on lvm2.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 50 +++++++++++++++++++++++++++---------------
2 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index e09ab63..961aec5 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Fix/restore parsing of empty field '-' when processing dmeventd event.
Enhance dm_tree_node_size_changed() to recognize size reduction.
Support exit on idle for dmenventd (1 hour).
Add support to allow unmonitor device from plugin itself.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index d6accbf..42c724b 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -473,34 +473,48 @@ static int _pthread_create_smallstack(pthread_t *t, void *(*fun)(void *), void *
/*
* Fetch a string off src and duplicate it into *ptr.
- * Pay attention to zero-length strings.
+ * Pay attention to zero-length and 'empty' strings ('-').
*/
/* FIXME? move to libdevmapper to share with the client lib (need to
make delimiter a parameter then) */
static int _fetch_string(char **ptr, char **src, const int delimiter)
{
- int ret = 0;
+ int ret = 1;
char *p;
size_t len;
+ *ptr = NULL; /* Empty field returns NULL pointer */
- if ((p = strchr(*src, delimiter)))
- *p = 0;
-
- if ((*ptr = dm_strdup(*src))) {
- if ((len = strlen(*ptr)))
- *src += len;
- else {
- dm_free(*ptr);
- *ptr = NULL;
+ if ((*src)[0] == '-') {
+ /* Could be empty field '-', handle without allocation */
+ if ((*src)[1] == '\0') {
+ (*src)++;
+ goto out;
+ } else if ((*src)[1] == delimiter) {
+ (*src) += 2;
+ goto out;
}
-
- (*src)++;
- ret = 1;
}
- if (p)
- *p = delimiter;
-
+ if ((p = strchr(*src, delimiter))) {
+ if (*src < p) {
+ *p = 0; /* Temporary exit with \0 */
+ if (!(*ptr = dm_strdup(*src))) {
+ log_error("Failed to fetch item %s.", *src);
+ ret = 0; /* Allocation fail */
+ }
+ *p = delimiter;
+ *src = p;
+ }
+ (*src)++; /* Skip delmiter, next field */
+ } else if ((len = strlen(*src))) {
+ /* No delimiter, item ends with '\0' */
+ if (!(*ptr = dm_strdup(*src))) {
+ log_error("Failed to fetch last item %s.", *src);
+ ret = 0; /* Fail */
+ }
+ *src += len + 1;
+ }
+out:
return ret;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba41ee1dc94264f7…
Commit: ba41ee1dc94264f7ac8e61f8b1d56b10225b0d2f
Parent: b702d677477ff6b37678fe2b6c38969792c09359
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 26 21:46:54 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 26 23:57:31 2015 +0100
thin: limit no-flush using only for thin-pool
For this release keep usage of 'noflush' only for thin-volume/pool.
For rest of keep - keep usage of 'noflush' flag purely for
non-resized mirrors.
---
WHATS_NEW | 2 +-
lib/activate/dev_manager.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 80a198a..bced219 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,6 @@
Version 2.02.133 -
======================================
- Enforce flush for suspend only when volume size is reduced.
+ For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index dc6d2fd..964eef5 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3299,6 +3299,13 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
if ((dm_tree_node_size_changed(root) < 0))
dm->flush_required = 1;
+ /* Currently keep the code require flush for any
+ * non 'thin pool/volume, mirror' or with any size change */
+ if (!lv_is_thin_volume(lv) &&
+ !lv_is_thin_pool(lv) &&
+ (!lv_is_mirror(lv) || dm_tree_node_size_changed(root)))
+ dm->flush_required = 1;
+
if (action == ACTIVATE) {
if (!dm_tree_activate_children(root, dlid, DLID_SIZE))
goto_out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6624833839645cbe…
Commit: 6624833839645cbe75af073fd1dd9ab8c78e0d03
Parent: b29593378f41f6dd401fb9582fba1a100f33dbbb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 23 15:09:20 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 26 16:07:12 2015 -0500
pvs: fix missing PVs when VG is removed
PVs could be missing from the 'pvs' output if
their VG was removed at the same time that the
'pvs' command was run. To fix this:
1. If a VG is not found when processed, don't
silently skip the PVs in it, as is done when
the "skip" variable is set.
2. Repeat the VG search if some PVs are not
found on the first search through all VGs.
The second search uses a specific list of
PVs that were missed the first time.
testing:
/dev/sdb is a PV
/dev/sdd is a PV
/dev/sdg is not a PV
each test begins with:
vgcreate test /dev/sdb /dev/sdd
variations to test:
vgremove -f test & pvs
vgremove -f test & pvs -a
vgremove -f test & pvs /dev/sdb /dev/sdd
vgremove -f test & pvs /dev/sdg
vgremove -f test & pvs /dev/sdb /dev/sdg
The pvs command should always display /dev/sdb
and /dev/sdd, either as a part of VG test or not.
The pvs command should always print an error
indicating that /dev/sdg could not be found.
---
tools/toollib.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 116 insertions(+), 9 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index fba075a..843a47b 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -184,14 +184,16 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
* If *skip is 1, it's OK for the caller to read the list of PVs in the VG.
*/
static int _ignore_vg(struct volume_group *vg, const char *vg_name,
- struct dm_list *arg_vgnames, uint32_t read_flags, int *skip)
+ struct dm_list *arg_vgnames, uint32_t read_flags,
+ int *skip, int *notfound)
{
uint32_t read_error = vg_read_error(vg);
+
*skip = 0;
+ *notfound = 0;
if ((read_error & FAILED_NOTFOUND) && (read_flags & READ_OK_NOTFOUND)) {
- read_error &= ~FAILED_NOTFOUND;
- *skip = 1;
+ *notfound = 1;
return 0;
}
@@ -1924,6 +1926,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
int process_all = 0;
/*
@@ -1942,6 +1945,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
if (!lockd_vg(cmd, vg_name, NULL, 0, &lockd_state)) {
ret_max = ECMD_FAILED;
@@ -1949,12 +1953,12 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
}
- if (skip)
+ if (skip || notfound)
goto endvg;
/* Process this VG? */
@@ -2392,6 +2396,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
dm_list_iterate_items(vgnl, vgnameids_to_process) {
if (sigint_caught())
@@ -2400,6 +2405,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
/*
* arg_lvnames contains some elements that are just "vgname"
@@ -2437,13 +2443,12 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
-
}
- if (skip)
+ if (skip || notfound)
goto endvg;
ret = process_each_lv_in_vg(cmd, vg, &lvnames, tags_arg, 0,
@@ -2688,6 +2693,59 @@ static struct device_id_list *_device_list_find_pvid(struct dm_list *devices, st
return NULL;
}
+static int _device_list_copy(struct cmd_context *cmd, struct dm_list *src, struct dm_list *dst)
+{
+ struct device_id_list *dil;
+ struct device_id_list *dil_new;
+
+ dm_list_iterate_items(dil, src) {
+ if (!(dil_new = dm_pool_alloc(cmd->mem, sizeof(*dil_new)))) {
+ log_error("device_id_list alloc failed.");
+ return ECMD_FAILED;
+ }
+
+ dil_new->dev = dil->dev;
+ strncpy(dil_new->pvid, dil->pvid, ID_LEN);
+ dm_list_add(dst, &dil_new->list);
+ }
+
+ return ECMD_PROCESSED;
+}
+
+/*
+ * For each device in arg_devices or all_devices that has a pvid, add a copy of
+ * that device to arg_missed. All PVs (devices with a pvid) should have been
+ * found while processing all VGs (including orphan VGs). But, some may have
+ * been missed if VGs were changing at the same time. This function creates a
+ * list of PVs that still remain in the given list, i.e. were missed the first
+ * time. A second iteration through VGs can look for these explicitly.
+ * (arg_devices is used if specific PVs are being processed; all_devices is
+ * used if all devs are being processed)
+ */
+static int _get_missed_pvs(struct cmd_context *cmd,
+ struct dm_list *devices,
+ struct dm_list *arg_missed)
+{
+ struct device_id_list *dil;
+ struct device_id_list *dil_missed;
+
+ dm_list_iterate_items(dil, devices) {
+ if (!dil->pvid[0])
+ continue;
+
+ if (!(dil_missed = dm_pool_alloc(cmd->mem, sizeof(*dil_missed)))) {
+ log_error("device_id_list alloc failed.");
+ return ECMD_FAILED;
+ }
+
+ dil_missed->dev = dil->dev;
+ strncpy(dil_missed->pvid, dil->pvid, ID_LEN);
+ dm_list_add(arg_missed, &dil_missed->list);
+ }
+
+ return ECMD_PROCESSED;
+}
+
static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_devices,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
@@ -2921,6 +2979,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
dm_list_iterate_items(vgnl, all_vgnameids) {
if (sigint_caught())
@@ -2929,6 +2988,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
if (!lockd_vg(cmd, vg_name, NULL, 0, &lockd_state)) {
ret_max = ECMD_FAILED;
@@ -2936,13 +2996,15 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
- if (_ignore_vg(vg, vg_name, NULL, read_flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, NULL, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
if (!skip)
goto endvg;
/* Drop through to eliminate a clustered VG's PVs from the devices list */
}
+ if (notfound)
+ goto endvg;
/*
* Don't continue when skip is set, because we need to remove
@@ -2982,6 +3044,7 @@ int process_each_pv(struct cmd_context *cmd,
struct dm_list arg_tags; /* str_list */
struct dm_list arg_pvnames; /* str_list */
struct dm_list arg_devices; /* device_id_list */
+ struct dm_list arg_missed; /* device_id_list */
struct dm_list all_vgnameids; /* vgnameid_list */
struct dm_list all_devices; /* device_id_list */
struct device_id_list *dil;
@@ -3009,6 +3072,7 @@ int process_each_pv(struct cmd_context *cmd,
dm_list_init(&arg_tags);
dm_list_init(&arg_pvnames);
dm_list_init(&arg_devices);
+ dm_list_init(&arg_missed);
dm_list_init(&all_vgnameids);
dm_list_init(&all_devices);
@@ -3068,6 +3132,49 @@ int process_each_pv(struct cmd_context *cmd,
if (ret > ret_max)
ret_max = ret;
+ /*
+ * Some PVs may have been missed by the first search if another command
+ * moved them at the same time. Repeat the search for only the
+ * specific PVs missed. lvmcache needs clearing for a fresh search.
+ *
+ * If missed PVs are found in this repeated search, they are removed
+ * from the arg_missed list, but they also need to be removed from the
+ * arg_devices list, otherwise the check at the end will produce an
+ * error, thinking they weren't found. This is the reason for saving
+ * and comparing the original arg_missed list.
+ */
+ if (!process_all_pvs)
+ _get_missed_pvs(cmd, &arg_devices, &arg_missed);
+ else
+ _get_missed_pvs(cmd, &all_devices, &arg_missed);
+
+ if (!dm_list_empty(&arg_missed)) {
+ struct dm_list arg_missed_orig;
+
+ dm_list_init(&arg_missed_orig);
+ _device_list_copy(cmd, &arg_missed, &arg_missed_orig);
+
+ log_warn("Some PVs were not found in first search, retrying.");
+
+ lvmcache_destroy(cmd, 0, 0);
+ lvmcache_init();
+ lvmcache_seed_infos_from_lvmetad(cmd);
+
+ ret = _process_pvs_in_vgs(cmd, read_flags, &all_vgnameids, &all_devices,
+ &arg_missed, &arg_tags, 0, 0,
+ handle, process_single_pv);
+ if (ret != ECMD_PROCESSED)
+ stack;
+ if (ret > ret_max)
+ ret_max = ret;
+
+ /* Devices removed from arg_missed are removed from arg_devices. */
+ dm_list_iterate_items(dil, &arg_missed_orig) {
+ if (!_device_list_find_dev(&arg_missed, dil->dev))
+ _device_list_remove(&arg_devices, dil->dev);
+ }
+ }
+
dm_list_iterate_items(dil, &arg_devices) {
log_error("Failed to find physical volume \"%s\".", dev_name(dil->dev));
ret_max = ECMD_FAILED;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f898cf7539149a54…
Commit: f898cf7539149a54a121b0aae59076c2d647bb37
Parent: 844b00958492224c448b30f89ae5532bb6591fd2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 20:41:19 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:09:31 2015 +0100
dev_manager: no flush for extension
Recognize the target only 'extends' and do not enforce
'flush' in this case. Only the size reduction
still requires flush (so disables usage of no_flush flag).
If some other targets do require flush before suspend,
they have to explicitly ask for it.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 33d11a4..80a198a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Enforce flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 1caa2d7..dc6d2fd 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3296,7 +3296,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
if (!dm_tree_preload_children(root, dlid, DLID_SIZE))
goto_out;
- if (dm_tree_node_size_changed(root))
+ if ((dm_tree_node_size_changed(root) < 0))
dm->flush_required = 1;
if (action == ACTIVATE) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=844b00958492224c…
Commit: 844b00958492224c448b30f89ae5532bb6591fd2
Parent: 9ef820a2a5e174cd08097981d7879e1f4cbded01
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 20:37:39 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:07:37 2015 +0100
dev_manager: enabled no_flush for suspend
While the activation code tries to evaluate which target
really needs flush with suspend and which may go without flush,
it has stayed effectively disabled by original commit:
33f732c5e9493cda4b161a18b3d53885d207e3b8 since here
it only allows to pass non-pvmoving 'mirrors'.
So remove check for mirror LV type and only disable
no_flush for 'pvmove'..
TODO: Looking into history - it also seemed like raid target
would have always required flushing but it's been later
removed without clean explanation.
If some more targets really do need 'no_flush' it should
been handle at their 'level' - since we now stack multiple
targets over itself.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8ca0aa7..33d11a4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index a5ee824..1caa2d7 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3277,7 +3277,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
break;
case SUSPEND:
dm_tree_skip_lockfs(root);
- if (!dm->flush_required && lv_is_mirror(lv) && !lv_is_pvmove(lv))
+ if (!dm->flush_required && !lv_is_pvmove(lv))
dm_tree_use_no_flush_suspend(root);
/* Fall through */
case SUSPEND_WITH_LOCKFS:
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9ef820a2a5e174cd…
Commit: 9ef820a2a5e174cd08097981d7879e1f4cbded01
Parent: 40eea582aea512db7fceafd8559bf66df0733b55
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 19:27:09 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:05:15 2015 +0100
libdm: dm_tree_node_size_changed recognizes reduction
Add more functionality to size_changed function.
While 'existing' API only detected 0 for
unchanged, and !0 for changed,
new improved API will also detected if the
size has only went bigger - or there was
size reduction.
Function work for the whole dm-tree - so
no change is size is always 0.
only size extension 1.
and if some size reduction is there - returns -1.
This result can be used for better evaluation
whether we need to flush before suspend.
---
WHATS_NEW_DM | 1 +
libdm/.exported_symbols.Base | 1 -
libdm/.exported_symbols.DM_1_02_110 | 1 +
libdm/libdevmapper.h | 5 +++++
libdm/libdm-deptree.c | 25 ++++++++++++++++++++++---
5 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 910f6d6..e09ab63 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Enhance dm_tree_node_size_changed() to recognize size reduction.
Support exit on idle for dmenventd (1 hour).
Add support to allow unmonitor device from plugin itself.
New design for thread co-operation in dmeventd.
diff --git a/libdm/.exported_symbols.Base b/libdm/.exported_symbols.Base
index f9c3cb1..27fef53 100644
--- a/libdm/.exported_symbols.Base
+++ b/libdm/.exported_symbols.Base
@@ -262,7 +262,6 @@ dm_tree_node_set_thin_external_origin
dm_tree_node_set_thin_pool_discard
dm_tree_node_set_thin_pool_error_if_no_space
dm_tree_node_set_udev_flags
-dm_tree_node_size_changed
dm_tree_preload_children
dm_tree_retry_remove
dm_tree_set_cookie
diff --git a/libdm/.exported_symbols.DM_1_02_110 b/libdm/.exported_symbols.DM_1_02_110
index da742ee..eba5625 100644
--- a/libdm/.exported_symbols.DM_1_02_110
+++ b/libdm/.exported_symbols.DM_1_02_110
@@ -1,2 +1,3 @@
dm_report_compact_given_fields
dm_hold_control_dev
+dm_tree_node_size_changed
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 08b24fe..f7ab257 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1256,6 +1256,11 @@ const char *dm_tree_node_get_name(const struct dm_tree_node *node);
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
void *dm_tree_node_get_context(const struct dm_tree_node *node);
+/*
+ * Returns 0 when node size and its children is unchanged.
+ * Returns 1 when node or any of its children has increased size.
+ * Rerurns -1 when node or any of its children has reduced size.
+ */
int dm_tree_node_size_changed(const struct dm_tree_node *dnode);
/*
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index afdce8d..d7e2143 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -220,7 +220,7 @@ struct load_properties {
uint32_t read_ahead_flags;
unsigned segment_count;
- unsigned size_changed;
+ int size_changed;
struct dm_list segs;
const char *new_name;
@@ -2729,7 +2729,8 @@ static int _load_node(struct dm_tree_node *dnode)
existing_table_size = dm_task_get_existing_table_size(dmt);
if ((dnode->props.size_changed =
- (existing_table_size == seg_start) ? 0 : 1)) {
+ (existing_table_size == seg_start) ? 0 :
+ (existing_table_size > seg_start) ? -1 : 1)) {
/*
* Kernel usually skips size validation on zero-length devices
* now so no need to preload them.
@@ -2825,8 +2826,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
}
/* Propagate device size change change */
- if (child->props.size_changed)
+ if (child->props.size_changed > 0 && !dnode->props.size_changed)
dnode->props.size_changed = 1;
+ else if (child->props.size_changed < 0)
+ dnode->props.size_changed = -1;
/* Resume device immediately if it has parents and its size changed */
if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed)
@@ -3853,3 +3856,19 @@ void dm_tree_node_set_callback(struct dm_tree_node *dnode,
dnode->callback = cb;
dnode->callback_data = data;
}
+
+/*
+ * Backward compatible dm_tree_node_size_changed() implementations.
+ *
+ * Keep these at the end of the file to avoid adding clutter around the
+ * current dm_tree_node_size_changed() version.
+ */
+#if defined(__GNUC__)
+int dm_tree_node_size_changed_base(const struct dm_tree_node *dnode);
+DM_EXPORT_SYMBOL_BASE(dm_tree_node_size_changed);
+int dm_tree_node_size_changed_base(const struct dm_tree_node *dnode)
+{
+ /* Base does not make difference between smaller and bigger */
+ return dm_tree_node_size_changed(dnode) ? 1 : 0;
+}
+#endif
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b780d329aa9ce249…
Commit: b780d329aa9ce249bf5164154c81cefd9b276970
Parent: 8f269697d21035035ffb4954f31bd702a6dd7ca8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 19:13:53 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:01:54 2015 +0100
thin: fix percentage compare
Since plugin's percentage compare has been fixed,
it's now revealed wrong compare here.
The logic for threshold is - to allow to go as high
as given value e.g. 80% - so if pool is exactlu 80%
full it's still allowed to use it (dmeventd will not
resize it).
---
WHATS_NEW | 1 +
lib/metadata/thin_manip.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5911c64..0495e46 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Correct percentage evaluation when checking thin-pool over threshold.
Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
Fix lvmcache to not cache even invalid info about PV which got removed.
Support checking of memlock daemon counter.
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 37bf4cb..6b22ce5 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -224,7 +224,7 @@ int pool_below_threshold(const struct lv_segment *pool_seg)
if (!lv_thin_pool_percent(pool_seg->lv, 0, &percent))
return_0;
- if (percent >= threshold) {
+ if (percent > threshold) {
log_debug("Threshold configured for free data space in "
"thin pool %s has been reached (%.2f%% >= %.2f%%).",
display_lvname(pool_seg->lv),
@@ -237,7 +237,7 @@ int pool_below_threshold(const struct lv_segment *pool_seg)
if (!lv_thin_pool_percent(pool_seg->lv, 1, &percent))
return_0;
- if (percent >= threshold) {
+ if (percent > threshold) {
log_debug("Threshold configured for free metadata space in "
"thin pool %s has been reached (%.2f%% > %.2f%%).",
display_lvname(pool_seg->lv),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8f269697d2103503…
Commit: 8f269697d21035035ffb4954f31bd702a6dd7ca8
Parent: 98d81a43ea31ec963a36b8610f3b5a9be28b4cc1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 23 12:19:11 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 23 12:19:11 2015 -0500
vg_read: remove unused inconsistent check
Commit 1a74171ca5682a684d0e05c6090c3d33cab8795b added
a check to ignore a VG that was FAILED_INCONSISTENT
if the command doesn't care if the VG is not found.
Remove that check because that case is never reached
by the current code.
---
tools/toollib.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 39bf0ac..fba075a 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -195,12 +195,6 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
return 0;
}
- if ((read_error & FAILED_INCONSISTENT) && (read_flags & READ_OK_NOTFOUND)) {
- read_error &= ~FAILED_INCONSISTENT;
- *skip = 1;
- return 0;
- }
-
if ((read_error & FAILED_INCONSISTENT) && (read_flags & READ_ALLOW_INCONSISTENT))
read_error &= ~FAILED_INCONSISTENT; /* Check for other errors */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3a42c13ccf151c3a…
Commit: 3a42c13ccf151c3afdeab362c8541b5d249fb01e
Parent: 8b965bd3d5df808aef2012494602cc0cf73d7398
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 23 15:05:48 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 23 15:58:31 2015 +0200
lvmcache: update cached info properly when moving from VG to orphan while lvmetad is used
When lvmetad is used and lvmcache update function (lvmcache_update_vgname_and_id)
was called to update existing lvmcache records, a condition was met
which made to retun from the update function immediately, effectively
making it NOOP.
It seems there's no reason for such condition and lvmcache should be
update appropriately even when lvmetad used as lvmcache may be reused,
most notably in lvm shell.
It's possible this is a remnant of the lvmetad development code which
didn't get removed for some reason and the bug didn't get spotted
because lvm shell is not used often (the condition dates back to 2012
or so).
Example, lvmetad and lvm shell used:
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda vg lvm2 a-- 124.00m 124.00m
Before this patch:
==================
lvm> vgremove vg
Volume group "vg" successfully removed
lvm> pvs
With this patch applied:
========================
lvm> vgremove vg
Volume group "vg" successfully removed
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
---
WHATS_NEW | 1 +
lib/cache/lvmcache.c | 4 ----
2 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6462e18..5911c64 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
Fix lvmcache to not cache even invalid info about PV which got removed.
Support checking of memlock daemon counter.
Allow all log levels to be used with the lvmetad -l option.
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 1bc4241..31f2aa9 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1542,10 +1542,6 @@ int lvmcache_update_vgname_and_id(struct lvmcache_info *info, struct lvmcache_vg
vgid = vgname;
}
- /* When using lvmetad, the PV could not have become orphaned. */
- if (lvmetad_active() && is_orphan_vg(vgname) && info->vginfo)
- return 1;
-
/* If PV without mdas is already in a real VG, don't make it orphan */
if (is_orphan_vg(vgname) && info->vginfo &&
mdas_empty_or_ignored(&info->mdas) &&
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b965bd3d5df808a…
Commit: 8b965bd3d5df808aef2012494602cc0cf73d7398
Parent: 1a7bea0f0f187a3d3332dda2cca2ecd0300b8031
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 23 14:11:16 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 23 15:48:06 2015 +0200
pvremove: make sure even invalid info is removed from lvmcache on pvremove
The lvmcache info might be resued, most notably in lvm shell.
We need to be sure that even lvmcache_info marked as invalid
is removed from the lvmcache so it does not confuse any subsequent
code/commands executed later on.
Problematic example with the lvm shell:
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
Before this patch (/dev/sda still displayed in a way):
======================================================
lvm> pvremove /dev/sda
Labels on physical volume "/dev/sda" successfully wiped
(without lvmetad)
lvm> pvs
No physical volume label read from /dev/sda
(with lvmetad)
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
With this patch applied:
========================
lvm> pvremove /dev/sda
Labels on physical volume "/dev/sda" successfully wiped
(without lvmetad)
lvm> pvs
(with lvmetad)
lvm> pvs
---
WHATS_NEW | 1 +
lib/metadata/pv_manip.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8ffbeca..6462e18 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix lvmcache to not cache even invalid info about PV which got removed.
Support checking of memlock daemon counter.
Allow all log levels to be used with the lvmetad -l option.
Add optional shutdown when idle support for lvmetad.
diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c
index ce7f661..e48fe42 100644
--- a/lib/metadata/pv_manip.c
+++ b/lib/metadata/pv_manip.c
@@ -781,7 +781,7 @@ int pvremove_single(struct cmd_context *cmd, const char *pv_name,
goto out;
}
- info = lvmcache_info_from_pvid(dev->pvid, 1);
+ info = lvmcache_info_from_pvid(dev->pvid, 0);
if (!dev_test_excl(dev)) {
/* FIXME Detect whether device-mapper is still using the device */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87a39d8bac572b67…
Commit: 87a39d8bac572b67f927dad41548155606a50f4f
Parent: cff1c728d8c80b3393c461f6229066f633b67fc2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 23 09:43:21 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 23 10:54:13 2015 +0200
dmeventd: ensure filter is empty
On some error path we could have left filter set to some value.
Not a big issue - but lets make reporting correct as soon
as we can.
---
daemons/dmeventd/dmeventd.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index af03091..949fcf4 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -936,6 +936,7 @@ static void _monitor_unregister(void *arg)
break;
}
+ thread->events = 0; /* Filter is now empty */
thread->pending = 0; /* Event pending resolved */
thread->processing = 1; /* Process unregistering */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2786cd27da3e7c61…
Commit: 2786cd27da3e7c6176940495ba57653ead7cfe08
Parent: 1a2d0a0c729e80e4cd122532829f3a11e6566823
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 22 16:51:18 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 22 22:46:10 2015 +0200
tests: enable raid test on 4.3
With kernel -rc6 it's passing our raid tests again - so enable
it in tests.
Note: related only to Fedora rawhide kernels...
---
test/lib/aux.sh | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 8a25d87..3f99357 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1112,9 +1112,8 @@ have_raid() {
# some kernels have broken mdraid bitmaps, don't use them!
# may oops kernel, we know for sure all FC24 are currently broken
# in general any 4.1, 4.2 is likely useless unless patched
- # hopefully 4.3 will be patched
case "$(uname -r)" in
- 4.[123].*fc24*) return 1 ;;
+ 4.[12].*fc24*) return 1 ;;
esac
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=12aa56d29867b962…
Commit: 12aa56d29867b962257d7d2789a661a22c649347
Parent: 9156c5d0888bf95b79d931682b51fc63c96ba236
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 22 15:48:14 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 22 22:40:07 2015 +0200
dmeventd: handle signal from plugin
Add support to unmonitor device when monitor recognizes there is
nothing to monitor anymore.
TODO: possibly API change with return value could be also used.
---
WHATS_NEW_DM | 3 ++-
daemons/dmeventd/dmeventd.c | 11 +++++++++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 8c27139..8524a6d 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,6 +1,7 @@
Version 1.02.110 -
======================================
- New design for thread cooperation in dmeventd.
+ Add support to allow unmonitor device from plugin itself.
+ New design for thread co-operation in dmeventd.
Dmeventd read device status with 'noflush'.
Dmeventd closes control device when no device is monitored.
Thin plugin for dmeventd improved percentage usage.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index d8c317e..2706ad6 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -973,6 +973,17 @@ static void *_monitor_thread(void *arg)
_lock_mutex();
thread->processing = 0;
+
+ /*
+ * Thread can terminate itself from plugin via SIGALRM
+ * Timer thread will not send signal while processing
+ * TODO: maybe worth API change and return value for
+ * _do_process_event() instead of this signal solution
+ */
+ if (sigpending(&pendmask) < 0)
+ log_sys_error("sigpending", "");
+ else if (sigismember(&pendmask, SIGALRM))
+ break;
} else {
_unlock_mutex();
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=02eb000f5145aa60…
Commit: 02eb000f5145aa60578b4591053bff9a797e64cc
Parent: efc76ca33dec99e3b0499ef28fb9236815ad2258
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 21 20:52:29 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 22 22:34:27 2015 +0200
dmeventd: use dm_hold_control_dev
Need here to keep control device opened while there is 'any' dso
plugin loaded - otherwise there would a race closing controlfd
inside lvm2 plugin while some other monitoring thread would
tried to execute another WAITEVENT task.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 2b87e4b..000bddd 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Dmeventd closes control device when no device is monitored.
Thin plugin for dmeventd improved percentage usage.
Snapshot plugin for dmeventd improved percentage usage.
Add dm_hold_control_dev to allow holding of control device open.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 69fe393..885aa9d 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -282,6 +282,13 @@ static void _lib_put(struct dso_data *data)
dlclose(data->dso_handle);
UNLINK_DSO(data);
_free_dso_data(data);
+
+ /* Close control device if there is no plugin in-use */
+ if (dm_list_empty(&_dso_registry)) {
+ DEBUGLOG("Unholding control device.");
+ dm_hold_control_dev(0);
+ dm_lib_release();
+ }
}
}
@@ -344,6 +351,12 @@ static struct dso_data *_load_dso(struct message_data *data)
goto_bad;
}
+ /* Keep control device open until last user closes */
+ if (dm_list_empty(&_dso_registry)) {
+ DEBUGLOG("Holding control device open.");
+ dm_hold_control_dev(1);
+ }
+
/*
* Keep handle to close the library once
* we've got no references to it any more.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=73e679f33f411c65…
Commit: 73e679f33f411c65c9b7c7e4e501d97245f0bf5d
Parent: a0d819172fde16913347e5c0984dc4d67ae6befe
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 21 13:36:57 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 21 13:36:57 2015 -0500
man: document possible lvmetad -l values
In the man page and the lvmetad help output.
---
WHATS_NEW | 1 +
daemons/lvmetad/lvmetad-core.c | 4 ++--
man/lvmetad.8.in | 14 +++++---------
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 983b2b4..ece92e0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Allow all log levels to be used with the lvmetad -l option.
Add optional shutdown when idle support for lvmetad.
Fix missing in-sync progress info while lvconvert used with lvmpolld.
Add report/compact_output_cols to lvm.conf to define report cols to compact.
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 7ec3a3a..64d998e 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1637,11 +1637,11 @@ static int process_timeout_arg(const char *str, unsigned *max_timeouts)
static void usage(const char *prog, FILE *file)
{
fprintf(file, "Usage:\n"
- "%s [-V] [-h] [-f] [-l {all|wire|debug}] [-s path] [-t secs]\n\n"
+ "%s [-V] [-h] [-f] [-l level[,level ...]] [-s path] [-t secs]\n\n"
" -V Show version of lvmetad\n"
" -h Show this help information\n"
" -f Don't fork, run in the foreground\n"
- " -l Logging message level (-l {all|wire|debug})\n"
+ " -l Logging message levels (all,fatal,error,warn,info,wire,debug)\n"
" -p Set path to the pidfile\n"
" -s Set path to the socket to listen on\n"
" -t Time to wait in seconds before shutdown on idle (missing or 0 = inifinite)\n\n", prog);
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 2acfd8b..3e895ce 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -5,7 +5,7 @@ lvmetad \(em LVM metadata cache daemon
.SH SYNOPSIS
.B lvmetad
.RB [ \-l
-.RI { all | wire | debug }]
+.IR level [,level...]]
.RB [ \-p
.IR pidfile_path ]
.RB [ \-s
@@ -77,15 +77,11 @@ Don't fork, but run in the foreground.
.BR \-h ", " \-?
Show help information.
.TP
-.IR \fB\-l " {" all | wire | debug }
-Select the type of log messages to generate.
-Messages are logged by syslog.
+.B \-l \fIlevels
+Specify the levels of log messages to generate as a comma separated list.
+Messages are logged by syslog.
Additionally, when \-f is given they are also sent to standard error.
-Since release 2.02.98, there are two classes of messages: wire and debug.
-Selecting 'all' supplies both and is equivalent to a comma-separated list
-\-l wire,debug.
-Prior to release 2.02.98, repeating \-d from 1 to 3 times, viz. \-d, \-dd, \-ddd,
-increased the detail of messages.
+Possible levels are: all, fatal, error, warn, info, wire, debug.
.TP
.B \-p \fIpidfile_path
Path to the pidfile. This overrides both the built-in default
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ef4d69f456b22b4e…
Commit: ef4d69f456b22b4e58afb9fe5ff0b09603944f35
Parent: c15649b3af94e4af573ada0f30e35f7d1fee5321
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Oct 20 15:41:42 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 15:45:28 2015 +0200
tests: add lvmetad shutdown on idle test
---
test/shell/lvmetad-autoshutdown.sh | 56 ++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvmetad-autoshutdown.sh b/test/shell/lvmetad-autoshutdown.sh
new file mode 100644
index 0000000..fdee4a6
--- /dev/null
+++ b/test/shell/lvmetad-autoshutdown.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/inittest
+
+test -e LOCAL_LVMETAD || skip
+test -e LOCAL_LVMPOLLD && skip
+
+kill -0 $(< LOCAL_LVMETAD) || die "lvmetad is already dead"
+
+lvmetad_timeout=3
+
+aux prepare_pvs 1
+
+vgcreate $vg1 "$dev1"
+
+kill $(< LOCAL_LVMETAD)
+aux prepare_lvmetad -t $lvmetad_timeout
+
+sleep $lvmetad_timeout
+
+# lvmetad should die after timeout, but give it some time to do so
+i=0
+while kill -0 $(< LOCAL_LVMETAD) 2>/dev/null; do
+ test $i -ge $((lvmetad_timeout*10)) && die "lvmetad didn't shutdown with optional timeout: $lvmetad_timeout seconds"
+ sleep .1
+ i=$((i+1))
+done
+
+aux prepare_lvmetad -t 0
+sleep 1
+# lvmetad must not die with -t 0 option
+kill -0 $(< LOCAL_LVMETAD) || die "lvmetad died"
+
+kill $(< LOCAL_LVMETAD)
+aux prepare_lvmetad -t $lvmetad_timeout
+
+sleep 1
+vgs
+sleep 1
+vgs
+sleep 1
+vgs
+
+# check that connection to lvmetad resets the timeout
+kill -0 $(< LOCAL_LVMETAD) || die "lvmetad died too soon"
+
+vgremove -ff $vg1
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c15649b3af94e4af…
Commit: c15649b3af94e4af573ada0f30e35f7d1fee5321
Parent: f67a52677bdc95209c7adfa4575c833bed1659f1
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Oct 20 13:33:29 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 15:45:21 2015 +0200
lvmetad.8.in: update man page with timeout info
---
man/lvmetad.8.in | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index cdaf198..2acfd8b 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -10,6 +10,8 @@ lvmetad \(em LVM metadata cache daemon
.IR pidfile_path ]
.RB [ \-s
.IR socket_path ]
+.RB [ \-t
+.IR timeout_value ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-V ]
@@ -97,6 +99,10 @@ Path to the socket file. This overrides both the built-in default
\fBLVM_LVMETAD_SOCKET\fP. To communicate successfully with lvmetad,
all LVM2 processes should use the same socket path.
.TP
+.B \-t \fItimeout_value
+The daemon may shutdown after being idle for the given time (in seconds). When the
+option is omitted or the value given is zero the daemon never shutdowns on idle.
+.TP
.B \-V
Display the version of lvmetad daemon.
.SH ENVIRONMENT VARIABLES
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=392248186e56fb21…
Commit: 392248186e56fb216e49a2fee0caad5a506e3dd1
Parent: 33465066c5eddaa6169814d645d543e5673bc2a6
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Oct 20 11:55:51 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 12:19:02 2015 +0200
tests: add test for missing mirror in-sync info
---
test/shell/lvconvert-mirror.sh | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 844f8e9..029112c 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010-2013 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2010-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -313,4 +313,11 @@ lvconvert --mirrorlog disk $vg/$lv1 "$dev3:0-1"
check mirror $vg $lv1 "$dev3"
lvremove -ff $vg
+# bz1272175: check lvconvert reports progress while waiting for mirror
+# to get synced
+lvcreate -l2 -n $lv1 $vg
+lvconvert --type mirror -i1 -m1 $vg/$lv1 | tee out
+grep -e "$vg/$lv1: Converted:" out || fail "Missing sync info in foreground mode"
+lvremove -ff $vg
+
vgremove -ff $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=33465066c5eddaa6…
Commit: 33465066c5eddaa6169814d645d543e5673bc2a6
Parent: a5c4c4efbd18809320f49d7ed60c58883140259c
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Mon Oct 19 16:56:45 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 12:18:55 2015 +0200
polldaemon: fix missing mirror in-sync info with lvmpolld
CONVERTING status flag is a tricky one. It's not set when converting
a non-mirror LV type to the mirror type, i.e.: linear -> two leg mirror.
Also the conversion itself is instant and doesn't require to be polled.
When mirror reaches sync state there's no final update on VG metadata
for lvmpolld to be made thereby report_progress in fact doesn't report
percentage of mirror being converted but percentage of mirror
being in sync. Perhaps we should reword the lvconvert output here.
On the other hand CONVERTING is set while we upconvert the mirror
from i.e. two leg mirror to four leg mirror. In such case the operation
is required to be polled so that lvmpolld can cleanup temporary
conversion log when the conversion is over.
Ignore CONVERTING lv_type for the moment and match LVs only by uuids
during 'mirror conversion'/'waiting for a sync to finish'.
---
WHATS_NEW | 1 +
tools/polldaemon.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f973f11..763896e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix missing in-sync progress info while lvconvert used with lvmpolld.
Add report/compact_output_cols to lvm.conf to define report cols to compact.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index cee1983..ccfaa7d 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -412,7 +412,12 @@ static int report_progress(struct cmd_context *cmd, struct poll_operation_id *id
if (lv && id->uuid && strcmp(id->uuid, (char *)&lv->lvid))
lv = NULL;
- if (lv && parms->lv_type && !(lv->status & parms->lv_type))
+
+ /*
+ * CONVERTING is set only during mirror upconversion but we may need to
+ * read LV's progress info even when it's not converting (linear->mirror)
+ */
+ if (lv && (parms->lv_type ^ CONVERTING) && !(lv->status & parms->lv_type))
lv = NULL;
if (!lv) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a5c4c4efbd188093…
Commit: a5c4c4efbd18809320f49d7ed60c58883140259c
Parent: 83d475626a4d9ecaa2084f349cb2cee4f0f3a719
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Oct 20 11:01:09 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Oct 20 11:01:09 2015 +0200
conf: clarify compact output settings
---
conf/example.conf.in | 21 ++++++++++++---------
lib/config/config_settings.h | 21 ++++++++++++---------
2 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e96f03f..b8c0407 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1494,19 +1494,22 @@ activation {
# report {
# Configuration option report/compact_output.
- # Do not print empty report fields.
- # Fields that don't have a value set for any of the rows reported are
- # skipped and not printed. Compact output is applicable only if
- # report/buffered is enabled.
+ # Do not print empty values for all report fields.
+ # If enabled, all fields that don't have a value set for any of the
+ # rows reported are skipped and not printed. Compact output is
+ # applicable only if report/buffered is enabled. If you need to
+ # compact only specified fields, use compact_output=0 and define
+ # report/compact_output_cols configuration setting instead.
# This configuration option has an automatic default value.
# compact_output = 0
# Configuration option report/compact_output_cols.
- # Do not print empty values for given report fields.
- # The same as compact_output setting, but the compaction is not done
- # globally for all fields in report but only for given fields. If both
- # compact_output and compact_output_cols is used at the same time,
- # the compact_output setting prevails.
+ # Do not print empty values for specified report fields.
+ # If defined, specified fields that don't have a value set for any
+ # of the rows reported are skipped and not printed. Compact output
+ # is applicable only if report/buffered is enabled. If you need to
+ # compact all fields, use compact_output=1 instead in which case
+ # the compact_output_cols setting is then ignored.
# This configuration option has an automatic default value.
# compact_output_cols = ""
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 1a261a2..dd2b407 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1416,17 +1416,20 @@ cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_
cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL, NULL)
cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL, 0, NULL,
- "Do not print empty report fields.\n"
- "Fields that don't have a value set for any of the rows reported are\n"
- "skipped and not printed. Compact output is applicable only if\n"
- "report/buffered is enabled.\n")
+ "Do not print empty values for all report fields.\n"
+ "If enabled, all fields that don't have a value set for any of the\n"
+ "rows reported are skipped and not printed. Compact output is\n"
+ "applicable only if report/buffered is enabled. If you need to\n"
+ "compact only specified fields, use compact_output=0 and define\n"
+ "report/compact_output_cols configuration setting instead.\n")
cfg(report_compact_output_cols_CFG, "compact_output_cols", report_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMPACT_OUTPUT_COLS, vsn(2, 2, 133), NULL, 0, NULL,
- "Do not print empty values for given report fields.\n"
- "The same as compact_output setting, but the compaction is not done\n"
- "globally for all fields in report but only for given fields. If both\n"
- "compact_output and compact_output_cols is used at the same time,\n"
- "the compact_output setting prevails.\n")
+ "Do not print empty values for specified report fields.\n"
+ "If defined, specified fields that don't have a value set for any\n"
+ "of the rows reported are skipped and not printed. Compact output\n"
+ "is applicable only if report/buffered is enabled. If you need to\n"
+ "compact all fields, use compact_output=1 instead in which case\n"
+ "the compact_output_cols setting is then ignored.\n")
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL, 0, NULL,
"Align columns in report output.\n")
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1ea7e2634d67a762…
Commit: 1ea7e2634d67a7628508a677668a00f748aee0b0
Parent: 23d9b17a7b06d8e6f89b2c3e9ef9f59462436458
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 19 10:01:14 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 19 10:01:14 2015 +0200
conf: regenerate
---
conf/example.conf.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index dddede0..e96f03f 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -389,8 +389,8 @@ allocation {
# This configuration option does not have a default value defined.
# Configuration section allocation/cache_settings.
- # Individual settings for policies.
- # See the help for individual policies for more info.
+ # Settings for the cache policy.
+ # See documentation for individual cache policies for more info.
# This configuration section has an automatic default value.
# cache_settings {
# }
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=23d9b17a7b06d8e6…
Commit: 23d9b17a7b06d8e6f89b2c3e9ef9f59462436458
Parent: c3bfe07f2ad393963af5b7138bccc622e6561c8f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 19 09:59:05 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 19 09:59:05 2015 +0200
cleanup: typo in comment: compact_output_fields should be compact-output_cols
---
conf/example.conf.in | 2 +-
lib/config/config_settings.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e1afed6..dddede0 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1505,7 +1505,7 @@ activation {
# Do not print empty values for given report fields.
# The same as compact_output setting, but the compaction is not done
# globally for all fields in report but only for given fields. If both
- # compact_output and compact_output_fields is used at the same time,
+ # compact_output and compact_output_cols is used at the same time,
# the compact_output setting prevails.
# This configuration option has an automatic default value.
# compact_output_cols = ""
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index cefc579..1a261a2 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1425,7 +1425,7 @@ cfg(report_compact_output_cols_CFG, "compact_output_cols", report_CFG_SECTION, C
"Do not print empty values for given report fields.\n"
"The same as compact_output setting, but the compaction is not done\n"
"globally for all fields in report but only for given fields. If both\n"
- "compact_output and compact_output_fields is used at the same time,\n"
+ "compact_output and compact_output_cols is used at the same time,\n"
"the compact_output setting prevails.\n")
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL, 0, NULL,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c3bfe07f2ad39396…
Commit: c3bfe07f2ad393963af5b7138bccc622e6561c8f
Parent: 508f0f5a21af8decf32944e01ecf17c0059a9c9f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 16 16:25:51 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 16 17:05:54 2015 +0200
config: add report/compact_output_cols to control which columns to compact in report output
The new report/compact_output_cols setting has exactly the same effect
as report/compact_output setting. The difference is that with the new
setting it's possible to define which cols should be compacted exactly
in contrast to all cols in case of report/compact_output.
In case both compact_output and compact_output_cols is enabled/set,
the compact_output prevails.
For example:
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols=""
$ lvs vg
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
---
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"
$ lvs vg
LV VG Attr LSize Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
---
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=1
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"
$ lvs vg
LV VG Attr LSize
lvol0 vg -wi-a----- 4.00m
---
WHATS_NEW | 1 +
conf/example.conf.in | 9 +++++++++
lib/config/config_settings.h | 7 +++++++
lib/config/defaults.h | 2 ++
libdm/libdevmapper.h | 2 +-
tools/reporter.c | 11 ++++++++---
6 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c089228..f973f11 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Add report/compact_output_cols to lvm.conf to define report cols to compact.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
diff --git a/conf/example.conf.in b/conf/example.conf.in
index c0afcb7..e1afed6 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1501,6 +1501,15 @@ activation {
# This configuration option has an automatic default value.
# compact_output = 0
+ # Configuration option report/compact_output_cols.
+ # Do not print empty values for given report fields.
+ # The same as compact_output setting, but the compaction is not done
+ # globally for all fields in report but only for given fields. If both
+ # compact_output and compact_output_fields is used at the same time,
+ # the compact_output setting prevails.
+ # This configuration option has an automatic default value.
+ # compact_output_cols = ""
+
# Configuration option report/aligned.
# Align columns in report output.
# This configuration option has an automatic default value.
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 9cc444f..cefc579 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1421,6 +1421,13 @@ cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILA
"skipped and not printed. Compact output is applicable only if\n"
"report/buffered is enabled.\n")
+cfg(report_compact_output_cols_CFG, "compact_output_cols", report_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMPACT_OUTPUT_COLS, vsn(2, 2, 133), NULL, 0, NULL,
+ "Do not print empty values for given report fields.\n"
+ "The same as compact_output setting, but the compaction is not done\n"
+ "globally for all fields in report but only for given fields. If both\n"
+ "compact_output and compact_output_fields is used at the same time,\n"
+ "the compact_output setting prevails.\n")
+
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL, 0, NULL,
"Align columns in report output.\n")
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index cd5d121..8ab1fde 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -201,6 +201,8 @@
#define DEFAULT_REP_LIST_ITEM_SEPARATOR ","
#define DEFAULT_TIME_FORMAT "%Y-%m-%d %T %z"
+#define DEFAULT_COMPACT_OUTPUT_COLS ""
+
#define DEFAULT_LVS_COLS "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,metadata_percent,move_pv,mirror_log,copy_percent,convert_lv"
#define DEFAULT_VGS_COLS "vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free"
#define DEFAULT_PVS_COLS "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free"
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 1a2036b..fcbf7cf 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -2552,7 +2552,7 @@ int dm_report_compact_fields(struct dm_report *rh);
* The same as dm_report_compact_fields, but for selected fields only.
* The "fields" arg is comma separated list of field names (the same format
* as used for "output_fields" arg in dm_report_init fn).
-*/
+ */
int dm_report_compact_given_fields(struct dm_report *rh, const char *fields);
/*
diff --git a/tools/reporter.c b/tools/reporter.c
index 8f7a272..6c93739 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -618,6 +618,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
unsigned args_are_pvs;
int lv_info_needed, lv_segment_status_needed;
int lock_global = 0;
+ const char *fields_to_compact;
aligned = find_config_tree_bool(cmd, report_aligned_CFG, NULL);
buffered = find_config_tree_bool(cmd, report_buffered_CFG, NULL);
@@ -817,9 +818,13 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
break;
}
- if (find_config_tree_bool(cmd, report_compact_output_CFG, NULL) &&
- !dm_report_compact_fields(report_handle))
- log_error("Failed to compact report output.");
+ if (find_config_tree_bool(cmd, report_compact_output_CFG, NULL)) {
+ if (!dm_report_compact_fields(report_handle))
+ log_error("Failed to compact report output.");
+ } else if ((fields_to_compact = find_config_tree_str_allow_empty(cmd, report_compact_output_cols_CFG, NULL))) {
+ if (!dm_report_compact_given_fields(report_handle, fields_to_compact))
+ log_error("Failed to compact given columns in report output.");
+ }
dm_report_output(report_handle);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df34fcdafd20ac19…
Commit: df34fcdafd20ac195e588a06c8fc5a904fa71669
Parent: a6d1c8ac651ecdc6fbdfa20f892ba318c2dddeda
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 14 14:36:46 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 14 14:39:29 2015 -0500
lvmlockd: use flag to avoid blocking in sanlock_acquire
If a host failed while holding a sanlock lease,
sanlock_acquire will by default block and wait
for the lease to expire before returning. We
want it to return with an error so we can retry
instead of blocking, which allows us to process
other lock operations.
(Enclose this in an ifdef until the new flag
appears in a sanlock release.)
---
daemons/lvmlockd/lvmlockd-sanlock.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-sanlock.c b/daemons/lvmlockd/lvmlockd-sanlock.c
index 1e691eb..e1a85b4 100644
--- a/daemons/lvmlockd/lvmlockd-sanlock.c
+++ b/daemons/lvmlockd/lvmlockd-sanlock.c
@@ -1392,6 +1392,15 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
if (adopt)
flags |= SANLK_ACQUIRE_ORPHAN_ONLY;
+#ifdef SANLOCK_HAS_ACQUIRE_OWNER_NOWAIT
+ /*
+ * Don't block waiting for a failed lease to expire since it causes
+ * sanlock_acquire to block for a long time, which would prevent this
+ * thread from processing other lock requests.
+ */
+ flags |= SANLK_ACQUIRE_OWNER_NOWAIT;
+#endif
+
rv = sanlock_acquire(lms->sock, -1, flags, 1, &rs, NULL);
if (rv == -EAGAIN) {
@@ -1462,6 +1471,26 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
return -EAGAIN;
}
+#ifdef SANLOCK_HAS_ACQUIRE_OWNER_NOWAIT
+ if (rv == SANLK_ACQUIRE_OWNED_RETRY) {
+ /*
+ * The lock is held by a failed host, and will eventually
+ * expire. If we retry we'll eventually acquire the lock
+ * (or find someone else has acquired it). The EAGAIN retry
+ * attempts for SH locks above would not be sufficient for
+ * the length of expiration time. We could add a longer
+ * retry time here to cover the full expiration time and block
+ * the activation command for that long. For now just return
+ * the standard error indicating that another host still owns
+ * the lease. FIXME: return a different error number so the
+ * command can print an different error indicating that the
+ * owner of the lease is in the process of expiring?
+ */
+ log_debug("S %s R %s lock_san acquire mode %d rv %d", ls->name, r->name, ld_mode, rv);
+ *retry = 0;
+ return -EAGAIN;
+ }
+#endif
if (rv < 0) {
log_error("S %s R %s lock_san acquire error %d",
ls->name, r->name, rv);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bbef4edd06097a71…
Commit: bbef4edd06097a71601b1470a713ded17deb7cba
Parent: 3f1a3b7090d421d46f245454bc5c8ed299a9cc1d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 14 00:51:55 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Oct 14 00:51:55 2015 +0200
makefiles: switch to rpath-link
Plain rpath is to invasive and gets into binary.
We only want to provide hint for linker.
---
scripts/Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index bfa0fad..af2b299 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2006-2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2006-2015 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -26,7 +26,7 @@ ifeq ("@APPLIB@", "yes")
DEPLIBS += $(top_builddir)/liblvm/liblvm2app.so $(top_builddir)/libdm/libdevmapper.so
LDFLAGS += -L$(top_builddir)/liblvm
ifeq ("@DMEVENTD@", "yes")
- LDFLAGS += -Wl,-rpath,$(top_builddir)/daemons/dmeventd
+ LDFLAGS += -Wl,-rpath-link,$(top_builddir)/daemons/dmeventd
endif
LVMLIBS = @LVM2APP_LIB@ -ldevmapper
endif
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0cf787a377548394…
Commit: 0cf787a377548394f4588b671c2890ee1a45098b
Parent: acc70de43968961e9a71612cda04642e4fbfd71f
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 13 15:31:57 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 13 15:31:57 2015 +0100
Revert "log: no file for external logging"
This reverts commit 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2.
This caused messages to get dropped instead of logged into the log file.
(The log file and log function are independent at the moment.)
---
WHATS_NEW | 1 -
lib/log/log.c | 4 ----
2 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 7507b9c..c089228 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,5 @@
Version 2.02.133 -
======================================
- Avoid creation of log file when logging function is set.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
diff --git a/lib/log/log.c b/lib/log/log.c
index 2f1be72..c44c3d4 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -71,10 +71,6 @@ void init_log_file(const char *log_file, int append)
int i = 0;
_log_file_path[0] = '\0';
-
- if (_lvm2_log_fn)
- return; /* No log file, when log function is set */
-
if ((env = getenv("LVM_LOG_FILE_EPOCH"))) {
while (isalpha(env[i]) && i < 32) /* Up to 32 alphas */
i++;