1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

11567 Commits

Author SHA1 Message Date
Bryn M. Reeves
a26523330e dmsetup: fix bounds leak in _do_stats_create_regions()
If we fail to create the DM_DEVICE_TABLE dm_task destroy the bounds
object before returning.
2015-09-07 11:14:28 +01:00
Alasdair G Kergon
2a022e9e6e post-release 2015-09-05 23:58:40 +01:00
Alasdair G Kergon
fb12308416 style: Standardise some error paths. 2015-09-05 23:56:30 +01:00
Alasdair G Kergon
f5a3b05c7a pre-release 2015-09-05 23:46:22 +01:00
Bryn M. Reeves
f868624f85 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.
2015-09-04 19:53:10 +01:00
David Teigland
10ccbc5efa 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.
2015-09-04 13:41:38 -05:00
David Teigland
43d6b5b375 man lvmlockd: add section about first sanlock VG
Add a section specifically about creating the first
sanlock VG.
2015-09-04 13:01:03 -05:00
David Teigland
869c0bdeb8 man lvmlockctl: add man page 2015-09-04 11:05:13 -05:00
David Teigland
c71af0895d 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.
2015-09-04 11:05:13 -05:00
David Teigland
b00ee99a21 man lvmlockd: explain the use of lvmlockctl kill 2015-09-04 11:05:13 -05:00
Peter Rajnoha
55c13f3de4 dev-cache: fix use of uninitialized device status if reading outdated .cache record
As part of fix that came with cf700151eb,
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
2015-09-04 18:00:29 +02:00
David Teigland
9694854082 vgchange: improve error message about changing lock type 2015-09-04 09:53:33 -05:00
Bryn M. Reeves
cdca2782d2 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.
2015-09-04 11:46:48 +01:00
Bryn M. Reeves
cebbb0feaf dmstats: replace histogram command with switch
Replace the histogram stats subcommand with a --histogram switch
to enable histogram related fields for both list and report output.

To avoid overloading the existing --histogram rename it to --bounds:
this is also a better description of the option.
2015-09-03 23:39:11 +01:00
David Teigland
6240a7639d lvmlockd: fixes for starting dlm global lockspace
Remove the optimization/shortcut for starting the dlm global
lockspace when it was already running.

Reenable automatically starting the dlm global lockspace
when a command attempts to use it and it's not yet started.
This had become disabled at some point.
2015-09-03 16:47:54 -05:00
David Teigland
9e8b3d4a98 lockd: check for unlock failure in all cases
This suppresses an unwanted error message.
2015-09-03 16:47:54 -05:00
David Teigland
c27015368b lvmlockd: improve log messages for adding dlm global lockspace 2015-09-03 16:47:54 -05:00
Zdenek Kabelac
5da497d0a8 tests: update thin test
Use slightly better values
2015-09-03 23:34:37 +02:00
Zdenek Kabelac
dc261f17e9 tests: use conv=fdatasync
Should be slightly better to flushed before dd exits
instead of using direct IO.
2015-09-03 23:34:37 +02:00
Zdenek Kabelac
ee8200f1c6 cleanup: use just 2 decimal digits 2015-09-03 23:34:37 +02:00
Zdenek Kabelac
0a389691dc cleanup: avoid printing -0.00
Nice trick to not print -0.00 for some percent values.
2015-09-03 23:34:37 +02:00
Zdenek Kabelac
32d6ca9196 cleanup: show error message
Add error message on error path.
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
20e317cf92 lvcreate: restore missed --monitor
Fix regression from d13239b054.
This patch reorganized whole command option parsing, however
it has lost support to accept --monitor arg.
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
2b9843c20b dmeventd: reorder mempool allocation
Since lvm2_init() effectively detects memory leaks
allocate mempool after this initialization
(so it's not reported as leak).
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
872ea3b987 thin: do not flush when quering for thin percent
Since we may easily get blocked when checking for percentage
of thin-pool - do not flush and just show current values.
This avoids holding VG locked when pool is overfilled.
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
df110bccbe thin: validate mapped size of thin volume
Never show we map more then 100% for a volume.
But show warning when there could be some consistency problems.
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
a01eb9c451 thin: detect unusable thins
Try to detect thin-pool which my block lvm2 command from furher
processing (i.e. lvextend).

Check if pool is read-only or out-of-space and in this case thins
will skipped from being scanned (so user may miss some PVs located
on thin volumes).
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
81a9da8f61 filters: swap device_is_usable test
Fix regression introduced with commit:
2fc126b00d

This commit has moved  pv_min_size() test in front
of device_is_usable(). However pv_min_size needs to open device,
so it may have actually get blocked.

So restore the original order and first validate
dm device to be usable for open.

It's worth to note that such check is not 'race-free',
but it usually eliminates 99.99% of problems ;).
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
a3c7e326c3 libdm: relocate parsing of thin-pool status
Use single routine for parsing status.

