Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=521a0a3323507e1d…
Commit: 521a0a3323507e1d07568d3047283975e66ca193
Parent: cbfb5a98b5dbe699aaafbced00120f60aaa35231
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 12 12:37:24 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 12 13:01:57 2013 +0100
dmsetup: fix 'splitname -o' to not fail if used without '-c'
This was a regression introduced with e33fd978a8a56228677c14612fce99b3b3588125
(libdm v1.02.68/lvm2 v2.02.89) with the introduction of new output
fields blkdevname and blkdevs_used for ls and deps dmsetup commands.
A new common '_process_options' fn was added with that commit, but the
fn was called prematurely which then broke processing of
'dmsetup splitname -o' which should implicitly use '-c' option
and this was failing after the commit:
alatyr/~ $ dmsetup splitname -o lv_name /dev/mapper/vg_data-test
Option not recognised: lv_name
Couldn't process command line.
The '-c' had to be used for correct operation:
alatyr/~ $ dmsetup splitname -c -o lv_name /dev/mapper/vg_data-test
LV
test
Now fixed to work as it did before:
alatyr/~ $ dmsetup splitname -o lv_name /dev/mapper/vg_data-test
LV
test
---
WHATS_NEW_DM | 1 +
tools/dmsetup.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 3bf8927..98ffa6f 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.78 -
===================================
+ Fix 'dmsetup splitname -o' to not fail if used without '-c' switch (1.02.68).
Add dm_config_write_{node_out/one_node_out} for enhanced config output.
Add dm_config_value_is_bool to check for boolean value in supported formats.
Fix config node lookup inside empty sections to not return the section itself.
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 8b1145f..ce46d6c 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3749,9 +3749,6 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
return 0;
}
- if (!_process_options(_string_args[OPTIONS_ARG]))
- return 0;
-
if (_switches[TABLE_ARG] && _switches[NOTABLE_ARG]) {
fprintf(stderr, "--table and --notable are incompatible.\n");
return 0;
@@ -3824,6 +3821,11 @@ int main(int argc, char **argv)
if (!strcmp(cmd->name, "mangle"))
dm_set_name_mangling_mode(DM_STRING_MANGLING_NONE);
+ if (!_process_options(_string_args[OPTIONS_ARG])) {
+ fprintf(stderr, "Couldn't process command line.\n");
+ goto out;
+ }
+
if (_switches[COLS_ARG]) {
if (!_report_init(cmd))
goto out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=69ae454d4d46228a…
Commit: 69ae454d4d46228a5de3b95a2ddcd8b8307fed4a
Parent: 31c24dd9f2ad7b5f7913a18c9f11a00d7b3474a1
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 6 11:12:09 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 6 11:12:09 2013 -0600
test: Fix the way in_sync calculates the sync field location
'in_sync' was using the last field in the RAID status output as
the location for the sync ratio field. The sync ratio may not always
be the last field, but it will always be the 7th field. So we switch
to using the absolute value rather than computing the last field
index number.
---
test/lib/check.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 6b7849f..48e3073 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -170,8 +170,8 @@ in_sync() {
fi
if [ ${a[2]} = "raid" ]; then
- # Last argument is the sync ratio for RAID
- idx=$((${#a[@]} - 1))
+ # 6th argument is the sync ratio for RAID
+ idx=6
type=${a[3]}
elif [ ${a[2]} = "mirror" ]; then
# 4th Arg tells us how far to the sync ratio
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=31c24dd9f2ad7b5f…
Commit: 31c24dd9f2ad7b5f7913a18c9f11a00d7b3474a1
Parent: ed6f3945fd86385c172da5d6884c01d8c0b6a51b
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 6 10:17:11 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 6 10:17:11 2013 -0600
RAID: Code changes missing from previous commit (bbc6378)
Previous commit included changes to WHATSNEW, but the code changes
were missing. Here is the description from the previous commit:
commit bbc6378b73246d7ef00c16274fea38118531ae95
Author: Jonathan Brassow <jbrassow(a)redhat.com>
Date: Thu Feb 21 11:31:36 2013 -0600
RAID: Make 'lvchange --refresh' restore transiently failed RAID PVs
A new function (dm_tree_node_force_identical_table_reload) was added to
avoid the suppression of identical table reloads. This allows RAID LVs
to reload the on-disk superblock information that contains which devices
have failed and the bitmaps. If the failed device has returned, this has
the effect of restoring the device and initiating recovery. Without this
patch, the user had to completely deactivate their RAID LV and re-activate
it in order to restore the failed device. Now they simply need to
suspend and resume (which is done by 'lvchange --refresh').
The identical table suppression is only avoided if the LV is not PARTAIL
(i.e. all of it's devices can be seen and read by LVM) and the kernel
status of the array contains failed devices. In other words, the function
will only be called in the case where we may have success in restoring
a failed device in the array.
---
lib/raid/raid.c | 15 +++++++++++++++
libdm/libdevmapper.h | 3 ++-
libdm/libdm-deptree.c | 20 +++++++++++++++++++-
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 1e28c73..69b6ee3 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -161,6 +161,7 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
uint32_t s;
uint64_t flags = 0;
uint64_t rebuilds = 0;
+ char *raid_health = NULL;
if (!seg->area_count) {
log_error(INTERNAL_ERROR "_raid_add_target_line called "
@@ -190,6 +191,20 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
if (mirror_in_sync())
flags = DM_NOSYNC;
+ /*
+ * If the RAID LV is not 'PARTIAL' and the status indicates
+ * that the array has failed devices, it means that the
+ * failed devices have returned and can be reintegrated.
+ *
+ * We reload the (potentially identical) table to force the
+ * kernel to re-read the RAID superblocks - possibly restoring
+ * transiently failed devices.
+ */
+ if (!(seg->lv->status & PARTIAL_LV) &&
+ lv_raid_dev_health(seg->lv, &raid_health) &&
+ strchr(raid_health, 'D'))
+ dm_tree_node_force_identical_table_reload(node);
+
if (!dm_tree_node_add_raid_target(node, len, _raid_name(seg),
seg->region_size, seg->stripe_size,
rebuilds, flags))
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 0460afa..184615f 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -491,13 +491,14 @@ struct dm_tree_node *dm_tree_next_child(void **handle,
uint32_t inverted);
/*
- * Get properties of a node.
+ * Get and set properties of a node.
*/
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);
int dm_tree_node_size_changed(const struct dm_tree_node *dnode);
+int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode);
/*
* Returns the number of children of the given node (excluding the root node).
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 5e938d7..e702a25 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -232,6 +232,16 @@ struct load_properties {
/* Send messages for this node in preload */
unsigned send_messages;
+
+ /*
+ * If a mapping table is replacing an existing identical table,
+ * the load is suppressed by default - avoiding the construction
+ * of an unnecessary in-kernel table. Sometimes we want to avoid
+ * this optimization and load the identical table anyway. This
+ * field is used to indicate that we desire identical tables to be
+ * loaded and not suppressed.
+ */
+ unsigned force_identical_table_reload;
};
/* Two of these used to join two nodes with uses and used_by. */
@@ -587,6 +597,13 @@ int dm_tree_node_size_changed(const struct dm_tree_node *dnode)
return dnode->props.size_changed;
}
+int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode)
+{
+ dnode->props.force_identical_table_reload = 1;
+ return 1;
+}
+
+
int dm_tree_node_num_children(const struct dm_tree_node *node, uint32_t inverted)
{
if (inverted) {
@@ -2409,7 +2426,8 @@ static int _load_node(struct dm_tree_node *dnode)
seg, &seg_start))
goto_out;
- if (!dm_task_suppress_identical_reload(dmt))
+ if (!dnode->props.force_identical_table_reload &&
+ !dm_task_suppress_identical_reload(dmt))
log_error("Failed to suppress reload of identical tables.");
if ((r = dm_task_run(dmt))) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ed6f3945fd86385c…
Commit: ed6f3945fd86385c172da5d6884c01d8c0b6a51b
Parent: 6b777ccbb5dca4a6d80b8b0bf071993c049f6a9f
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 6 08:42:03 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 6 08:42:03 2013 -0600
clean-up: Typo 's/should had/should have/'
---
lib/activate/fs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/activate/fs.c b/lib/activate/fs.c
index fe53349..7483044 100644
--- a/lib/activate/fs.c
+++ b/lib/activate/fs.c
@@ -205,7 +205,7 @@ static int _mk_link(const char *dev_dir, const char *vg_name,
return 0;
}
} else if (dm_udev_get_sync_support() && udev_checking() && check_udev)
- log_warn("The link %s should had been created by udev "
+ log_warn("The link %s should have been created by udev "
"but it was not found. Falling back to "
"direct link creation.", lv_path);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=03b5c51730431ceb…
Commit: 03b5c51730431ceb38c301293a19882b5829b84d
Parent: 7d6991e900cbd5959e73285af81079bc22eadccb
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Mar 6 10:38:40 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Mar 6 11:00:30 2013 +0100
WHATS_NEW: add lines for config validation support
---
WHATS_NEW | 5 +++++
WHATS_NEW_DM | 2 ++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3a837aa..d7dda58 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,10 @@
Version 2.02.99 -
===================================
+ Add --validate option to lvm dumpconfig to validate current config on demand.
+ Add --ignoreadvanced and --ignoreunsupported switch to lvm dumpconfig.
+ 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 ea_start,ea_size to report embedding area start and size.
Add --embeddingareasize to pvcreate and vgconvert to create an embedding area.
Add PV header extension: extension version, flags and embedding areas.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9d9c53d..3bf8927 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,7 @@
Version 1.02.78 -
===================================
+ Add dm_config_write_{node_out/one_node_out} for enhanced config output.
+ Add dm_config_value_is_bool to check for boolean value in supported formats.
Fix config node lookup inside empty sections to not return the section itself.
Extend support for status info of thin pool target.
Fix segfault for truncated string token in config file after the first '"'.