Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5e8f362c9eaae7bb…
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:
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a164d603d386c5da…
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))
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=75b786c5ef557b69…
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;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3cef00c4ca25237e…
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