1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
Commit Graph

12520 Commits

Author SHA1 Message Date
Alasdair G Kergon
16019b518e libdm: Add dm_udev_wait_immediate.
dm_udev_wait() waits inside the library.
dm_udev_wait_immediate allows the caller to do other things if the
cookie isn't yet ready to be decremented.
2016-04-28 00:54:27 +01:00
David Teigland
a2d2a61339 pvscan: autoactivation should ignore some VGs
pvscan autoactivation has its own VG processing implementation,
so it can't properly handle things like foreign or shared VGs,
so make it ignore those VG types (or errors from them) as best
as possible.

Add a FIXME stating that pvscan autoactivation must really be
moved to the standard VG processing by calling process_each_vg
to do activation once the scanning / cache update is finished.
2016-04-27 15:45:38 -05:00
David Teigland
263c1a4db5 lvmetad: improve warning after lvmetad message fails
Make it more consistent with the other similar warning.
2016-04-27 15:38:34 -05:00
David Teigland
3c53acb378 metadata: fix segfault when filters reject devices
Checking for devices uses is_missing_pv() to check
if there is a device for the PV.  is_missing_pv()
is based on the MISSING_PV flag, which does not
always correspond to !pv->dev.  When using lvmetad,
a command like:

pvs --config 'devices/filter=["a|/dev/sdb|", "r|.*|"]'