Internally we do not need to allocate pool memory for
passed struct.
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
5ce334923f configure: better parsing of cache_check version
Properly read also version string like  0.5.5-1.fc24
and read just first 3 digits split by '.'

Also remove one extra  $HAVE_REALTIME.
2015-09-03 23:34:36 +02:00
Bryn M. Reeves
49b5022993 dmstats: support --noheadings for histogram fields 2015-09-03 22:04:11 +01:00
Bryn M. Reeves
84d88cb2cf dmstats: add --notimesuffix switch
Add a switch to disable the printing of time unit suffixes in
histogram bounds descriptions.
2015-09-03 22:04:10 +01:00
Bryn M. Reeves
f09e4f7b10 libdm: allow formatting histogram strings with no whitespace
Allow dm_histogram_to_string() to format histogram strings with
no whitespace by passing a width value less than zero.
2015-09-03 22:04:10 +01:00
David Teigland
0a73a5012a vgrename: add missing trace on error path 2015-09-03 10:38:16 -05:00
David Teigland
96dc03b337 lockd: vgrename fixes
If busy locks in lvmlockd prevent vgrename, use the
correct error exit path, and print a user-friendly
error message.
2015-09-03 10:21:44 -05:00
Peter Rajnoha
d1d00fdeec dev-cache: append (major:minor) to debug messages about adding device or its alias to cache
device/dev-cache.c:350         /dev/sda: Added to device cache (8:0)
device/dev-cache.c:346         /dev/disk/by-id/lvm-pv-uuid-5nPovF-EWp4-vBwd-ylCJ-9Y0B-yzHQ-ek1li2: Aliased to /dev/sda in device cache (8:0)
...
2015-09-03 14:36:15 +02:00
Peter Rajnoha
00b610e542 filters: do not print [none:nil] as external device info's [source:handler] if "none" source is used
Print [source:handler] in filters' debug messages only if external
device info source other than "none" is used.

$ lvmconfig --type full devices/external_device_info_source
external_device_info_source="none

Before this patch (from the -vvvv log):

filters/filter-usable.c:47         /dev/mapper/test: Skipping: Too small to hold a PV [none:(nil)]
filters/filter-md.c:33         /dev/sdb: Skipping md component device [none:(nil)]
filters/filter-partitioned.c:25         /dev/vda: Skipping: Partition table signature found [none:(nil)]

With this patch applied:

filters/filter-usable.c:44         /dev/mapper/test: Skipping: Too small to hold a PV
filters/filter-md.c:35         /dev/sdb: Skipping md component device
filters/filter-partitioned.c:27         /dev/vda: Skipping: Partition table signature found
2015-09-03 14:19:48 +02:00
Peter Rajnoha
fc35b6988d libdm: pkgconfig: fix devmapper.pc to not reference nonexistent rt.pc file
librt doesn't have a pkgconfig file so use Libs.private: -lrt instead
to declare the dependency directly.

The same applies for -lm which is also used and which hasn't been
defined in the devmapper.pc file yet.
2015-09-03 09:28:42 +02:00
Bryn M. Reeves
b86bd3b074 man: fix typo in dmstats.8.in 2015-09-02 23:01:46 +01:00
Bryn M. Reeves
3414601788 man: document --regionid in dmstats.8.in 2015-09-02 21:03:03 +01:00
Bryn M. Reeves
d31c4e0bc1 man: update dmstats.8.in examples
Make sure that correct 'dmstats create' messages are shown for all
examples and fix LV examples to use correct dmsetup output name
format (vg/lv -> vg-lv).
2015-09-02 21:03:03 +01:00
Bryn M. Reeves
031cd2bb0d dmstats: improve stats column names
Improve the names and labels of stats reports columns, ensure that
the minimum field widths allow unambiguos labels to be shown and
update the man page descriptions of these fields.
2015-09-02 21:03:03 +01:00
Bryn M. Reeves
3c0fc6f0da dmstats: add histogram support
Add support to dmstats to create and report histograms.

