Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=373f95a921223c1e…
Commit: 373f95a921223c1e4d36ae975ac685227369cf5b
Parent: 6311be29e40af21a53ef2a09a99867fc4460a73e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jul 23 15:15:04 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jul 23 15:15:04 2013 +0200
snapshot: update merging fix
Activation is needed only for clustered VG.
For non-clustered VG skip activation, since deactivate_lv()
is called without problems (no testing for lock presence).
(updates f6ded62291682e40c7976d27e48915d9d1538940)
---
lib/metadata/snapshot_manip.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
index ab28890..325a4e8 100644
--- a/lib/metadata/snapshot_manip.c
+++ b/lib/metadata/snapshot_manip.c
@@ -298,10 +298,12 @@ int vg_remove_snapshot(struct logical_volume *cow)
}
/*
- * For merged snapshot we activate cow so it can clean
- * left table entries and deactivate_lv() follows shortly.
+ * For merged snapshot and clustered VG activate cow LV so
+ * the following call to deactivate_lv() can clean-up table
+ * entries. For this clustered lock need to be held.
*/
- if (merging_snapshot && !activate_lv(cow->vg->cmd, cow)) {
+ if (vg_is_clustered(cow->vg) &&
+ merging_snapshot && !activate_lv(cow->vg->cmd, cow)) {
log_error("Failed to activate %s.", cow->name);
return 0;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9b1834f075daf0fb…
Commit: 9b1834f075daf0fb3f349356a31c1bfed421384a
Parent: 83fb622598458e6814eb0d5dde23eda18c6ac620
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jul 23 14:44:30 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jul 23 14:45:30 2013 +0200
man: pvs -o ba_start,ba_size -> pv_ba_start,pv_ba_size
---
WHATS_NEW | 2 +-
man/pvcreate.8.in | 2 +-
man/pvs.8.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 15419bb..0269839 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -111,7 +111,7 @@ Version 2.02.99 -
Add --withcomments and --withversions switch to lvm dumpconfig.
Add --type {current|default|missing|new} and --atversion to lvm dumpconfig.
Support automatic config validation and add 'config' section to lvm.conf.
- Add pvs -o ba_start,ba_size to report bootloader area start and size.
+ Add pvs -o pv_ba_start,pv_ba_size to report bootloader area start and size.
Add --bootloaderareasize to pvcreate and vgconvert to create a bootloader area.
Add PV header extension: extension version, flags and bootloader areas.
Initial support for lvconvert of thin external origin.
diff --git a/man/pvcreate.8.in b/man/pvcreate.8.in
index bd979aa..9353c6c 100644
--- a/man/pvcreate.8.in
+++ b/man/pvcreate.8.in
@@ -174,7 +174,7 @@ The start of the bootloader area is always aligned, see also \fB--dataalignment\
and \fB--dataalignmentoffset\fP. The bootloader area size may eventually
end up increased due to the alignment, but it's never less than the
size that is requested. To see the bootloader area start and size of
-an existing Physical Volume use \fBpvs -o +ba_start,ba_size\fP.
+an existing Physical Volume use \fBpvs -o +pv_ba_start,pv_ba_size\fP.
.TP
.B \-\-setphysicalvolumesize \fIsize
Overrides the automatically-detected size of the PV. Use with care.
diff --git a/man/pvs.8.in b/man/pvs.8.in
index 7ec724a..d1f6e8b 100644
--- a/man/pvs.8.in
+++ b/man/pvs.8.in
@@ -63,7 +63,7 @@ and \fB-o pvseg_all\fP to select all Physical Volume segment columns.
Use \fB-o help\fP to view the full list of columns available.
.IP
Column names include: pv_fmt, pv_uuid, dev_size, pv_name, pv_mda_free,
-pv_mda_size, ba_start, ba_size, pe_start, pv_size, pv_free, pv_used,
+pv_mda_size, pv_ba_start, pv_ba_size, pe_start, pv_size, pv_free, pv_used,
pv_attr, pv_pe_count, pv_pe_alloc_count, pv_tags, pv_mda_count,
pv_mda_used_count, pvseg_start, and pvseg_size
.IP
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=83fb622598458e68…
Commit: 83fb622598458e6814eb0d5dde23eda18c6ac620
Parent: 84801d7c34430052e298bc54826e18eb68212ec6
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Jul 23 13:33:35 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Jul 23 13:33:35 2013 +0100
deptree: don't remove live node on resume failure
When resuming a node needed by a higher layer of the tree,
if the resume fails, only remove it if the node did not
originally have a live table.
Ref. 97f8454eccefe29464336ba1823448f4d1fa009b
---
libdm/libdm-deptree.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 34cd960..57f00f6 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -2534,12 +2534,15 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
log_error("Unable to resume %s (%" PRIu32
":%" PRIu32 ")", child->name, child->info.major,
child->info.minor);
- if (!_deactivate_node(child->name, child->info.major, child->info.minor,
+ /* If the device was not previously active, we might as well remove this node. */
+ if (!child->info.live_table &&
+ !_deactivate_node(child->name, child->info.major,child->info.minor,
&child->dtree->cookie, child->udev_flags, 0))
log_error("Unable to deactivate %s (%" PRIu32
":%" PRIu32 ")", child->name, child->info.major,
child->info.minor);
r = 0;
+ /* Each child is handled independently */
continue;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eb5a6a0d1a867aa7…
Commit: eb5a6a0d1a867aa793e68f99c9a01027b182af65
Parent: f6ded62291682e40c7976d27e48915d9d1538940
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Jul 22 13:02:32 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Mon Jul 22 13:02:32 2013 -0500
Man Pages: Update man pages to reflect changes to various RAID options
Some of the names for various RAID options have been changed and the man
pages need to reflect it.
lvcreate:
from: minrecoveryrate to: [raid]minrecoveryrate
from: maxrecoveryrate to: [raid]maxrecoveryrate
* plus better clarity on what the arg to these options is
specifying
lvchange:
from: minrecoveryrate to: [raid]minrecoveryrate
from: maxrecoveryrate to: [raid]maxrecoveryrate
* plus better clarity on what the arg to these options is
specifying
from: syncaction to: [raid]syncaction
from: writebehind to [raid]writebehind
* plus change arg from BehindCount to IO/count
from: writemostly to: [raid]writemostly
* plus addition to document [:{t|n|y}] option
lvs:
from: mismatches to: raid_mismatch_count
from: sync_action to: raid_sync_action
add : raid_min|max_recovery_rate, raid_write_behind
---
man/lvchange.8.in | 68 +++++++++++++++++++++++++++-------------------------
man/lvcreate.8.in | 20 +++++++-------
man/lvs.8.in | 7 ++++-
3 files changed, 50 insertions(+), 45 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 3b6c574..ea8a6ef 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -31,12 +31,16 @@ lvchange \- change attributes of a logical volume
.RI { y | n }]
.RB [ \-\-poll
.RI { y | n }]
-.RB [ \-\-maxrecoveryrate
+.RB [ \-\-[raid]maxrecoveryrate
.IR Rate ]
-.RB [ \-\-minrecoveryrate
+.RB [ \-\-[raid]minrecoveryrate
.IR Rate ]
-.RB [ \-\-syncaction
+.RB [ \-\-[raid]syncaction
.RI { check | repair }]
+.RB [ \-\-[raid]writebehind
+.IR IOCount ]
+.RB [ \-\-[raid]writemostly
+.IR PhysicalVolume[:{t|n|y}] ]
.RB [ \-\-sysinit ]
.RB [ \-\-noudevsync ]
.RB [ \-M | \-\-persistent
@@ -51,8 +55,6 @@ lvchange \- change attributes of a logical volume
.RB [ \-\-refresh ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
-.RB [ \-\-writebehind BehindCount ]
-.RB [ \-\-writemostly PhysicalVolume ]
.RB [ \-Z | \-\-zero
.RI { y | n }]
.I LogicalVolumePath
@@ -138,19 +140,19 @@ process from its last checkpoint. However, it may not be appropriate to
immediately poll a logical volume when it is activated, use
\fB\-\-poll n\fP to defer and then \fB\-\-poll y\fP to restart the process.
.TP
-.IR \fB\-\-maxrecoveryrate " " \fIRate [ bBsSkKmMgG ]
+.IR \fB\-\-[raid]maxrecoveryrate " " \fIRate [ bBsSkKmMgG ]
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
-is specified as a size/sec/device. If no suffix is given, then
-kiB/sec/device is assumed. Setting the recovery rate to 0 means
-it will be unbounded.
+is specified as an amount per second for each device in the array.
+If no suffix is given, then kiB/sec/device is assumed. Setting the
+recovery rate to 0 means it will be unbounded.
.TP
-.IR \fB\-\-minrecoveryrate " " \fIRate [ bBsSkKmMgG ]
+.IR \fB\-\-[raid]minrecoveryrate " " \fIRate [ bBsSkKmMgG ]
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
-is specified as a size/sec/device. If no suffix is given, then
-kiB/sec/device is assumed. Setting the recovery rate to 0 means
-it will be unbounded.
+is specified as an amount per second for each device in the array.
+If no suffix is given, then kiB/sec/device is assumed. Setting the
+recovery rate to 0 means it will be unbounded.
.TP
-.BR \-\-syncaction " {" \fIcheck | \fIrepair }
+.BR \-\-[raid]syncaction " {" \fIcheck | \fIrepair }
This argument is used to initiate various RAID synchronization operations.
The \fIcheck\fP and \fIrepair\fP options provide a way to check the
integrity of a RAID logical volume (often referred to as "scrubbing").
@@ -162,6 +164,25 @@ If \fIrepair\fP is used, the discrepancies will be corrected as they are
encountered. The 'lvs' command can be used to show the number of
discrepancies found or repaired.
.TP
+.BR \-\-[raid]writebehind " IOCount"
+Specify the maximum number of outstanding writes that are allowed to
+devices in a RAID1 logical volume that are marked as \fIwrite-mostly\fP.
+Once this value is exceeded, writes become synchronous (i.e. all writes
+to the constituent devices must complete before the array signals the
+write has completed). Setting the value to zero clears the preference
+and allows the system to choose the value arbitrarily.
+.TP
+.BR \-\-[raid]writemostly " PhysicalVolume[:{t|y|n}]"
+Mark a device in a RAID1 logical volume as \fIwrite-mostly\fP. All reads
+to these drives will be avoided unless absolutely necessary. This keeps
+the number of I/Os to the drive to a minimum. The default behavior is to
+set the write-mostly attribute for the specified physical volume in the
+logical volume. It is possible to also remove the write-mostly flag by
+appending a ":n" to the physical volume or to toggle the value by specifying
+":t". The \fI--writemostly\fP argument can be specified more than one time
+in a single command; making it possible to toggle the write-mostly attributes
+for all the physical volumes in a logical volume at once.
+.TP
.B \-\-sysinit
Indicates that \fBlvchange\fP(8) is being invoked from early system
initialisation scripts (e.g. rc.sysinit or an initrd),
@@ -210,25 +231,6 @@ This is not necessary in normal operation, but may be useful
if something has gone wrong or if you're doing clustering
manually without a clustered lock manager.
.TP
-.BR \-\-writebehind " BehindCount"
-Specify the maximum number of outstanding writes that are allowed to
-devices in a RAID 1 logical volume that are marked as \fIwrite-mostly\fP.
-Once this value is exceeded, writes become synchronous (i.e. all writes
-to the constituent devices must complete before the array signals the
-write has completed). Setting the value to zero clears the preference
-and allows the system to choose the value arbitrarily.
-.TP
-.BR \-\-writemostly " PhysicalVolume[:{t|y|n}]"
-Mark a device in a RAID1 logical volume as \fIwrite-mostly\fP. All reads
-to these drives will be avoided unless absolutely necessary. This keeps
-the number of I/Os to the drive to a minimum. The default behavior is to
-set the write-mostly attribute for the specified physical volume in the
-logical volume. It is possible to also remove the write-mostly flag by
-appending a ":n" to the physical volume or to toggle the value by specifying
-":t". The \fI--writemostly\fP argument can be specified more than one time
-in a single command; making it possible to toggle the write-mostly attributes
-for all the physical volumes in a logical volume at once.
-.TP
.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
Set zeroing mode for thin pool. Note: already provisioned blocks from pool
in non-zero mode are not cleared in unwritten parts when setting zero to
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index ecbf363..681ff68 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -22,9 +22,9 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-\-ignoremonitoring ]
.RB [ \-\-monitor
.RI { y | n }]
-.RB [ \-\-maxrecoveryrate
+.RB [ \-\-[raid]maxrecoveryrate
.IR Rate ]
-.RB [ \-\-minrecoveryrate
+.RB [ \-\-[raid]minrecoveryrate
.IR Rate ]
.RB [ \-i | \-\-stripes
.IR Stripes
@@ -265,17 +265,17 @@ Sets the name for the new logical volume.
Without this option a default name of "lvol#" will be generated where
# is the LVM internal number of the logical volume.
.TP
-.IR \fB\-\-maxrecoveryrate " " \fIRate [ bBsSkKmMgG ]
+.IR \fB\-\-[raid]maxrecoveryrate " " \fIRate [ bBsSkKmMgG ]
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
-is specified as a size/sec/device. If no suffix is given, then
-kiB/sec/device is assumed. Setting the recovery rate to 0 means
-it will be unbounded.
+is specified as an amount per second for each device in the array.
+If no suffix is given, then kiB/sec/device is assumed. Setting the
+recovery rate to 0 means it will be unbounded.
.TP
-.IR \fB\-\-minrecoveryrate " " \fIRate [ bBsSkKmMgG ]
+.IR \fB\-\-[raid]minrecoveryrate " " \fIRate [ bBsSkKmMgG ]
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
-is specified as a size/sec/device. If no suffix is given, then
-kiB/sec/device is assumed. Setting the recovery rate to 0 means
-it will be unbounded.
+is specified as an amount per second for each device in the array.
+If no suffix is given, then kiB/sec/device is assumed. Setting the
+recovery rate to 0 means it will be unbounded.
.TP
.B \-\-noudevsync
Disables udev synchronisation. The
diff --git a/man/lvs.8.in b/man/lvs.8.in
index 4da4370..8f97dc2 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -98,12 +98,16 @@ lv_time,
lv_uuid,
metadata_lv,
mirror_log,
-mismatches,
modules,
move_pv,
origin,
origin_size,
pool_lv,
+raid_max_recovery_rate,
+raid_min_recovery_rate,
+raid_mismatch_count,
+raid_sync_action,
+raid_write_behind,
region_size,
segtype,
seg_count,
@@ -115,7 +119,6 @@ seg_tags,
snap_percent,
stripes,
stripe_size,
-sync_action,
sync_percent,
thin_count,
transaction_id,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f6ded62291682e40…
Commit: f6ded62291682e40c7976d27e48915d9d1538940
Parent: 6ca81a091c5a79bee0ec46c21aea643907ab2ca7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jul 22 16:20:36 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 22 16:26:00 2013 +0200
snapshot: fix merging
When the merging of snapshot is finished, we need to clean dm table
intries for snapshot and -cow device. So for merging snapshot
we have to activate_lv plain 'cow' LV and let the table
resolver to its work - shortly deactivation_lv() request
will follow - in cluster this needs LV lock to be held by clvmd.
Also update a test - add small wait - if lvremove is not 'fast enough'
and merging process has not been stopped and $lv1 removed in background.
Ortherwise the following lvcreate occasionally finds name $lv1 still in use.
(in release fix)
---
lib/metadata/snapshot_manip.c | 9 +++++++++
test/shell/snapshot-merge.sh | 6 ++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
index f949b23..ab28890 100644
--- a/lib/metadata/snapshot_manip.c
+++ b/lib/metadata/snapshot_manip.c
@@ -296,6 +296,15 @@ int vg_remove_snapshot(struct logical_volume *cow)
log_error("Failed to resume %s.", origin->name);
return 0;
}
+
+ /*
+ * For merged snapshot we activate cow so it can clean
+ * left table entries and deactivate_lv() follows shortly.
+ */
+ if (merging_snapshot && !activate_lv(cow->vg->cmd, cow)) {
+ log_error("Failed to activate %s.", cow->name);
+ return 0;
+ }
}
return 1;
diff --git a/test/shell/snapshot-merge.sh b/test/shell/snapshot-merge.sh
index 6e59ea7..0713934 100644
--- a/test/shell/snapshot-merge.sh
+++ b/test/shell/snapshot-merge.sh
@@ -78,6 +78,12 @@ dm_table $vg-$lv1 | grep " snapshot-merge " || dm_table $vg-$lv1 | grep " linear
# may test stopping an active merge
lvremove -f $vg/$lv1
+# wait a while if the merge and remove is still not finished
+# since it may still keep $lv1 in vg being present
+for i in 1 2 3 4 ; do
+ lvs $vg/$lv1 2>/dev/null || break;
+ sleep .2
+done
# "onactivate merge" test
# -- deactivate/remove after disallowed merge attempt, tests
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6ca81a091c5a79be…
Commit: 6ca81a091c5a79bee0ec46c21aea643907ab2ca7
Parent: 081308af30b32b86b690c727125f0615e5a7a7fb
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jul 22 15:57:18 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jul 22 15:57:18 2013 +0200
tests: comment about pvscan --cache return value
---
test/shell/lvmetad-pvscan-filter.sh | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvmetad-pvscan-filter.sh b/test/shell/lvmetad-pvscan-filter.sh
index 5dd66c4..5aed532 100644
--- a/test/shell/lvmetad-pvscan-filter.sh
+++ b/test/shell/lvmetad-pvscan-filter.sh
@@ -20,7 +20,12 @@ min=$(($(stat --printf=0x%T "$dev2")))
aux hide_dev $dev2
not pvscan --cache $dev2 2>&1 | grep "not found"
-# pvscan with --major/--minor does not fail (for udev's sake?)
+# pvscan with --major/--minor does not fail: lvmetad needs to
+# be notified about device removal on REMOVE uevent, hence
+# this should not fail so udev does not grab a "failed" state
+# incorrectly. We notify device addition and removal with
+# exactly the same command "pvscan --cache" - in case of removal,
+# this is detected by nonexistence of the device itself.
pvscan --cache --major $maj --minor $min 2>&1 | grep "not found"
aux unhide_dev $dev2