master - coverity: missing return value check
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0fddc5ab5c892d...
Commit: 0fddc5ab5c892d02fd097828de36ee033dc1e7b3
Parent: e0dc3d5efb6da6d45994f88e9d89e6657a183aac
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jan 22 10:11:19 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jan 22 10:11:19 2015 +0100
coverity: missing return value check
Reported by coverity for code added recently - _avoid_pvs_with_other_images_of_lv
which calls process_each_sub_lv and not checking return value.
---
lib/metadata/raid_manip.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index d502379..5c2ca95 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1563,9 +1563,9 @@ static int _avoid_pvs_of_lv(struct logical_volume *lv, void *data)
* by setting the internal PV_ALLOCATION_PROHIBITED flag to use it to avoid generating
* pv maps for those PVs.
*/
-static void _avoid_pvs_with_other_images_of_lv(struct logical_volume *lv, struct dm_list *allocate_pvs)
+static int _avoid_pvs_with_other_images_of_lv(struct logical_volume *lv, struct dm_list *allocate_pvs)
{
- for_each_sub_lv(lv, _avoid_pvs_of_lv, allocate_pvs);
+ return for_each_sub_lv(lv, _avoid_pvs_of_lv, allocate_pvs);
}
/*
@@ -1667,7 +1667,11 @@ int lv_raid_replace(struct logical_volume *lv,
}
/* Prevent any PVs holding image components from being used for allocation */
- _avoid_pvs_with_other_images_of_lv(lv, allocate_pvs);
+ if (!_avoid_pvs_with_other_images_of_lv(lv, allocate_pvs)) {
+ log_error("Failed to prevent PVs holding image components "
+ "from being used for allocation.");
+ return 0;
+ }
/*
* Allocate the new image components first
9 years, 3 months
master - lvmthin: update data space exhaustion
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e0dc3d5efb6da6...
Commit: e0dc3d5efb6da6d45994f88e9d89e6657a183aac
Parent: bea003e94ceec717c2c5b847a9a28ea3f8f42dad
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jan 21 11:08:12 2015 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jan 21 14:31:36 2015 -0600
lvmthin: update data space exhaustion
---
man/lvmthin.7.in | 56 ++++++++++++++++++++++++++++-------------------------
1 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 86456a5..908701a 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -716,14 +716,16 @@ For a 1G pool, using 700M will trigger a resize to 1.2G. When the usage exceeds
\&
When properly managed, thin pool data space should be extended before it
-is exhausted (see previous section). But, if thin pool data space is
-exhausted, the thin pool behavior is configurable with the --errorwhenfull
-y|n option to lvcreate or lvchange. The errorwhenfull setting applies
-only to writes; reading thin LVs can continue even when data space is
-exhausted.
+is exhausted (see the section "Automatically extend thin pool LV"). If
+thin pool data space is already exhausted, it can still be extended (see
+the section "Manually manage free data space of thin pool LV".)
-Command to change the handling of data space exhaustion of an existing
-thin pool LV:
+The behavior of a full thin pool with no remaining data space is
+configurable with the --errorwhenfull y|n option to lvcreate or lvchange.
+The errorwhenfull setting applies only to writes; reading thin LVs can
+continue even when data space is exhausted.
+
+Command to change the handling of no data space of a thin pool:
.B lvchange --errorwhenfull {y|n} VG/ThinPoolLV
@@ -737,24 +739,25 @@ is extended, the queued writes will be processed, and the thin pool will
return to normal operation.
While waiting to be extended, the thin pool will queue writes for up to 60
-seconds. If data space has not been extended after this time, the queued
-writes will return an error to the caller, e.g. the file system. This can
-result in file system corruption that may require fsck to repair.
+seconds (the default). If data space has not been extended after this
+time, the queued writes will return an error to the caller, e.g. the file
+system. This can result in file system corruption that may require fsck.
The 60 second timeout can be changed or disabled with the dm\-thin\-pool
kernel module option
.B no_space_timeout.
This option sets the number of seconds that thin pools will queue writes.
-If set to 0, writes will not time out. Disabling timeouts may result in
-the system exhausting memory if too many writes are queued.
+If set to 0, writes will not time out. Disabling timeouts can result in
+the system running out of resources, memory exhaustion, hung tasks, and
+deadlocks. (The timeout applies to all thin pools on the system.)
.B errorwhenfull y
Writes to thin LVs immediately return an error, and no writes are queued.
In the case of a file system, this can result in corruption that may
-require fsck to repair (the specific consequences depend on the thin LV
-user.)
+require fsck (the specific consequences depend on the thin LV user.)
+.B display data percent
When data space is exhausted, the lvs command displays 100 under Data% for
the thin pool LV:
@@ -765,24 +768,25 @@ the thin pool LV:
pool0 vg twi-a-tz-- 512.00m 100.00
.fi
-A thin pool can run out of data blocks for any of the following reasons:
+.B causes
+
+A thin pool may run out of data space for any of the following reasons:
-1. Automatic extension of the thin pool is disabled, and the thin pool is
-not manually extended. (Disabling automatic extension is not
-recommended.)
+.IP \[bu] 2
+Automatic extension of the thin pool is disabled, and the thin pool is not
+manually extended. (Disabling automatic extension is not recommended.)
-2. The dmeventd daemon is not running and the thin pool is not manually
+.IP \[bu]
+The dmeventd daemon is not running and the thin pool is not manually
extended. (Disabling dmeventd is not recommended.)
-3. Automatic extension of the thin pool is too slow given the rate of
-writes to thin LVs in the pool. (This can be addressed by tuning the
+.IP \[bu]
+Automatic extension of the thin pool is too slow given the rate of writes
+to thin LVs in the pool. (This can be addressed by tuning the
thin_pool_autoextend_threshold and thin_pool_autoextend_percent.)
-4. The VG does not have enough free blocks to extend the thin pool.
-
-The response to data space exhaustion is to extend the thin pool. This is
-described in the section "Manually manage free data space of thin pool
-LV".
+.IP \[bu]
+The VG does not have enough free blocks to extend the thin pool.
.SS Metadata space exhaustion
9 years, 3 months
master - config: improve config validation to check if setting with string value can be empty.
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bea003e94ceec7...
Commit: bea003e94ceec717c2c5b847a9a28ea3f8f42dad
Parent: 57f67ce8558d9688d1e743aba5d65d1e1545aad6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 21 16:44:02 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 21 16:44:02 2015 +0100
config: improve config validation to check if setting with string value can be empty.
For example, with dmeventd/executable set to "" which is not allowed for
this setting, the config validation now ends up with:
$ lvm dumpconfig --validate
Configuration setting "dmeventd/executable" invalid. It cannot be set to an empty value.
LVM configuration invalid.
This check for empty values for string config settings was not
done before (we only checked empty arrays, but not scalar strings).
---
WHATS_NEW | 1 +
lib/config/config.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 15ab94f..02f76be 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
+ Improve config validation to check if setting with string value can be empty.
Version 2.02.115 - 21st January 2015
====================================
diff --git a/lib/config/config.c b/lib/config/config.c
index 58efb31..b47984f 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -790,6 +790,11 @@ static int _config_def_check_node_single_value(struct cft_check_handle *handle,
} else if (!(def->type & CFG_TYPE_STRING)) {
_log_type_error(rp, CFG_TYPE_STRING, def->type, handle->suppress_messages);
return 0;
+ } else if (!(def->flags & CFG_ALLOW_EMPTY) && !*v->v.str) {
+ log_warn_suppress(handle->suppress_messages,
+ "Configuration setting \"%s\" invalid. "
+ "It cannot be set to an empty value.", rp);
+ return 0;
}
break;
default: ;
9 years, 3 months
v2_02_115 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=972a6f4b1972eb...
Commit: 972a6f4b1972eb661bbcd6b487b3b250257da67c
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2015-01-21 13:08 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2015-01-21 13:08 +0000
annotated tag: v2_02_115 has been created
at 972a6f4b1972eb661bbcd6b487b3b250257da67c (tag)
tagging fa01faaa4aa96de834ba7e8fbb9d9aff908571c3 (commit)
replaces v2_02_114
Release 2.02.115.
67 files changed, 1428 insertions(+), 445 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlS/pRsACgkQIoGRwVZ+LBfA5QCgt3KrilCXnFUQqqEGndew8T/K
f0wAn0K25dCX6HhDqAI5+R621/Zh9QSI
=6l77
-----END PGP SIGNATURE-----
Alasdair G Kergon (10):
post-release
mirror: Restrict region size to power of 2.
mirror: Validate raid region size config setting.
libdm-report: Fix order of NULL dm_report check.
man: Remove renamed writebehind field from lvs.8.
vgimportclone: Say safe to ignore lvmetad message.
report: Fix warning in _str_list_append.
libdevmapper: Improve incompatible version msg.
dmeventd: Reduce waitevent EINTR message severity.
pre-release
David Teigland (8):
toollib: process_each_pv should match by device
toollib: handle duplicate pvs in process_in_pv
toollib: override the PV device with duplicates
toollib: pvs -a should display VG name for each duplicate PV
toollib: search for duplicate PVs only when needed
WHATS_NEW: previous commits related to duplicate PVs
vgimportclone: remove arg check that uses pvs
lvmthin: include errorwhenfull
Heinz Mauelshagen (3):
raid: fix mirror image naming when converting from mirror to raid1
raid_manip: fix multi-segment misallocation on 'lvconvert --repair'
raid_manip: v2 fix multi-segment misallocation on 'lvconvert --repair'
Peter Rajnoha (37):
pool: fix typo in error message: then -> than
libdm: remove unimplemented dm_report_set_output_selection fn
libdm: report: add dm_report_compact_fields
config: add report/compact_output lvm.conf setting to enable or isable field compacting
libdm: report: compact output applicable only if report is buffered
libdm: report: return immediately from dm_report_compact_fields without error if there are no rows
configure: fix automatic use of configure --enable-udev-systemd-background-jobs
libdm: report: fix incorrect memory use while using --select with --unbuffered for reporting
WHATS_NEW: f94f846 actually fixes DM issue, not LVM issue
vgimportclone: replace awk with dumpconfig to generate temporary lvm.conf for vgimportclone
vgimportclone: also notify lvmetad about changes if it's used
man: remove reference to --binary in {pv,vg,lv}display man page
tools, man: --binary option is available with -C for {pv,vg,lv}display
man: put back the --binary reference in {pv,vg,lv}display man page
WHATS_NEW: previous commit
libdm: report: also check whether field type is supported for field-specific reserved value
report: dup cache policy name string for report in cache_policy field
refactor: rename existing helper macros for reserved value handling and add GET_FIELD_RESERVED_VALUE macro
cleanup: use helper macros to get reserved value from values.h for vg_mda_copies and lv_read_ahead fields
report: properly set "undefined" reserved value for cache_policy field
report: fix segfault on NULL value hit in cache_settings field
libdm: report: add more comments about helper macros to get reserved values
cmirror: check for cmirror availability during cluster mirror creation and activation
cmirror: do not check for cmirror availability when creating deactivated cluster mirrors
mirror: do not try to reactivate inactive mirror when removing its LVs which have missing PVs
WHATS_NEW: previous commit
dev_manager: do not mark snapshot origins as unusable devices just because of possible blocked mirror underneath
WHATS_NEW: line for previous commit
metadata: log_error instead of log_warn on failed mda write
metadata: add "Failed to write VG <vg_name>." on failed vg_write and revert previous patch
scripts: clvmd: replace awk functionality with LVM's selection
pvscan: notify lvmetad about device that is gone and pvscan is run with device path instead of major:minor pair
dev-type: filter out partitioned device-mapper devices as unsuitable for use as PVs
tests: pvscan --cache DevicePath does not fail if the device is just filtered
report: add separate LVSINFOSTATUS field type for info+status combined fields
report: rename lv_error_when_full field to lv_when_full and display either "error", "queue" or ""
cleanup: for commit 7bcb3fb02d6aacc566871326c0d01c331497a5b2
Petr Rockai (4):
report: Add cache_policy and cache_settings (LV) segment fields.
lvmetad: Re-use fmt from the VG for PVs when possible.
pvremove: Avoid metadata re-reads & related error messages.
dmeventd: Call lvscan --cache also for mirrors (in addition to RAID).
Zdenek Kabelac (19):
raid: properly rename split image
cleanup: update API for segment reporting
cleanup: properly align code lines
lv_status: track layered device
lv_status: enable lv_status for thinpool
cleanup: missed for build without devmapper
thin: errrorwhenfull support
WHATS_NEW
cleanup: add lv_is_error_when_full() macro
thin: lvchange support for errorwhenfull
report: reporting unknown status
report: use same info also for lv_attr
report: update report_object API
report: seg_monitor undefined
man: errorwhenfull doc
cleanup: indent
report: use info
thin: support errorwhenfull with thin creation
report: proper lv_attr_dup emulation
9 years, 3 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=57f67ce8558d96...
Commit: 57f67ce8558d9688d1e743aba5d65d1e1545aad6
Parent: fa01faaa4aa96de834ba7e8fbb9d9aff908571c3
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jan 21 13:25:10 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jan 21 13:25:10 2015 +0000
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 6a4aebc..bc3587c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.115(2)-git (2015-01-21)
+2.02.116(2)-git (2015-01-21)
diff --git a/VERSION_DM b/VERSION_DM
index 3a73cd9..de76fb3 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.93-git (2015-01-21)
+1.02.94-git (2015-01-21)
diff --git a/WHATS_NEW b/WHATS_NEW
index 75c4569..15ab94f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.116 -
+====================================
+
Version 2.02.115 - 21st January 2015
====================================
Report segment types without monitoring support as undefined.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 169831c..3fb69cb 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.94 -
+===================================
+
Version 1.02.93 - 21st January 2015
===================================
Reduce severity of ioctl error message when dmeventd waitevent is interrupted.
9 years, 3 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fa01faaa4aa96d...
Commit: fa01faaa4aa96de834ba7e8fbb9d9aff908571c3
Parent: 25d906dbde45bc64c5a0978e40c810b3b070cb0d
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jan 21 13:08:12 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jan 21 13:08:12 2015 +0000
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 6 +++---
WHATS_NEW_DM | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index 539cce1..6a4aebc 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.115(2)-git (2014-11-28)
+2.02.115(2)-git (2015-01-21)
diff --git a/VERSION_DM b/VERSION_DM
index e38dae6..3a73cd9 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.93-git (2014-11-28)
+1.02.93-git (2015-01-21)
diff --git a/WHATS_NEW b/WHATS_NEW
index f0b6991..75c4569 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.115 -
-=====================================
+Version 2.02.115 - 21st January 2015
+====================================
Report segment types without monitoring support as undefined.
Support lvchange --errorwhenfull for thin pools.
Improve the processing and reporting of duplicate PVs.
@@ -12,7 +12,7 @@ Version 2.02.115 -
Use LVM's own selection instead of awk expressions in clvmd startup scripts.
Do not filter out snapshot origin LVs as unusable devices for an LVM stack.
Fix incorrect rimage names when converting from mirror to raid1 LV (2.02.112).
- Avoid excessive re-reading of metadata and related error messages in pvremove.
+ Introduce pvremove_many to avoid excessive metadata re-reading and messages.
Check for cmirror availability during cluster mirror creation and activation.
Add cache_policy and cache_settings reporting fields.
Add missing recognition for --binary option with {pv,vg,lv}display -C.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 8cbb6b6..169831c 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.93 -
-====================================
+Version 1.02.93 - 21st January 2015
+===================================
Reduce severity of ioctl error message when dmeventd waitevent is interrupted.
Report 'unknown version' when incompatible version numbers were not obtained.
Report more info from thin pool status (out of data, metadata-ro, fail).
9 years, 3 months
master - dmeventd: Reduce waitevent EINTR message severity.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=25d906dbde45bc...
Commit: 25d906dbde45bc64c5a0978e40c810b3b070cb0d
Parent: 7cfc9a4f640296679f2b860842cc8b25b82fd30f
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jan 21 12:54:00 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jan 21 12:54:00 2015 +0000
dmeventd: Reduce waitevent EINTR message severity.
---
WHATS_NEW_DM | 1 +
libdm/ioctl/libdm-iface.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 0a59875..8cbb6b6 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.93 -
====================================
+ Reduce severity of ioctl error message when dmeventd waitevent is interrupted.
Report 'unknown version' when incompatible version numbers were not obtained.
Report more info from thin pool status (out of data, metadata-ro, fail).
Support error_if_no_space for thin pool target.
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index f8b4ed9..f971519 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -1801,7 +1801,7 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
(dmt->type == DM_DEVICE_STATUS)))
dmi->flags &= ~DM_EXISTS_FLAG; /* FIXME */
else {
- if (_log_suppress)
+ if (_log_suppress || errno == EINTR)
log_verbose("device-mapper: %s ioctl "
"failed: %s",
_cmd_data_v4[dmt->type].name,
9 years, 3 months
master - libdevmapper: Improve incompatible version msg.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7cfc9a4f640296...
Commit: 7cfc9a4f640296679f2b860842cc8b25b82fd30f
Parent: 338d98be97428bd9202391abe705e7fe10ec5ce8
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jan 21 12:23:56 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jan 21 12:23:56 2015 +0000
libdevmapper: Improve incompatible version msg.
---
WHATS_NEW_DM | 1 +
libdm/ioctl/libdm-iface.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 98f98b6..0a59875 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.93 -
====================================
+ Report 'unknown version' when incompatible version numbers were not obtained.
Report more info from thin pool status (out of data, metadata-ro, fail).
Support error_if_no_space for thin pool target.
Fix segfault while using selection with regex and unbuffered reporting.
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 4c37a53..f8b4ed9 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -571,8 +571,9 @@ int dm_check_version(void)
dm_get_library_version(libversion, sizeof(libversion));
bad:
- log_error("Incompatible libdevmapper %s%s and kernel driver %s",
- libversion, compat, dmversion);
+ log_error("Incompatible libdevmapper %s%s and kernel driver %s.",
+ *libversion ? libversion : "(unknown version)", compat,
+ *dmversion ? dmversion : "(unknown version)");
_version_ok = 0;
return 0;
9 years, 3 months
master - cleanup: for commit 7bcb3fb02d6aacc566871326c0d01c331497a5b2
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=338d98be97428b...
Commit: 338d98be97428bd9202391abe705e7fe10ec5ce8
Parent: 7bcb3fb02d6aacc566871326c0d01c331497a5b2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 21 11:28:58 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 21 11:29:12 2015 +0100
cleanup: for commit 7bcb3fb02d6aacc566871326c0d01c331497a5b2
---
lib/metadata/lv.h | 1 -
man/lvmthin.7.in | 3 +--
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv.h b/lib/metadata/lv.h
index cb5885d..4475085 100644
--- a/lib/metadata/lv.h
+++ b/lib/metadata/lv.h
@@ -91,7 +91,6 @@ char *lvseg_monitor_dup(struct dm_pool *mem, const struct lv_segment *seg);
char *lvseg_tags_dup(const struct lv_segment *seg);
char *lvseg_devices(struct dm_pool *mem, const struct lv_segment *seg);
char *lvseg_seg_pe_ranges(struct dm_pool *mem, const struct lv_segment *seg);
-uint32_t lv_error_when_full(const struct logical_volume *lv);
char *lv_time_dup(struct dm_pool *mem, const struct logical_volume *lv);
char *lv_host_dup(struct dm_pool *mem, const struct logical_volume *lv);
int lv_set_creation(struct logical_volume *lv,
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index b2db5a7..86456a5 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -727,8 +727,7 @@ thin pool LV:
.B lvchange --errorwhenfull {y|n} VG/ThinPoolLV
-The current setting can be displayed with the lvs -o+error_when_full
-command.
+The current setting can be displayed with the lvs -o+lv_when_full command.
.B errorwhenfull n
9 years, 3 months
master - report: rename lv_error_when_full field to lv_when_full and display either "error", "queue" or ""
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7bcb3fb02d6aac...
Commit: 7bcb3fb02d6aacc566871326c0d01c331497a5b2
Parent: 5e8f362c9eaae7bbcf69fd779d8c441f7de9042a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 21 10:43:40 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 21 10:50:32 2015 +0100
report: rename lv_error_when_full field to lv_when_full and display either "error", "queue" or ""
Rename original lv_error_when_full field to lv_when_full and also
convert it from binary field to string field displaying three
possible values: "error", "queueu" or "" (blank for undefined).
$ lvs vg/pool vg/pool1 vg/linear_lv -o+lv_when_full
LV VG Attr LSize Data% Meta% WhenFull
linear_lv vg -wi-a----- 4.00m
pool vg twi-aotz-- 4.00m 0.00 0.98 queue
pool1 vg twi-a-tz-- 4.00m 0.00 0.88 error
For -S|--select these synonyms are recognized:
"error" -> "error when full", "error if no space"
"queue" -> "queue when full", "queue if no space"
"" -> "undefined"
---
WHATS_NEW | 2 +-
lib/metadata/lv.c | 5 -----
lib/report/columns.h | 2 +-
lib/report/properties.c | 4 ++--
lib/report/report.c | 19 ++++++++++++++-----
lib/report/values.h | 4 +++-
6 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 022e4cf..f0b6991 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -4,7 +4,7 @@ Version 2.02.115 -
Support lvchange --errorwhenfull for thin pools.
Improve the processing and reporting of duplicate PVs.
Report lv_health_status and health attribute also for thin pool.
- Add lv_error_when_full reporting field.
+ Add lv_when_full reporting field.
Add support for lvcreate --errorwhenfull y|n for thin pools.
Fix lvconvert --repair to honour resilience requirement for segmented RAID LV.
Filter out partitioned device-mapper devices as unsuitable for use as PVs.
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index eb67d20..683ec47 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -211,11 +211,6 @@ uint64_t lvseg_size(const struct lv_segment *seg)
return (uint64_t) seg->len * seg->lv->vg->extent_size;
}
-uint32_t lv_error_when_full(const struct logical_volume *lv)
-{
- return (lv_is_thin_pool(lv) && (lv->status & LV_ERROR_WHEN_FULL)) ? 1 : 0;
-}
-
uint32_t lv_kernel_read_ahead(const struct logical_volume *lv)
{
struct lvinfo info;
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 25eca80..449536b 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -51,7 +51,7 @@ FIELD(LVS, lv, BIN, "FixMin", lvid, 10, lvfixedminor, lv_fixed_minor, "Set if LV
FIELD(LVS, lv, BIN, "MergeFailed", lvid, 15, lvmergefailed, lv_merge_failed, "Set if snapshot merge failed.", 0)
FIELD(LVS, lv, BIN, "SnapInvalid", lvid, 15, lvsnapshotinvalid, lv_snapshot_invalid, "Set if snapshot LV is invalid.", 0)
FIELD(LVS, lv, BIN, "SkipAct", lvid, 15, lvskipactivation, lv_skip_activation, "Set if LV is skipped on activation.", 0)
-FIELD(LVS, lv, BIN, "WhenFull", lvid, 15, lverrorwhenfull, lv_error_when_full, "For thin pools, behavior when full.", 0)
+FIELD(LVS, lv, STR, "WhenFull", lvid, 15, lvwhenfull, lv_when_full, "For thin pools, behavior when full.", 0)
FIELD(LVS, lv, STR, "Active", lvid, 6, lvactive, lv_active, "Active state of the LV.", 0)
FIELD(LVS, lv, BIN, "ActLocal", lvid, 10, lvactivelocally, lv_active_locally, "Set if the LV is active locally.", 0)
FIELD(LVS, lv, BIN, "ActRemote", lvid, 10, lvactiveremotely, lv_active_remotely, "Set if the LV is active remotely.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index cece62c..8866928 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -281,8 +281,8 @@ GET_LV_STR_PROPERTY_FN(lv_attr, lv_attr_dup(lv->vg->vgmem, lv))
GET_LV_NUM_PROPERTY_FN(lv_major, lv->major)
#define _lv_major_set prop_not_implemented_set
GET_LV_NUM_PROPERTY_FN(lv_minor, lv->minor)
-#define _lv_error_when_full_set prop_not_implemented_set
-GET_LV_NUM_PROPERTY_FN(lv_error_when_full, lv_error_when_full(lv))
+#define _lv_when_full_get prop_not_implemented_get
+#define _lv_when_full_set prop_not_implemented_set
#define _lv_minor_set prop_not_implemented_set
GET_LV_NUM_PROPERTY_FN(lv_read_ahead, lv->read_ahead * SECTOR_SIZE)
#define _lv_read_ahead_set prop_not_implemented_set
diff --git a/lib/report/report.c b/lib/report/report.c
index 3331e5e..53de714 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -729,14 +729,23 @@ static int _int32_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((
return dm_report_field_int32(rh, field, data);
}
-static int _lverrorwhenfull_disp(struct dm_report *rh, struct dm_pool *mem,
- struct dm_report_field *field,
- const void *data, void *private __attribute__((unused)))
+static int _lvwhenfull_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private __attribute__((unused)))
{
const struct logical_volume *lv = (const struct logical_volume *) data;
- return _binary_disp(rh, mem, field, lv_error_when_full(lv),
- GET_FIRST_RESERVED_NAME(lv_error_when_full_y), private);
+ if (lv_is_thin_pool(lv)) {
+ if (lv->status & LV_ERROR_WHEN_FULL)
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(lv_when_full_error),
+ GET_FIELD_RESERVED_VALUE(lv_when_full_error));
+ else
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(lv_when_full_queue),
+ GET_FIELD_RESERVED_VALUE(lv_when_full_queue));
+ }
+
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(lv_when_full_undef),
+ GET_FIELD_RESERVED_VALUE(lv_when_full_undef));
}
static int _lvreadahead_disp(struct dm_report *rh, struct dm_pool *mem,
diff --git a/lib/report/values.h b/lib/report/values.h
index 9d7b272..bc42563 100644
--- a/lib/report/values.h
+++ b/lib/report/values.h
@@ -68,7 +68,6 @@ FIELD_RESERVED_BINARY_VALUE(lv_image_synced, lv_image_synced, "", "image synced"
FIELD_RESERVED_BINARY_VALUE(lv_merging, lv_merging, "", "merging")
FIELD_RESERVED_BINARY_VALUE(lv_converting, lv_converting, "", "converting")
FIELD_RESERVED_BINARY_VALUE(lv_allocation_locked, lv_allocation_locked, "", "allocation locked", "locked")
-FIELD_RESERVED_BINARY_VALUE(lv_error_when_full, lv_error_when_full, "", "error when full", "error if no space", "error")
FIELD_RESERVED_BINARY_VALUE(lv_fixed_minor, lv_fixed_minor, "", "fixed minor", "fixed")
FIELD_RESERVED_BINARY_VALUE(lv_active_locally, lv_active_locally, "", "active locally", "active", "locally")
FIELD_RESERVED_BINARY_VALUE(lv_active_remotely, lv_active_remotely, "", "active remotely", "active", "remotely")
@@ -85,6 +84,9 @@ FIELD_RESERVED_VALUE(lv_permissions, lv_permissions_rw, "", "writeable", "writea
FIELD_RESERVED_VALUE(lv_permissions, lv_permissions_r, "", "read-only", "read-only", "r", "ro")
FIELD_RESERVED_VALUE(lv_permissions, lv_permissions_r_override, "", "read-only-override", "read-only-override", "ro-override", "r-override", "R")
FIELD_RESERVED_VALUE(lv_read_ahead, lv_read_ahead_auto, "", &GET_TYPE_RESERVED_VALUE(num_undef_64), "auto")
+FIELD_RESERVED_VALUE(lv_when_full, lv_when_full_error, "", "error", "error", "error when full", "error if no space")
+FIELD_RESERVED_VALUE(lv_when_full, lv_when_full_queue, "", "queue", "queue", "queue when full", "queue if no space")
+FIELD_RESERVED_VALUE(lv_when_full, lv_when_full_undef, "", "", "", "undefined")
/* Reserved values for SEG fields */
FIELD_RESERVED_VALUE(cache_policy, cache_policy_undef, "", "", "", "undefined")
9 years, 3 months