Add a --histogram switch to 'create' that accepts a string
description of bin boundaries and DR_STATS and DR_STATS_META fields
to report bin configuration and absolute and relative histogram
values:

  hist_bins
  hist_bounds
  hist_ranges
  hist_count
  hist_count_bounds
  hist_count_ranges
  hist_percent
  hist_percent_bounds
  hist_percent_ranges

A new 'histogram' subcommand displays a report that emphasizes
histogram data as either counters or percentage values.
2015-09-02 21:02:12 +01:00
Bryn M. Reeves
a0cf3d47f1 libdm: add latency histogram support
Add support for creating, parsing, and reporting dm-stats latency
histograms on kernels that support precise_timestamps.

Histograms are specified as a series of time values that give the
boundaries of the bins into which I/O counts accumulate (with
implicit lower and upper bounds on the first and last bins).

A new type, struct dm_histogram, is introduced to represent
histogram values and bin boundaries.

The boundary values may be given as either a string of values (with
optional unit suffixes) or as a zero terminated array of uint64_t
values expressing boundary times in nanoseconds.

A new bounds argument is added to dm_stats_create_region() which
accepts a pointer to a struct dm_histogram initialised with bounds
values.

Histogram data associated with a region is parsed during a call to
dm_stats_populate() and used to build a table of histogram values
that are pointed to from the containing area's counter set. The
histogram for a specified area may then be obtained and interogated
for values and properties.

This relies on kernel support to provide the boundary values in
a @stats_list response: this will be present in 4.3 and 4.2-stable. A
check for a minimum driver version of 4.33.0 is implemented to ensure
that this is present (4.32.0 has the necessary precise_timestamps and
histogram features but is unable to report these via @stats_list).

Access methods are provided to retrieve histogram values and bounds
as well as simple string representations of the counts and bin
boundaries.  Methods are also available to return the total count
for a histogram and the relative value (as a dm_percent_t) of a
specified bin.
2015-09-02 20:48:59 +01:00
Bryn M. Reeves
c4f3732c91 libdm: reset report field widths in _destroy_rows()
For repeating reports field widths should be re-calculated for
each report interval. Not doing so will cause a single row with
wide field data to cause all subsequent rows to share the width:

Name                                      RgID ArID R/s     W/s    Histogram                                     Bounds
vg_hex-lv_home                               0    0 4522.00 834.00 0s:   991, 2ms:   152, 4ms:   161, 6ms:  4052 0s, 2ms, 4ms, 6ms
vg_hex-lv_swap                               0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_root                               0    0 1754.00 683.00 0s:  369, 2ms:   65, 4ms:   90, 6ms: 1913     0s, 2ms, 4ms, 6ms
luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e    0    0 4522.00 868.00 0s:   985, 2ms:   152, 4ms:   161, 6ms:  4092 0s, 2ms, 4ms, 6ms
vg_hex-lv_images                             0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms

Name                                      RgID ArID R/s     W/s    Histogram                                     Bounds
vg_hex-lv_home                               0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_swap                               0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_root                               0    0    0.00   2.00 0s: 1, 2ms: 0, 4ms: 0, 6ms: 1                 0s, 2ms, 4ms, 6ms
luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e    0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_images                             0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
                                                                                                ^^^^^^^^^^^^^^^^^
This is especially significant for the current histogram fields:
depending on the time since the last clear operation the first
report iteration may contain very large values leading to a very
large minimum field width. Without resetting field widths this
large minimum field width value is used for all subsequent rows.
2015-09-02 20:48:59 +01:00
Ondrej Kozina
a9d954cb3c pvmove: skip polling later in test mode 2015-09-02 17:25:37 +02:00
Ondrej Kozina
6e4f2da9b3 lvconvert: skip polling in test mode 2015-09-02 17:25:29 +02:00
Ondrej Kozina
ab5df4bc5c lvmpolld.8.in: add missing space 2015-09-02 17:24:34 +02:00
Ondrej Kozina
7bbc128c3d lvmpolld: make lvpoll error messages visible
Previously all stderr messages issued by spawned lvpoll command were reported
as INFO only. This made all such messages invisible in syslog or lvmpolld log
while running default configuration.

All lvpoll stderr messages are loged with WARN priority now and lvpoll
command exiting with retcode != 0 is logged with ERROR priority in
syslog and lvmpolld log
2015-09-02 17:24:26 +02:00
Alasdair G Kergon
cb57f4f89b libdm: Reinstate dm_task_get_info@Base.
Move the version script local:* wildcard into a node of its own
to avoid conflicting with in-source export macro definitions.
2015-09-01 16:26:02 +01:00