will cause a number of PVs to have NULL pv->dev, but
not the MISSING_PV flag.  So, NULL pv->dev needs to
also be checked.
2016-04-27 12:13:26 -05:00
Zdenek Kabelac
49f32e4859 cache: better support for alias check
To still support disabling of policies for test we need
better logic for alias detection introduced in
588455d03e.
2016-04-27 00:20:37 +02:00
Zdenek Kabelac
2a2efab0b1 cleanup: use log_debug_activation 2016-04-27 00:01:08 +02:00
Zdenek Kabelac
c81005dcc4 cleanup: smaller timeout
1s -> 0.5s
Also indent fix.
2016-04-26 23:59:20 +02:00
Zdenek Kabelac
07d92322c1 man: lvcreate doc passthrough
Add few more words about passthough mode.
2016-04-26 23:29:58 +02:00
Zdenek Kabelac
d90d99b23d man: lvchange updates
Drop never existing --degrade.
2016-04-26 23:29:58 +02:00
Zdenek Kabelac
e77b6968b6 lvchange: use better arg functions 2016-04-26 23:29:58 +02:00
Zdenek Kabelac
c215e1be5c lvchange: always check for sigint
Check sigint() state during process_each_lv.
2016-04-26 23:29:08 +02:00
Zdenek Kabelac
d8bdc7af37 lvchange: fix return code
We already opened VG for this - so not an invalid cmdline.
2016-04-26 23:28:01 +02:00
Zdenek Kabelac
84a5b19539 thin: zero and transaction_id also with thin volumes
Show trasaction_id when thin volume was created.
Also show zeroing state of thin-pool with thin volume (so user
doesn't need to lookup thin-pool).
2016-04-26 23:24:51 +02:00
Zdenek Kabelac
8b5967e1e3 cache: check for clean cache as separete function 2016-04-26 23:24:17 +02:00
Zdenek Kabelac
588455d03e cache: with cache target 1.9 mq is alias to smq
Avoid useless check for mq policy, it's loaded as smq
and aliased.
2016-04-26 23:24:05 +02:00
Zdenek Kabelac
aa91fe3d3c modprobe: check /sys/module entry first
Before executing modprobe for given module name, just check
if the module is not already present in /sys/module.

Useful when checking dm-cache-policy modules as we do not
having matching interface like for targets.
2016-04-26 23:23:03 +02:00
Peter Rajnoha
ecae76c713 udev: rules: add comments explaining subsystem-specific rules 2016-04-26 12:57:37 +02:00
Peter Rajnoha
2bb33aaf55 udev: rules: remove mpath from 10-dm.rules, superseded by 11-dm-mpath.rules (mpath>=0.6.0)
Multipath 0.6.0 contains new 11-dm-mpath.rules which supersede the rule
that was in 10-dm.rules. The 11-dm-mpath.rules are also more complete,
fixing several other issues. Using the new 11-dm-mpath.rules from
multipath-tools >= 0.6.0 is strongly recommended for proper
DM multipath functionality!

See also:
  http://christophe.varoqui.free.fr
  http://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=blob;f=multipath/11-dm-mpath.rules
2016-04-25 14:55:54 +02:00
Peter Rajnoha
379874a2d0 cleanup: do not mention segment in warning message if device not found for a PV when checking used/assumed devs for an LV
[0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]'
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices.
  WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  [unknown]  fedora lvm2 a-m   19.49g      0

Probably not worth mentioning "segments" here, just state that devices
for an LV can't be all found during the check - it's less mysterious for
user then:

[0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]'
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Couldn't find all devices for LV fedora/root while checking used and assumed devices.
  WARNING: Couldn't find all devices for LV fedora/swap while checking used and assumed devices.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  [unknown]  fedora lvm2 a-m   19.49g      0
2016-04-25 11:44:24 +02:00
Peter Rajnoha
9d976c0002 metadata: log warning instead of error if device not found while checking used and assumed devs
When checking assumed PVs against real devices used for LVs and if
there's no device assigned for an assumed PV (e.g. due to filters),
do log_warn instead of log_error and continue checking LV segments
and associated assumed PVs further, just like we do log_warn elsewhere
in this situation.

This way user will see the warning for each LV which couldn't be
checked completely against real PVs used. Before, we logged only
the very first occurence of missing device for an LV in a VG and we
returned from the function doing this check for all the LVs in VG
immediately which may be a bit misleading because it didn't tell
user about all the other LVs and whether they could be checked
or not.

For example, we have this setup:

[0] fedora/~ # pvs
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  /dev/vda2  fedora lvm2 a--   19.49g      0

[0] fedora/~ # lvs -o+devices
  LV   VG     Attr       LSize   Devices
  root fedora -wi-ao----  19.00g /dev/vda2(0)
  swap fedora -wi-ao---- 500.00m /dev/vda2(4864)

Before this patch (only the very first LV in a VG is logged to have a
problem while checking used and assumed devices):

[0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]'
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  Couldn't find device for segment belonging to fedora/root while checking used and assumed devices.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  [unknown]  fedora lvm2 a-m   19.49g      0

With this patch applied (all LVs where we hit problem while checking
used and assumed devices are logged and it's warning, not error):

[0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]'
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter.
  WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices.
  WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda          lvm2 ---  128.00m 128.00m
  [unknown]  fedora lvm2 a-m   19.49g      0
2016-04-25 11:27:28 +02:00
Alasdair G Kergon
eb8edccd58 post-release 2016-04-23 00:43:13 +01:00
Alasdair G Kergon
546b2006dd pre-release 2016-04-23 00:41:55 +01:00
Zdenek Kabelac
31b11d0228 tests: drop cluster testing with pvmove
Unwanteadly enabled in previous check-in.
2016-04-22 14:15:36 +02:00
Zdenek Kabelac
a88828c845 coverity: check for sys error in clock call 2016-04-22 14:15:36 +02:00
Zdenek Kabelac
bc239f15eb coverity: ignore some dm_strncpy results
Using them only for debug so ignorable.
Also don't mark stack char buffer alignment, compiler already knows
what's the best here.
2016-04-22 14:15:36 +02:00
Zdenek Kabelac
d12ba022c8 coverity: keep expression using 64bit
Use 64bit input to remain with whole evaluation in 64bit.
2016-04-22 14:15:36 +02:00
Zdenek Kabelac
d564d9f39c coverity: is_used_pv needs valid pv pointer 2016-04-22 14:15:36 +02:00
Zdenek Kabelac
2dc6b97856 tests: make test independent on usage [] for hidden LVs 2016-04-22 12:53:09 +02:00
Zdenek Kabelac
4ddf5a11cf cache: fix previous change and correct ()
412f09ca33 missed parentheses.
2016-04-22 12:52:53 +02:00
Bryn M. Reeves
17ad884836 libdm-stats: check for empty region and area lists
Check that @stats_list and @stats_print returned data in the
_stats_parse_list() and _stats_parse_region() functions before
attempting to operate on region and area values.

This avoids a coverity warning since fgets() could potentially
return no data from the memory buffer returned by the ioctl.

In both cases the ioctl would return an error, preventing these
functions from running, however it is cleaner to test for the
condition explicitly and fail in those cases.
2016-04-22 10:35:07 +01:00
Zdenek Kabelac
69c2f56005 tests: keep using [] for hidden volumes
Figure out which test needs to see hidden volumes without [].
But normally use [] for debug printing in tests.
It's confusing otherwise.
2016-04-22 01:14:56 +02:00
Zdenek Kabelac
8c4b717f4d coverity: drop abadoing object
As mempool is destroyed on by caller don't bother for
mempool freeing here.
2016-04-22 01:13:35 +02:00
Zdenek Kabelac
0bf5518626 coverity: avoid using signed types for single bits 2016-04-22 01:12:34 +02:00
Zdenek Kabelac
412f09ca33 coverity: return non-null string with internal error
While we return internal error we should not let tool crash on NULL
access, so return valid string for such case.
2016-04-22 01:12:34 +02:00
Zdenek Kabelac
447daa9179 coverity: use wider type for whole expression
Coverity likes when the types are same through the whole expression.
And since dev_t is 64b - widen int type early.
2016-04-22 01:12:34 +02:00
Zdenek Kabelac
edcb3e65c6 coverity: drop unused header file 2016-04-22 01:12:34 +02:00
Zdenek Kabelac
99e96f3ce9 coverity: fix error paths
Patch 74e704bb44 missed to update
error path. Since now we just need to 'return_0' as 'dmt is NULL
and thus may not be destroyed.
2016-04-22 01:12:34 +02:00
Zdenek Kabelac
cbf99be43a coverity: fix memory access
Commit  52e0d0db44 introduced regression
as code may access   buf[0 - 1].

Reorder code to first remove '\n' and then check buffer size for
empty.
2016-04-22 01:11:57 +02:00
Zdenek Kabelac
556eba1835 cleanup: use kdev_t header in lvm tree
Reuse libdm header in lvm so we have single definition
of MAJOR/MINOR/MKDEV macros in use.
2016-04-22 00:23:28 +02:00
Zdenek Kabelac
9d4f9defc3 cleanup: simplify code
dm_strncpy() also check the size fits.
2016-04-22 00:22:02 +02:00
David Teigland
c9373a0c2a WHATS_NEW: disable lvmetad for lvm1 2016-04-21 16:40:44 -05:00
Alasdair G Kergon
01181a299e activate: Hide errors when snapshot merge delayed. 2016-04-21 22:14:10 +01:00
David Teigland
4d095c2fbb poll daemon: only call lvmetad_connect when needed
When lvm is not using lvmetad, the lvmetad_connect()
in the forked polling process is not needed and was
generating unwanted warnings.
2016-04-21 15:58:34 -05:00
Zdenek Kabelac
11dd362454 tests: GLIBC decided to obsolete readdir_r
Keep the code compilatible without warnings on newer glibc.
2016-04-21 17:48:19 +02:00
David Teigland
1134ab6324 lvmetad: warn about making changes while not using lvmetad
If lvmetad is running, and a command opts to not use it
(--config global/use_lvmetad=0), and the command changes
metadata, then the metadata change is not visible to
lvmetad.  Subsequent commands using lvmetad to change
metadata may cause corruption based on the invalid
lvmetad state.

Eventually we can set the disabled state in lvmetad
to prevent this problem, but for now print a warning
about the possibility.
2016-04-21 10:28:01 -05:00
David Teigland
6e6f8025ff lvmetad: fix compile without lvmetad
Last commit was missing stub function.
2016-04-21 10:06:47 -05:00
David Teigland
e44c4806db lvmetad: check pid for warning case
When command is not using lvmetad because
use_lvmetad=0 in the config, but the lvmetad
pidfile exists, print a warning (previously
this checked for the socket existing instead
of the pidfile existing.)
2016-04-21 09:50:59 -05:00
David Teigland
d00b70c789 lvmetad: check for socket in connect
We can connect if the socket is present, even
though the pidfile may not exist, since systemd
may start the process when the socket is opened.
2016-04-21 09:27:20 -05:00
Alasdair G Kergon
0778d2e985 display: Avoid internal snapshot LV names in msgs.
vg/snapshotN should not appear anywhere.

No code should be showing this, but it was noticed in some logs last
week and we can deal with it in display_lvname().
2016-04-21 00:30:17 +01:00
Zdenek Kabelac
2763b928de lvmetad: fix compilation without lvmetad# 2016-04-21 00:34:01 +02:00