master - lvmthin: include errorwhenfull
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5e8f362c9eaae7...
Commit: 5e8f362c9eaae7bbcf69fd779d8c441f7de9042a
Parent: a164d603d386c5daed06b46316ef3c001807dff9
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jan 20 10:45:47 2015 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jan 20 13:28:34 2015 -0600
lvmthin: include errorwhenfull
and don't display the size of pmspare to avoid setting an
expectation of a specific size.
---
man/lvmthin.7.in | 51 +++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 84a3138..b2db5a7 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -398,10 +398,10 @@ explicitly.
# lvconvert \-\-type thin\-pool \-\-poolmetadata vg/pool0meta vg/pool0
# lvs \-a
- [lvol0_pmspare] vg ewi------- 10.00g
- pool0 vg twi---tz-- 10.00g
- [pool0_tdata] vg Twi------- 10.00g
- [pool0_tmeta] vg ewi------- 1.00g
+ [lvol0_pmspare] vg ewi-------
+ pool0 vg twi---tz--
+ [pool0_tdata] vg Twi-------
+ [pool0_tmeta] vg ewi-------
.fi
The "Metadata check and repair" section describes the use of
@@ -715,8 +715,47 @@ For a 1G pool, using 700M will trigger a resize to 1.2G. When the usage exceeds
\&
-If thin pool data space is exhausted, writes to thin LVs will be queued
-until the the data space is extended. Reading is still possible.
+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.
+
+Command to change the handling of data space exhaustion of an existing
+thin pool LV:
+
+.B lvchange --errorwhenfull {y|n} VG/ThinPoolLV
+
+The current setting can be displayed with the lvs -o+error_when_full
+command.
+
+.B errorwhenfull n
+
+This is the default. Writes to thin LVs are accepted and queued, with the
+expectation that pool data space will be extended soon. Once data space
+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.
+
+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.
+
+.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.)
+
When data space is exhausted, the lvs command displays 100 under Data% for
the thin pool LV:
9 years, 3 months
master - vgimportclone: remove arg check that uses pvs
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a164d603d386c5...
Commit: a164d603d386c5daed06b46316ef3c001807dff9
Parent: 404c834e14657645d70d19b825d328bff5b165b7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jan 20 13:08:22 2015 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jan 20 13:08:22 2015 -0600
vgimportclone: remove arg check that uses pvs
The arg check using pvs is unnecessary. If the arg is not a PV,
the command will just fail later. Using the pvs command at this
point in the command is a problem when lvmetad is running, because
the pvs command does not report duplicate PVs when using lvmetad.
(Alternatively, use_lvmetad could be disabled by adding a --config
override to this pvs command.)
---
scripts/vgimportclone.sh | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index 9d319bd..388d14c 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -204,11 +204,6 @@ for ARG
do
if [ -b "$ARG" ]
then
- PVS_OUT=`"${LVM}" pvs ${LVM_OPTS} --noheadings -o vg_name "$ARG"`
- checkvalue $? "$ARG could not be verified to be a PV without errors."
- PV_VGNAME=$(echo $PVS_OUT | $GREP -v '[[:space:]]+$')
- [ -z "$PV_VGNAME" ] && die 3 "$ARG is not in a VG."
-
ln -s "$ARG" ${TMP_LVM_SYSTEM_DIR}/vgimport${DEVNO}
DISKS="${DISKS} ${TMP_LVM_SYSTEM_DIR}/vgimport${DEVNO}"
DEVNO=$((${DEVNO}+1))
9 years, 3 months
master - report: Fix warning in _str_list_append.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=404c834e146576...
Commit: 404c834e14657645d70d19b825d328bff5b165b7
Parent: 87e80b6aac630f0c26d128006c975841a76ca890
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Jan 20 17:15:28 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Jan 20 17:15:28 2015 +0000
report: Fix warning in _str_list_append.
../../lib/report/report.c: In function ‘_str_list_append’:
../../lib/report/report.c:256: warning: declaration of ‘dup’ shadows a global declaration
---
lib/report/report.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/report/report.c b/lib/report/report.c
index b3365b0..3331e5e 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -253,11 +253,14 @@ struct _str_list_append_baton {
static int _str_list_append(const char *line, void *baton)
{
struct _str_list_append_baton *b = baton;
- const char *dup = dm_pool_strdup(b->mem, line);
- if (!dup)
+ const char *line2 = dm_pool_strdup(b->mem, line);
+
+ if (!line2)
return_0;
- if (!str_list_add(b->mem, b->result, dup))
+
+ if (!str_list_add(b->mem, b->result, line2))
return_0;
+
return 1;
}
9 years, 3 months
master - report: proper lv_attr_dup emulation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87e80b6aac630f...
Commit: 87e80b6aac630f0c26d128006c975841a76ca890
Parent: 158e9988768be344c0c97acdf52d1c020ab8c83e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 20 16:24:45 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 20 16:24:45 2015 +0100
report: proper lv_attr_dup emulation
We need to create a mempool for proper emulation of lv_attr_dup
for lvm2api.
---
lib/metadata/lv.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 540eedb..eb67d20 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -827,14 +827,23 @@ out:
/* backward compatible internal API for lvm2api, TODO improve it */
char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
{
+ char *ret = NULL;
struct lv_with_info_and_seg_status status = {
- .seg_status.type = SEG_STATUS_NONE
+ .seg_status.type = SEG_STATUS_NONE,
+ .lv = lv
};
+ if (!(status.seg_status.mem = dm_pool_create("reporter_pool", 1024)))
+ return_0;
+
if (!lv_info_with_seg_status(lv->vg->cmd, lv, first_seg(lv), 1, &status, 1, 1))
- return_NULL;
+ goto_bad;
+
+ ret = lv_attr_dup_with_info_and_seg_status(mem, &status);
+bad:
+ dm_pool_destroy(status.seg_status.mem);
- return lv_attr_dup_with_info_and_seg_status(mem, &status);
+ return ret;
}
int lv_set_creation(struct logical_volume *lv,
9 years, 3 months
master - report: add separate LVSINFOSTATUS field type for info+status combined fields
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=158e9988768be3...
Commit: 158e9988768be344c0c97acdf52d1c020ab8c83e
Parent: 75b786c5ef557b690e5638b6702ad19f20cb13f1
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jan 20 16:02:48 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jan 20 16:10:59 2015 +0100
report: add separate LVSINFOSTATUS field type for info+status combined fields
Add separate LVSINFOSTATUS field type for fields which display both
dm info-like and dm status-like information.
The internal interface is there with the introduction of LVSSTATUS
field type which can cope with the combination of LVSSTATUS
and LVSINFO field types (several fields).
However, till now, we considered that *single* field can display
either LVSINFO or LVSSTATUS, but not both at the same time.
Till now, we haven't had single field which needs both - hence
add LVSINFOSTATUS field type for such fields as we currently
need this for the lv_attr field which requires combination of
info and status.
This patch just adds interface for an ability to register such fields
(the code that copes with this is already in).
---
lib/report/columns.h | 2 +-
lib/report/report.c | 1 +
lib/report/report.h | 15 ++++++++-------
tools/reporter.c | 12 +++++++-----
4 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 2b788c1..25eca80 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -38,7 +38,7 @@ FIELD(LVS, lv, STR, "LV", lvid, 4, lvfullname, lv_full_name, "Full name of LV in
FIELD(LVS, lv, STR, "Path", lvid, 4, lvpath, lv_path, "Full pathname for LV. Blank for internal LVs.", 0)
FIELD(LVS, lv, STR, "DMPath", lvid, 6, lvdmpath, lv_dm_path, "Internal device-mapper pathname for LV (in /dev/mapper directory).", 0)
FIELD(LVS, lv, STR, "Parent", lvid, 6, lvparent, lv_parent, "For LVs that are components of another LV, the parent LV.", 0)
-FIELD(LVSINFO, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0)
+FIELD(LVSINFOSTATUS, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0)
FIELD(LVS, lv, STR_LIST, "Layout", lvid, 10, lvlayout, lv_layout, "LV layout.", 0)
FIELD(LVS, lv, STR_LIST, "Role", lvid, 10, lvrole, lv_role, "LV role.", 0)
FIELD(LVS, lv, BIN, "InitImgSync", lvid, 10, lvinitialimagesync, lv_initial_image_sync, "Set if mirror/RAID images underwent initial resynchronization.", 0)
diff --git a/lib/report/report.c b/lib/report/report.c
index 01e8f06..b3365b0 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1904,6 +1904,7 @@ static const struct dm_report_object_type _report_types[] = {
{ LVS, "Logical Volume", "lv_", _obj_get_lv },
{ LVSINFO, "Logical Volume Device Info", "lv_", _obj_get_lv_with_info_and_seg_status },
{ LVSSTATUS, "Logical Volume Device Status", "lv_", _obj_get_lv_with_info_and_seg_status },
+ { LVSINFOSTATUS, "Logical Volume Device Info and Status Combined", "lv_", _obj_get_lv_with_info_and_seg_status },
{ PVS, "Physical Volume", "pv_", _obj_get_pv },
{ LABEL, "Physical Volume Label", "pv_", _obj_get_label },
{ SEGS, "Logical Volume Segment", "seg_", _obj_get_seg },
diff --git a/lib/report/report.h b/lib/report/report.h
index 8ff3454..563f684e18 100644
--- a/lib/report/report.h
+++ b/lib/report/report.h
@@ -24,13 +24,14 @@ typedef enum {
LVS = 1,
LVSINFO = 2,
LVSSTATUS = 4,
- PVS = 8,
- VGS = 16,
- SEGS = 32,
- SEGSSTATUS = 64,
- PVSEGS = 128,
- LABEL = 256,
- DEVTYPES = 512
+ LVSINFOSTATUS = 8,
+ PVS = 16,
+ VGS = 32,
+ SEGS = 64,
+ SEGSSTATUS = 128,
+ PVSEGS = 256,
+ LABEL = 512,
+ DEVTYPES = 1024
} report_type_t;
struct field;
diff --git a/tools/reporter.c b/tools/reporter.c
index b5edfa6..29d326c 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -523,17 +523,17 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
return_ECMD_FAILED;
/* Do we need to acquire LV device info in addition? */
- lv_info_needed = (report_type & LVSINFO) ? 1 : 0;
+ lv_info_needed = (report_type & (LVSINFO | LVSINFOSTATUS)) ? 1 : 0;
/* Do we need to acquire LV device status in addition? */
- lv_segment_status_needed = (report_type & (SEGSSTATUS | LVSSTATUS)) ? 1 : 0;
+ lv_segment_status_needed = (report_type & (SEGSSTATUS | LVSSTATUS | LVSINFOSTATUS)) ? 1 : 0;
/* Ensure options selected are compatible */
if (report_type & (SEGS | SEGSSTATUS))
report_type |= LVS;
if (report_type & PVSEGS)
report_type |= PVS;
- if ((report_type & (LVS | LVSINFO | LVSSTATUS)) && (report_type & (PVS | LABEL)) && !args_are_pvs) {
+ if ((report_type & (LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS)) && (report_type & (PVS | LABEL)) && !args_are_pvs) {
log_error("Can't report LV and PV fields at the same time");
dm_report_free(report_handle);
return ECMD_FAILED;
@@ -541,7 +541,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
/* Change report type if fields specified makes this necessary */
if ((report_type & PVSEGS) ||
- ((report_type & (PVS | LABEL)) && (report_type & (LVS | LVSINFO | LVSSTATUS))))
+ ((report_type & (PVS | LABEL)) && (report_type & (LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS))))
report_type = PVSEGS;
else if ((report_type & LABEL) && (report_type & VGS))
report_type = PVS;
@@ -549,7 +549,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
report_type = PVS;
else if (report_type & (SEGS | SEGSSTATUS))
report_type = SEGS;
- else if (report_type & (LVS | LVSINFO | LVSSTATUS))
+ else if (report_type & (LVS | LVSINFO | LVSSTATUS | LVSINFOSTATUS))
report_type = LVS;
/*
@@ -574,6 +574,8 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
/* fall through */
case LVSSTATUS:
/* fall through */
+ case LVSINFOSTATUS:
+ /* fall through */
case LVS:
r = process_each_lv(cmd, argc, argv, 0, report_handle,
lv_info_needed && !lv_segment_status_needed ? &_lvs_with_info_single :
9 years, 3 months
master - thin: support errorwhenfull with thin creation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=75b786c5ef557b...
Commit: 75b786c5ef557b690e5638b6702ad19f20cb13f1
Parent: a625812bec4597adb6e71816130dacac2ff38b34
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 20 15:43:16 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 20 15:43:16 2015 +0100
thin: support errorwhenfull with thin creation
When thinpool and thinvolume are created at the same time,
still support usage of --errorwhenfull.
---
tools/lvcreate.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index fd5ac39..3f7fe6f 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -951,7 +951,8 @@ static int _lvcreate_params(struct cmd_context *cmd,
-1))
return_0;
- if (!seg_can_error_when_full(lp) && arg_is_set(cmd, errorwhenfull_ARG)) {
+ if (!seg_can_error_when_full(lp) && !lp->create_pool &&
+ arg_is_set(cmd, errorwhenfull_ARG)) {
log_error("Segment type %s does not support --errorwhenfull.", lp->segtype->name);
return 0;
}
9 years, 3 months
master - report: use info
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a625812bec4597...
Commit: a625812bec4597adb6e71816130dacac2ff38b34
Parent: 3b78d5237ddc7dc8d328bd1b16628c5a61454826
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 20 15:25:05 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 20 15:25:05 2015 +0100
report: use info
Use LVSINFO since LVSSTATUS only fills status
---
lib/report/columns.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index fbbbe9d..2b788c1 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -38,7 +38,7 @@ FIELD(LVS, lv, STR, "LV", lvid, 4, lvfullname, lv_full_name, "Full name of LV in
FIELD(LVS, lv, STR, "Path", lvid, 4, lvpath, lv_path, "Full pathname for LV. Blank for internal LVs.", 0)
FIELD(LVS, lv, STR, "DMPath", lvid, 6, lvdmpath, lv_dm_path, "Internal device-mapper pathname for LV (in /dev/mapper directory).", 0)
FIELD(LVS, lv, STR, "Parent", lvid, 6, lvparent, lv_parent, "For LVs that are components of another LV, the parent LV.", 0)
-FIELD(LVSSTATUS, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0)
+FIELD(LVSINFO, lv, STR, "Attr", lvid, 4, lvstatus, lv_attr, "Various attributes - see man page.", 0)
FIELD(LVS, lv, STR_LIST, "Layout", lvid, 10, lvlayout, lv_layout, "LV layout.", 0)
FIELD(LVS, lv, STR_LIST, "Role", lvid, 10, lvrole, lv_role, "LV role.", 0)
FIELD(LVS, lv, BIN, "InitImgSync", lvid, 10, lvinitialimagesync, lv_initial_image_sync, "Set if mirror/RAID images underwent initial resynchronization.", 0)
9 years, 3 months
master - cleanup: indent
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3b78d5237ddc7d...
Commit: 3b78d5237ddc7dc8d328bd1b16628c5a61454826
Parent: 3cef00c4ca25237ed045ae5def506128f8678e21
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 20 12:43:16 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 20 15:02:19 2015 +0100
cleanup: indent
---
lib/activate/activate.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 20c7c98..424786c 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -749,8 +749,7 @@ int lv_info_with_seg_status(struct cmd_context *cmd, const struct logical_volume
* we need to acquire info and status separately!
*/
return _lv_info(cmd, lv, use_layer, &status->info, NULL, NULL, with_open_count, with_read_ahead) &&
- _lv_info(cmd, lv_seg->lv, use_layer, NULL, lv_seg,
- &status->seg_status, 0, 0);
+ _lv_info(cmd, lv_seg->lv, use_layer, NULL, lv_seg, &status->seg_status, 0, 0);
}
#define OPEN_COUNT_CHECK_RETRIES 25
9 years, 3 months
master - man: errorwhenfull doc
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3cef00c4ca2523...
Commit: 3cef00c4ca25237ed045ae5def506128f8678e21
Parent: d80d832ae963e1d7bae94e96fd2d5362042fbfea
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 15 15:20:57 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 20 15:02:19 2015 +0100
man: errorwhenfull doc
---
man/lvchange.8.in | 15 +++++++++++----
man/lvcreate.8.in | 11 +++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 4577cce..bb5bea5 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -31,6 +31,8 @@ lvchange \(em change attributes of a logical volume
.RB [ \-\-detachprofile ]
.RB [ \-\-discards
.RI { ignore | nopassdown | passdown }]
+.RB [ \-\-errorwhenfull
+.RI { y | n }]
.RB [ \-\-resync ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-ignorelockingfailure ]
@@ -82,15 +84,15 @@ See \fBlvm\fP(8) for common options.
Controls the availability of the logical volumes for use.
Communicates with the kernel device-mapper driver via
libdevmapper to activate (\-ay) or deactivate (\-an) the
-logical volumes.
+logical volumes.
.IP
Activation of a logical volume creates a symbolic link
/dev/VolumeGroupName/LogicalVolumeName pointing to the device node.
This link is removed on deactivation.
All software and scripts should access the device through
this symbolic link and present this as the name of the device.
-The location and name of the underlying device node may depend on
-the distribution and configuration (e.g. udev) and might change
+The location and name of the underlying device node may depend on
+the distribution and configuration (e.g. udev) and might change
from release to release.
.IP
If autoactivation option is used (\-aay),
@@ -156,9 +158,14 @@ Set this to \fIignore\fP to ignore any discards received by a
thin pool Logical Volume. Set to \fInopassdown\fP to process such
discards within the thin pool itself and allow the no-longer-needed
extents to be overwritten by new data. Set to \fIpassdown\fP (the
-default) to process them both within the thin pool itself and to
+default) to process them both within the thin pool itself and to
pass them down the underlying device.
.TP
+.BR \-\-errorwhenfull " {" \fIy | \fIn }
+Sets thin pool behavior when data space is exhaused. See
+.BR lvcreate (8)
+for information.
+.TP
.B \-\-resync
Forces the complete resynchronization of a mirror. In normal
circumstances you should not need this option because synchronization
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index cc51546..8c1ee4b 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -25,6 +25,8 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-d | \-\-debug ]
.RB [ \-\-discards
.RI { ignore | nopassdown | passdown }]
+.RB [ \-\-errorwhenfull
+.RI { y | n }]
.RB [{ \-l | \-\-extents
.IR LogicalExtentsNumber [ % { FREE | PVS | VG }]
|
@@ -230,6 +232,15 @@ This is shortcut for option \fB\-\-mirrorlog\fP \fIcore\fP.
Sets discards behavior for thin pool.
Default is \fIpassdown\fP.
.TP
+.BR \-\-errorwhenfull " {" \fIy |\fIn }
+Configures thin pool behaviour when data space is exhausted.
+Default is \fIn\fPo.
+Device will queue I/O operations until target timeout
+(see dm-thin-pool kernel module option \fIno_space_timeout\fP)
+expires. Thus configured system has a time to i.e. extend
+the size of thin pool data device.
+When set to \fIy\fPes, the I/O operation is immeditelly errored.
+.TP
.BR \-K ", " \-\-ignoreactivationskip
Ignore the flag to skip Logical Volumes during activation.
Use \fB\-\-setactivationskip\fP option to set or reset
9 years, 3 months
master - report: seg_monitor undefined
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d80d832ae963e1...
Commit: d80d832ae963e1d7bae94e96fd2d5362042fbfea
Parent: ae8b9baa04d8d24133ec7a2e80762ae5c7b6490f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 20 14:36:21 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 20 15:02:10 2015 +0100
report: seg_monitor undefined
Add 'undefined' value for segment which do not support monitoring.
Fixes crash for commands like 'pvs -o+seg_monitor'.
---
WHATS_NEW | 1 +
lib/metadata/lv.c | 1 +
lib/report/report.c | 7 ++++++-
lib/report/values.h | 1 +
4 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0c96d5b..022e4cf 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.115 -
=====================================
+ Report segment types without monitoring support as undefined.
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.
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index cb6577d..540eedb 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -157,6 +157,7 @@ char *lvseg_monitor_dup(struct dm_pool *mem, const struct lv_segment *seg)
// log_debug("Query LV:%s mon:%s segm:%s tgtm:%p segmon:%d statusm:%d", seg->lv->name, segm->lv->name, segm->segtype->name, segm->segtype->ops->target_monitored, seg_monitored(segm), (int)(segm->status & PVMOVE));
if ((dmeventd_monitor_mode() != 1) ||
+ !segm->segtype->ops ||
!segm->segtype->ops->target_monitored)
/* Nothing to do, monitoring not supported */;
else if (lv_is_cow_covering_origin(seg->lv))
diff --git a/lib/report/report.c b/lib/report/report.c
index 4338190..01e8f06 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -776,9 +776,14 @@ static int _segmonitor_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
{
+ const struct lv_segment *seg = (const struct lv_segment *)data;
char *str;
- if (!(str = lvseg_monitor_dup(mem, (const struct lv_segment *)data)))
+ if (!seg->segtype->ops || !seg->segtype->ops->target_monitored)
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(seg_monitor_undef),
+ GET_FIELD_RESERVED_VALUE(seg_monitor_undef));
+
+ if (!(str = lvseg_monitor_dup(mem, seg)))
return_0;
return _field_set_value(field, str, NULL);
diff --git a/lib/report/values.h b/lib/report/values.h
index 2b2a4d3..9d7b272 100644
--- a/lib/report/values.h
+++ b/lib/report/values.h
@@ -88,6 +88,7 @@ FIELD_RESERVED_VALUE(lv_read_ahead, lv_read_ahead_auto, "", &GET_TYPE_RESERVED_V
/* Reserved values for SEG fields */
FIELD_RESERVED_VALUE(cache_policy, cache_policy_undef, "", "", "", "undefined")
+FIELD_RESERVED_VALUE(seg_monitor, seg_monitor_undef, "", "", "", "undefined")
FIELD_RESERVED_VALUE(lv_health_status, health_undef, "", "", "", "undefined")
/* TODO the following 2 need STR_LIST support for reserved values
FIELD_RESERVED_VALUE(cache_settings, cache_settings_default, "", "default", "default")
9 years, 3 months