master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f5a3b05c7ac847...
Commit: f5a3b05c7ac8474cd323558399d2886f8edb5731
Parent: f868624f85059d935ec32a90f89a7d8266d7a6ca
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Sep 5 23:46:22 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Sep 5 23:46:22 2015 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
man/Makefile.in | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index 2a11501..af427ed 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.130(2)-git (2015-08-26)
+2.02.130(2)-git (2015-09-05)
diff --git a/VERSION_DM b/VERSION_DM
index 3f3ab57..60f6f69 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.107-git (2015-08-26)
+1.02.107-git (2015-09-05)
diff --git a/WHATS_NEW b/WHATS_NEW
index 9ff1ce2..e74fd55 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.130 -
-===================================
+Version 2.02.130 - 5th September 2015
+=====================================
Fix use of uninitialized device status if reading outdated .cache record.
Restore support for --monitor option in lvcreate (2.02.112).
Read thin-pool data and metadata percent without flush.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index a8db0ac..b509d68 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.107 -
-===================================
+Version 1.02.107 - 5th September 2015
+=====================================
Parse thin-pool status with one single routine internally.
Add --histogram to select default histogram fields for list and report.
Add report fields for displaying latency histogram configuration and data.
diff --git a/man/Makefile.in b/man/Makefile.in
index 995438f..6ddbaa9 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -21,7 +21,7 @@ BLKDEACTIVATEMAN = blkdeactivate.8
DMEVENTDMAN = dmeventd.8
LVMETADMAN = lvmetad.8
LVMPOLLDMAN = lvmpolld.8
-LVMLOCKDMAN = lvmlockd.8
+LVMLOCKDMAN = lvmlockd.8 lvmlockctl.8
CLVMDMAN = clvmd.8
CMIRRORDMAN = cmirrord.8
LVMCACHEMAN = lvmcache.7
8 years, 9 months
master - WHATS_NEW_DM: fix histogram entries for 1.02.107
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f868624f85059d...
Commit: f868624f85059d935ec32a90f89a7d8266d7a6ca
Parent: 10ccbc5efaecdc93f40a07a61dad3f2cf8eff73f
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Sep 4 19:53:10 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Sep 4 19:53:10 2015 +0100
WHATS_NEW_DM: fix histogram entries for 1.02.107
The histogram entries were under the wrong version (1.02.106). Fix
that and describe the library changes in more detail.
---
WHATS_NEW_DM | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index c40a023..a8db0ac 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,15 +1,20 @@
Version 1.02.107 -
===================================
Parse thin-pool status with one single routine internally.
+ Add --histogram to select default histogram fields for list and report.
+ Add report fields for displaying latency histogram configuration and data.
+ Add dmstats --bounds to specify histogram boundaries for a new region.
+ Add dm_histogram_to_string() to format histogram data in string form.
+ Add public methods to libdm to access numerical histogram config and data.
+ Parse and store histogram data in dm_stats_list() and dm_stats_populate().
+ Add an argument to specify histogram bounds to dm_stats_create_region().
+ Add dm_histogram_bounds_from_{string,uint64_t}() to parse histogram bounds.
+ Add dm_histogram handle type to represent a latency histogram and its bounds.
Fix devmapper.pc pkgconfig file to not reference non-existent rt.pc file.
Reinstate dm_task_get_info@Base to libdevmapper exports. (1.02.106)
Version 1.02.106 - 26th August 2015
===================================
- Add basic report fields for displaying latency histogram data.
- Add dmstats --histogram to specify histogram boundaries for a region.
- Add public methods to libdm-stats to access numerical histogram data.
- Add the ability to parse histogram data into numeric form to libdm-stats.
Add 'precise' column to statistics reports.
Add --precise switch to 'dmstats create' to request nanosecond counters.
Add precise argument to dm_stats_create_region().
8 years, 9 months
master - lvmlockd: don't stop lockspace for EREMOVED
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=10ccbc5efaecdc...
Commit: 10ccbc5efaecdc93f40a07a61dad3f2cf8eff73f
Parent: 43d6b5b375e97fa96c9fe498a19fe6df05dc1fb2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 4 13:41:38 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 4 13:41:38 2015 -0500
lvmlockd: don't stop lockspace for EREMOVED
Undo the part of the recent EREMOVED change which
automatically stopped the lockspace for a remotely
removed VG. It didn't always work (would not work
when lvb content was rebuilt in the dlm). This will
be handled better when the lvb content is controlled
more strictly.
---
daemons/lvmlockd/lvmlockd-core.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index ae6f5a1..af1a3a9 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -1763,7 +1763,7 @@ static void res_process(struct lockspace *ls, struct resource *r,
list_del(&act->list);
add_client_result(act);
}
- if (rv == -EUNATCH || rv == -EREMOVED)
+ if (rv == -EUNATCH)
goto r_free;
}
}
@@ -1796,7 +1796,7 @@ static void res_process(struct lockspace *ls, struct resource *r,
list_del(&act->list);
add_client_result(act);
}
- if (rv == -EUNATCH || rv == -EREMOVED)
+ if (rv == -EUNATCH)
goto r_free;
break;
}
@@ -1817,9 +1817,6 @@ r_free:
lm_rem_resource(ls, r);
list_del(&r->list);
free_resource(r);
-
- if (rv == -EREMOVED)
- ls->thread_stop = 1;
}
#define LOCKS_EXIST_ANY 1
8 years, 9 months
master - man lvmlockd: add section about first sanlock VG
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=43d6b5b375e97f...
Commit: 43d6b5b375e97fa96c9fe498a19fe6df05dc1fb2
Parent: 869c0bdeb89b7f78bb5152ca1278cfb0cc5d9fd5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 4 13:01:03 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 4 13:01:03 2015 -0500
man lvmlockd: add section about first sanlock VG
Add a section specifically about creating the first
sanlock VG.
---
man/lvmlockd.8.in | 45 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/man/lvmlockd.8.in b/man/lvmlockd.8.in
index 02fa338..7df0feb 100644
--- a/man/lvmlockd.8.in
+++ b/man/lvmlockd.8.in
@@ -298,6 +298,32 @@ LVM commands request locks from clvmd to use the VG.
.P
+.SS creating the first sanlock VG
+
+Creating the first sanlock VG is not protected by locking and requires
+special attention. This is because sanlock locks exist within the VG, so
+they are not available until the VG exists. The first sanlock VG will
+contain the "global lock".
+
+.IP \[bu] 2
+While running vgcreate for the first sanlock VG, ensure that the PV being
+used is not used by another LVM command. Allocation of shared PVs is
+usually protected by the global lock, but this cannot be done for the
+first sanlock VG which will hold the global lock.
+
+.IP \[bu] 2
+While running vgcreate for the first sanlock VG, ensure that the VG name
+being used is not used by another LVM command. Uniqueness of VG names is
+usually ensured by the global lock.
+
+.IP \[bu] 2
+Because the first sanlock VG will contain the global lock, this VG needs
+to be accessible to all hosts that will use sanlock shared VGs. All hosts
+will need to use the global lock from the first sanlock VG.
+
+See below for other special cases related to moving the global lock.
+
+
.SS using lockd VGs
There are some special considerations when using lockd VGs.
@@ -479,9 +505,7 @@ global/lvmlockd_lock_retries before failing. If a request for an LV lock
fails due to a lock conflict, the command fails immediately.
-.SS sanlock global lock
-
-There are some special cases related to the global lock in sanlock VGs.
+.SS managing the global lock in sanlock VGs
The global lock exists in one of the sanlock VGs. The first sanlock VG
created will contain the global lock. Subsequent sanlock VGs will each
@@ -526,14 +550,7 @@ A small sanlock VG dedicated to holding the global lock can avoid the case
where the GL lock must be manually enabled after a vgremove.
-.SS sanlock VG usage
-
-There are some special cases related to using a sanlock VG.
-
-vgremove of a sanlock VG will fail if other hosts have the VG started.
-Run vgchange \-\-lock-stop <vgname> on all other hosts before vgremove.
-(It may take several seconds before vgremove recognizes that all hosts
-have stopped.)
+.SS internal lvmlock LV
A sanlock VG contains a hidden LV called "lvmlock" that holds the sanlock
locks. vgreduce cannot yet remove the PV holding the lvmlock LV. To
@@ -543,6 +560,12 @@ change the VG lock type back to "sanlock".
To place the lvmlock LV on a specific device, create the VG with only that
device, then use vgextend to add other devices.
+vgremove of a sanlock VG will fail if other hosts have the VG started.
+Run vgchange \-\-lock-stop <vgname> on all other hosts before vgremove.
+(It may take several seconds before vgremove recognizes that all hosts
+have stopped.) This is necessary because while a host has a sanlock VG
+started, it is using the internal lvmlock LV.
+
.SS shared LVs
8 years, 9 months
master - man lvmlockctl: add man page
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=869c0bdeb89b7f...
Commit: 869c0bdeb89b7f78bb5152ca1278cfb0cc5d9fd5
Parent: c71af0895d4ea3c37bcb06f36eed69a7adcb5296
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 4 11:02:48 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 4 11:05:13 2015 -0500
man lvmlockctl: add man page
---
man/lvmlockctl.8.in | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 102 insertions(+), 0 deletions(-)
diff --git a/man/lvmlockctl.8.in b/man/lvmlockctl.8.in
new file mode 100644
index 0000000..5465642
--- /dev/null
+++ b/man/lvmlockctl.8.in
@@ -0,0 +1,102 @@
+.TH "LVMLOCKCTL" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
+
+.SH NAME
+lvmlockctl \(em Control for lvmlockd
+
+.SH DESCRIPTION
+This command interacts with
+.BR lvmlockd (8).
+
+.SH OPTIONS
+
+lvmlockctl [options]
+
+.B \-\-help | \-h
+ Show this help information.
+
+.B \-\-quit | \-q
+ Tell lvmlockd to quit.
+
+.B \-\-info | \-i
+ Print lock state information from lvmlockd.
+
+.B \-\-dump | \-d
+ Print log buffer from lvmlockd.
+
+.B \-\-wait | \-w 0|1
+ Wait option for other commands.
+
+.B \-\-force | \-f 0|1
+ Force option for other commands.
+
+.B \-\-kill | \-k
+.I vgname
+ Kill access to the VG when sanlock cannot renew lease.
+
+.B \-\-drop | \-r
+.I vgname
+ Clear locks for the VG when it is unused after kill (-k).
+
+.B \-\-gl\-enable | \-E
+.I vgname
+ Tell lvmlockd to enable the global lock in a sanlock VG.
+
+.B \-\-gl\-disable | \-D
+.I vgname
+ Tell lvmlockd to disable the global lock in a sanlock VG.
+
+.B \-\-stop\-lockspaces | \-S
+ Stop all lockspaces.
+
+
+.SH USAGE
+
+.SS info
+
+This collects and displays lock state from lvmlockd. The display is
+primitive, incomplete and will change in future version. To print the raw
+lock state from lvmlockd, combine this option with --dump|-d.
+
+.SS dump
+
+This collects the circular log buffer of debug statements from lvmlockd
+and prints it.
+
+.SS kill
+
+This is run by sanlock when it loses access to the storage holding leases
+for a VG. It currently emits a syslog message stating that the VG must
+be immediately deactivated. In the future it may automatically attempt to
+forcibly deactivate the VG. For more, see
+.BR lvmlockd (8).
+
+.SS drop
+
+This should only be run after a VG has been successfully deactivated
+following an lvmlockctl \-\-kill command. It clears the stale lockspace
+from lvmlockd. In the future, this may become automatic along with an
+automatic handling of \-\-kill. For more, see
+.BR lvmlockd (8).
+
+.SS gl\-enable
+
+This enables the global lock in a sanlock VG. This is necessary if the VG
+that previously held the global lock is removed. For more, see
+.BR lvmlockd (8).
+
+.SS gl\-disable
+
+This disables the global lock in a sanlock VG. This is necessary if the
+global lock has mistakenly been enabled in more than one VG. The global
+lock should be disabled in all but one sanlock VG. For more, see
+.BR lvmlockd (8).
+
+.SS stop\-lockspaces
+
+This tells lvmlockd to stop all lockspaces. It can be useful to stop
+lockspaces for VGs that the vgchange \-\-lock\-stop comand can no longer
+see, or to stop the dlm global lockspace which is not directly stopped by
+the vgchange command. The wait and force options can be used with this
+command.
+
+
8 years, 9 months
master - lvmlockctl: update command descriptions and add logging
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c71af0895d4ea3...
Commit: c71af0895d4ea3c37bcb06f36eed69a7adcb5296
Parent: b00ee99a21f3a6f502fc5d165b979af128e3b8b2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 4 11:01:25 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 4 11:05:13 2015 -0500
lvmlockctl: update command descriptions and add logging
The one line descriptions will match the man page.
Add a syslog entry when enabling/disabling the global lock
to help debugging.
---
daemons/lvmlockd/lvmlockctl.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockctl.c b/daemons/lvmlockd/lvmlockctl.c
index 14be4fc..d0d680a 100644
--- a/daemons/lvmlockd/lvmlockctl.c
+++ b/daemons/lvmlockd/lvmlockctl.c
@@ -599,14 +599,14 @@ static void print_usage(void)
printf(" Wait option for other commands.\n");
printf("--force | -f 0|1>\n");
printf(" Force option for other commands.\n");
- printf("--kill | -k <vg_name>\n");
- printf(" Kill access to the vg when sanlock cannot renew lease.\n");
- printf("--drop | -r <vg_name>\n");
- printf(" Clear locks for the vg after it has been killed and is no longer used.\n");
- printf("--gl-enable <vg_name>\n");
- printf(" Tell lvmlockd to enable the global lock in a sanlock vg.\n");
- printf("--gl-disable <vg_name>\n");
- printf(" Tell lvmlockd to disable the global lock in a sanlock vg.\n");
+ printf("--kill | -k <vgname>\n");
+ printf(" Kill access to the VG when sanlock cannot renew lease.\n");
+ printf("--drop | -r <vgname>\n");
+ printf(" Clear locks for the VG when it is unused after kill (-k).\n");
+ printf("--gl-enable | -E <vgname>\n");
+ printf(" Tell lvmlockd to enable the global lock in a sanlock VG.\n");
+ printf("--gl-disable | -D <vgname>\n");
+ printf(" Tell lvmlockd to disable the global lock in a sanlock VG.\n");
printf("--stop-lockspaces | -S\n");
printf(" Stop all lockspaces.\n");
}
@@ -731,11 +731,13 @@ int main(int argc, char **argv)
}
if (gl_enable) {
+ syslog(LOG_INFO, "Enabling global lock in VG %s.", arg_vg_name);
rv = do_able("enable_gl");
goto out;
}
if (gl_disable) {
+ syslog(LOG_INFO, "Disabling global lock in VG %s.", arg_vg_name);
rv = do_able("disable_gl");
goto out;
}
8 years, 9 months
master - man lvmlockd: explain the use of lvmlockctl kill
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b00ee99a21f3a6...
Commit: b00ee99a21f3a6f502fc5d165b979af128e3b8b2
Parent: 55c13f3de4a8b709b950297369182cd81a6c738f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 4 10:29:01 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 4 11:05:13 2015 -0500
man lvmlockd: explain the use of lvmlockctl kill
---
man/lvmlockd.8.in | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/man/lvmlockd.8.in b/man/lvmlockd.8.in
index 4e7883a..02fa338 100644
--- a/man/lvmlockd.8.in
+++ b/man/lvmlockd.8.in
@@ -536,7 +536,7 @@ Run vgchange \-\-lock-stop <vgname> on all other hosts before vgremove.
have stopped.)
A sanlock VG contains a hidden LV called "lvmlock" that holds the sanlock
-locks. vgreduce cannot yet remove the PV holding the lvmlockd LV. To
+locks. vgreduce cannot yet remove the PV holding the lvmlock LV. To
remove this PV, change the VG lock type to "none", run vgreduce, then
change the VG lock type back to "sanlock".
@@ -590,13 +590,20 @@ the dlm/corosync recovery process is complete.
.B sanlock lease storage failure
-If a host loses access to the device holding a VG's locks, sanlock cannot
-renew its lease for the VG's locks. After some time, the lease will
-expire, and locks held by the host can be acquired by other hosts.
+If the PV under a sanlock VG's lvmlock LV is disconnected, unresponsive or
+too slow, sanlock cannot renew the lease for the VG's locks. After some
+time, the lease will expire, and locks that the host owns in the VG can be
+acquired by other hosts. The VG must be forcibly deactivated on the host
+with the expiring lease before other hosts can acquire its locks.
-If no LVs are active in the VG, the lockspace with an expiring lease will
-be shut down, and errors will be reported when trying to use the VG. Use
-the lvmlockctl \-\-drop command to clear the stale lockspace from
+When the sanlock daemon detects that the lease storage is lost, it runs
+the command lvmlockctl \-\-kill <vgname>. This command emits a syslog
+message stating that lease storage is lost for the VG and LVs must be
+immediately deactivated.
+
+If no LVs are active in the VG, then the lockspace with an expiring lease
+will be removed, and errors will be reported when trying to use the VG.
+Use the lvmlockctl \-\-drop command to clear the stale lockspace from
lvmlockd.
If the VG has active LVs when the lock storage is lost, the LVs must be
@@ -607,9 +614,12 @@ about 40 seconds, sanlock will reset the host using the local watchdog.
The machine reset is effectively a severe form of "deactivating" LVs
before they can be activated on other hosts. The reset is considered a
better alternative than having LVs used by multiple hosts at once, which
-could easily damage or destroy their content. A future enhancement may
-automatically attempt to forcibly deactivate LVs before the lockspace
-lease expires.
+could easily damage or destroy their content.
+
+In the future, the lvmlockctl kill command may automatically attempt to
+forcibly deactivate LVs before the sanlock lease expires. Until then, the
+user must notice the syslog message and manually deactivate the VG before
+sanlock resets the machine.
.B sanlock daemon failure
8 years, 9 months
master - dev-cache: fix use of uninitialized device status if reading outdated .cache record
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=55c13f3de4a8b7...
Commit: 55c13f3de4a8b709b950297369182cd81a6c738f
Parent: 96948540825d8b3f8e89cbf22527a2d3d8435667
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Sep 4 18:00:29 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Sep 4 18:00:29 2015 +0200
dev-cache: fix use of uninitialized device status if reading outdated .cache record
As part of fix that came with cf700151eba483aeedbf790fd66ce1c44e19c707,
I forgot to add the check whether the result of stat was successful or
not. This bug caused uninitialized buffer to be used for entries
from .cache file which are no longer valid.
This bug may have caused these uninitialized values to be used further,
for example (see the unreal (2567,590944) representing major:minor
pair):
$ pvs
/dev/abc: stat failed: No such file or directory
Path /dev/abc no longer valid for device(2567,590944)
PV VG Fmt Attr PSize PFree
/dev/mapper/test lvm2 --- 104.00m 104.00m
/dev/vda2 rhel lvm2 a-- 9.51g 0
---
WHATS_NEW | 1 +
lib/device/dev-cache.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 887fafd..9ff1ce2 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.130 -
===================================
+ Fix use of uninitialized device status if reading outdated .cache record.
Restore support for --monitor option in lvcreate (2.02.112).
Read thin-pool data and metadata percent without flush.
Detect blocked thin-pool and avoid scanning their thin volumes.
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 4ed0130..b9d4271 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -948,6 +948,7 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f)
{
struct stat buf;
struct device *d = (struct device *) dm_hash_lookup(_cache.names, name);
+ int info_available = 0;
if (d && (d->flags & DEV_REGULAR))
return d;
@@ -958,7 +959,8 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f)
dm_hash_remove(_cache.names, name);
log_sys_very_verbose("stat", name);
d = NULL;
- }
+ } else
+ info_available = 1;
if (d && (buf.st_rdev != d->dev)) {
dm_hash_remove(_cache.names, name);
@@ -966,7 +968,7 @@ struct device *dev_cache_get(const char *name, struct dev_filter *f)
}
if (!d) {
- _insert(name, &buf, 0, obtain_device_list_from_udev());
+ _insert(name, info_available ? &buf : NULL, 0, obtain_device_list_from_udev());
d = (struct device *) dm_hash_lookup(_cache.names, name);
if (!d) {
_full_scan(0);
8 years, 9 months
master - vgchange: improve error message about changing lock type
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=96948540825d8b...
Commit: 96948540825d8b3f8e89cbf22527a2d3d8435667
Parent: cdca2782d2b43c20d552d64359ac0ce80d24af5f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 4 09:53:33 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 4 09:53:33 2015 -0500
vgchange: improve error message about changing lock type
---
tools/vgchange.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 6d86051..1d3c64a 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -574,8 +574,10 @@ static int _vgchange_locktype(struct cmd_context *cmd,
}
if (is_lockd_type(vg->lock_type) && is_lockd_type(lock_type)) {
- log_error("First change from lock type %s to none, then to lock type %s",
+ log_error("Cannot change lock type directly from \"%s\" to \"%s\".",
vg->lock_type, lock_type);
+ log_error("First change lock type to \"none\", then to \"%s\".",
+ lock_type);
return 0;
}
8 years, 9 months
master - libdm: fix uninitialized variable warnings on older gcc
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cdca2782d2b43c...
Commit: cdca2782d2b43c20d552d64359ac0ce80d24af5f
Parent: cebbb0feafb97516377388eb1747e3207c4f0596
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Sep 4 11:40:19 2015 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Sep 4 11:46:48 2015 +0100
libdm: fix uninitialized variable warnings on older gcc
Older versions of gcc aren't able to track the assignments of
local variables as well as the latest versions leading to spurious
warnings like:
libdm-stats.c:2183: warning: "len" may be used uninitialized in this
function
libdm-stats.c:2177: warning: "minwidth" may be used uninitialized in
this function
Both of these variables are in fact assigned in all possible paths
through the function and later compilers do not produce these
warnings.
There's no reason to not initialize these variables though and
it makes the function slightly easier to follow.
Also fix one use of 'unsigned' for a nr_bins value.
---
libdm/libdm-stats.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 90f2e1d..736aae5 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -419,7 +419,7 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms,
struct dm_pool *mem = dms->hist_mem;
struct dm_histogram_bin cur;
struct dm_histogram hist;
- unsigned nr_bins = 1;
+ int nr_bins = 1;
const char *c, *v;
char *p;
@@ -2180,7 +2180,7 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin,
struct dm_pool *mem = dmh->dms->hist_mem;
char buf[64], bounds_buf[64];
const char *sep = "";
- ssize_t len;
+ ssize_t len = 0;
bounds = flags & DM_HISTOGRAM_BOUNDS_MASK;
values = flags & DM_HISTOGRAM_VALUES;
@@ -2191,6 +2191,8 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin,
} else
start = last = bin;
+ minwidth = width;
+
if (width < 0 || !values)
width = minwidth = 0; /* no padding */
else if (flags & DM_HISTOGRAM_PERCENT)
8 years, 9 months