]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agomirror: fix flushing for mirror target
Zdenek Kabelac [Tue, 5 Apr 2016 19:34:42 +0000 (21:34 +0200)]
mirror: fix flushing for mirror target

Fix regression caused by commit ba41ee1dc94264f7ac8e61f8b1d56b10225b0d2f.
The idea was to use no_flush for changed device only for thin volumes
and thin pools but also to merge this with change made in commit
844b00958492224c448b30f89ae5532bb6591fd2.

However the resulting condition has caused misbehavior for the mirror
suspend - as that has been before the ONLY allowed target type
that could have been suspended with noflush.

Result was badly working repair for --type mirror that has been
passing 'flush' to the repaired mirror target whenever preload
wrongly set flush_required.

The origin code has required the flush_required to be set whenever
deivce size is changed.

Now it first detects if device size got smaller
'dm_tree_node_size_changed(root) < 0' - this requires flush.
Otherwise it checks device is not thin volume nor thin pool and its
size has changed (got bigger) and requires flush.

This mean upsize of thin-pool or thin volume will not require flush.

8 years agopost-release
Alasdair G Kergon [Fri, 1 Apr 2016 19:36:40 +0000 (20:36 +0100)]
post-release

8 years agopre-release v2_02_149
Alasdair G Kergon [Fri, 1 Apr 2016 19:29:52 +0000 (20:29 +0100)]
pre-release

8 years agoRevert "thin: display highest mapped sector"
Alasdair G Kergon [Fri, 1 Apr 2016 19:09:38 +0000 (20:09 +0100)]
Revert "thin: display highest mapped sector"

This reverts commit fc7dacaa4c6bf0af4c5a457c098da26d7cc71f9c.

Let's put this information into a separate field.  It doesn't meet the
definition of the existing field.

8 years agodev-cache: skip VGID/LVID indexing if /sys/dev/block is not present
Peter Rajnoha [Fri, 1 Apr 2016 15:04:11 +0000 (17:04 +0200)]
dev-cache: skip VGID/LVID indexing if /sys/dev/block is not present

/sys/dev/block is available since kernel version 2.2.26 (~ 2008):
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-dev

The VGID/LVID indexing code relies on this feature so skip indexing
if it's not available to avoid error messages about inability to open
/sys/dev/block directory.

We're not going to provide fallback code to read the /sys/block/
instead in this case as that's not that efficient - it needs extra
reads for getting major:minor and reading partitions would also
pose further reads and that's not worth it.

8 years agofix: make udev_get_library_context available also for non-udev compilations
Peter Rajnoha [Fri, 1 Apr 2016 13:35:13 +0000 (15:35 +0200)]
fix: make udev_get_library_context available also for non-udev compilations

If compiling without udev_sync support, udev_get_library_context simply
returns NULL so we don't need to remember putting ifdef UDEV_SYNC_SUPPORT
in the code all the time we just need to check whether there's any udev
context initialized or not.

8 years agodev-cache: iterate devices in sysfs for VGID/LVID index if obtain_device_list_from_udev=0
Peter Rajnoha [Fri, 1 Apr 2016 09:34:09 +0000 (11:34 +0200)]
dev-cache: iterate devices in sysfs for VGID/LVID index if obtain_device_list_from_udev=0

If obtain_device_list_from_udev=0, LVM can make use of persistent .cache
file. This cache file contains only devices which underwent filters in
previous LVM command run. But we need to iterate over all block devices
to create the VGID/LVID index completely for the device mismatch check
to be complete as well.

This patch iterates over block devices found in sysfs to generate the
VGID/LVID index in dev cache if obtain_device_list_from_udev=0
(if obtain_device_list_from_udev=1, we always read complete list of
block devices from udev and we ignore .cache file so we don't need
to look in sysfs for the complete list).

8 years agodev-cache: also add dev name for device found in sysfs only
Peter Rajnoha [Fri, 1 Apr 2016 08:09:03 +0000 (10:09 +0200)]
dev-cache: also add dev name for device found in sysfs only

For the case when we print device name associated with struct device
that was not found in /dev, but in sysfs, for example when printing
devices where LV device mismatch is found.

8 years agorefactor: dev-cache: move code adding sysfs-only device into separate fn
Peter Rajnoha [Fri, 1 Apr 2016 07:41:41 +0000 (09:41 +0200)]
refactor: dev-cache: move code adding sysfs-only device into separate fn

8 years agorefactor: dev-cache: use btree instead of hash table for sysfs-only devices
Peter Rajnoha [Thu, 31 Mar 2016 13:14:01 +0000 (15:14 +0200)]
refactor: dev-cache: use btree instead of hash table for sysfs-only devices

major:minor btree is more convenient and more suitable than dev name
hash table here.

8 years agotests: fixed cache target reacts faster
Zdenek Kabelac [Thu, 31 Mar 2016 10:00:20 +0000 (12:00 +0200)]
tests: fixed cache target reacts faster

After kernel fixed in 4.6 cache target reacts promptly
and switches to Fail-ed state when disk error is detected.

Handle both cases in test...

8 years agotests: do not test settings when MQ is emulated by SMQ
Zdenek Kabelac [Thu, 31 Mar 2016 09:59:55 +0000 (11:59 +0200)]
tests: do not test settings when MQ is emulated by SMQ

8 years agocleanup: use local var to read struct
Zdenek Kabelac [Wed, 30 Mar 2016 08:16:09 +0000 (10:16 +0200)]
cleanup: use local var to read struct

8 years agocleanup: use TARGET define
Zdenek Kabelac [Wed, 30 Mar 2016 08:15:47 +0000 (10:15 +0200)]
cleanup: use TARGET define

8 years agocleanup: debug message fix
Zdenek Kabelac [Tue, 29 Mar 2016 13:57:12 +0000 (15:57 +0200)]
cleanup: debug message fix

Reported-by: Ming-Hung Tsai <mingnus gmail com>
8 years agothin: display highest mapped sector
Zdenek Kabelac [Wed, 30 Mar 2016 09:14:13 +0000 (11:14 +0200)]
thin: display highest mapped sector

Use  meta%  to expose highest mapped sector in thinLV.
so showing there 100.00% means thinLV maps latest sector.

Currently using a 'trick' with total_numerator to pass-in
device size when  'seg==NULL'

TODO: Improve device status API per target - current 'percentage'
is not really extensible.

8 years agothin: no thin-pool flush when reading metadata status
Zdenek Kabelac [Wed, 30 Mar 2016 08:16:41 +0000 (10:16 +0200)]
thin: no thin-pool flush when reading metadata status

Previous fix missed the fact the we do query for 'percent' with
seg value either set or unset (API overload...)
When 'seg' was unset, we still issue flush with status.
Fix it by cheking segtype by target_type.

As we check for segtype - we could also skip whole percentage
if the 'segtype' is unknown by code directly.

Reported-by: Ming-Hung Tsai <mingnus gmail com
8 years agotests: vg-check-devs-used requires driver version 4.15 at least
Peter Rajnoha [Thu, 31 Mar 2016 08:38:05 +0000 (10:38 +0200)]
tests: vg-check-devs-used requires driver version 4.15 at least

8 years agodev-cache: fix check for already indexed dev in _index_dev_by_vgid_and_lvid
Peter Rajnoha [Wed, 30 Mar 2016 12:35:06 +0000 (14:35 +0200)]
dev-cache: fix check for already indexed dev in _index_dev_by_vgid_and_lvid

8 years agodoc: describe lvmlockd/lvmpolld features as available if LVM compiled with lockd...
Peter Rajnoha [Wed, 30 Mar 2016 12:10:56 +0000 (14:10 +0200)]
doc: describe lvmlockd/lvmpolld features as available if LVM compiled with lockd/polld support

8 years agodev-cache: dev_cache_index_devs fn is available unconditionally
Peter Rajnoha [Wed, 30 Mar 2016 11:06:12 +0000 (13:06 +0200)]
dev-cache: dev_cache_index_devs fn is available unconditionally

The new dev_cache_index_devs fn was under ifdef UDEV_SYNC_SUPPORT by mistake,
move it out of this ifdef.

8 years agodev-cache: remove spurious error msg if no value found in /sys/dev/block/<major>...
Peter Rajnoha [Wed, 30 Mar 2016 09:11:37 +0000 (11:11 +0200)]
dev-cache: remove spurious error msg if no value found in /sys/dev/block/<major>:<minor>/dm/uuid during dev scan

It's correct to have a DM device that has no DM UUID assigned
so no need to issue error message in this case. Also, if the
device doesn't have DM UUID, it's also clear it's not an LVM LV
(...when looking for VGID/LVID while creating VGID/LVID indices
in dev cache).

For example:

$ dmsetup create test --table "0 1 linear /dev/sda 0"
And there's no PV in the system.

Before this patch (spurious error message issued):
$ pvs
  _get_sysfs_value: /sys/dev/block/253:2/dm/uuid: no value

With this patch applied (no spurious error message):
$ pvs

8 years agodev-cache: also index VGIDs and LVIDs if using persistent .cache file
Peter Rajnoha [Wed, 30 Mar 2016 08:39:30 +0000 (10:39 +0200)]
dev-cache: also index VGIDs and LVIDs if using persistent .cache file

If we're using persistent .cache file, we're reading this file instead
of traversing the /dev content. Fix missing indexing by VGID and LVID
here - hook this into persistent_filter_load where we populate device
cache from persistent .cache file instead of scanning /dev.

For example, inducing situation in which we warn about different device
actually used than what LVM thinks should be used based on metadata:

$ lsblk -s /dev/vg/lvol0
NAME     MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vg-lvol0 253:4    0  124M  0 lvm
`-loop1    7:1    0  128M  0 loop

$ lvmconfig --type diff

global {
use_lvmetad=0
}
devices {
obtain_device_list_from_udev=0
}

(obtain_device_list_from_udev=0 also means the persistent .cache file is used)

Before this patch - pvs is fine as it does the dev scan, but lvs relies
on persistent .cache file and it misses the VGID/LVID indices to check
and warn about incorrect devices used:

$ pvs
  Found duplicate PV B9gXTHkIdEIiMVwcOoT2LX3Ywh4YIHgR: using /dev/loop0 not /dev/loop1
  Using duplicate PV /dev/loop0 without holders, ignoring /dev/loop1
  WARNING: Device mismatch detected for vg/lvol0 which is accessing /dev/loop1 instead of /dev/loop0.
  PV          VG Fmt  Attr PSize   PFree
  /dev/loop0 vg lvm2 a--  124.00m    0

$ lvs
  Found duplicate PV B9gXTHkIdEIiMVwcOoT2LX3Ywh4YIHgR: using /dev/loop0 not /dev/loop1
  Using duplicate PV /dev/loop0 without holders, ignoring /dev/loop1
  LV    VG Attr       LSize
  lvol0 vg -wi-a----- 124.00m

With this patch applied - both pvs and lvs is fine - the indices are
always created correctly (lvs just an example here, other LVM commands
that rely on persistent .cache file are fixed with this patch too):

$ pvs
  Found duplicate PV B9gXTHkIdEIiMVwcOoT2LX3Ywh4YIHgR: using /dev/loop0 not /dev/loop1
  Using duplicate PV /dev/loop0 without holders, ignoring /dev/loop1
  WARNING: Device mismatch detected for vg/lvol0 which is accessing /dev/loop1 instead of /dev/loop0.
  PV          VG Fmt  Attr PSize   PFree
  /dev/loop0 vg lvm2 a--  124.00m    0

$ lvs
  Found duplicate PV B9gXTHkIdEIiMVwcOoT2LX3Ywh4YIHgR: using /dev/loop0 not /dev/loop1
  Using duplicate PV /dev/loop0 without holders, ignoring /dev/loop1
  WARNING: Device mismatch detected for vg/lvol0 which is accessing /dev/loop1 instead of /dev/loop0.
  LV    VG Attr       LSize
  lvol0 vg -wi-a----- 124.00m

8 years agodev-cache: handle situation where device is referenced in sysfs, but the node is...
Peter Rajnoha [Wed, 30 Mar 2016 08:29:35 +0000 (10:29 +0200)]
dev-cache: handle situation where device is referenced in sysfs, but the node is not yet in dev dir

It's possible that while a device is already referenced in sysfs, the node
is not yet in /dev directory.

This may happen in some rare cases right after LVs get created - we sync
with udev (or alternatively we create /dev content ourselves) while VG
lock is held. However, dev scan is done without VG lock so devices may
already be in sysfs, but /dev may not be updated yet if we call LVM command
right after LV creation (so the fact that fs_unlock is done within VG
lock is not usable here much). This is not a problem with devtmpfs as
there's at least kernel name for device in /dev as soon as the sysfs
item exists, but we still support environments without devtmpfs or
where different directory for dev nodes is used (e.g. our test suite).

This patch covers these situations by tracking such devices in
_cache.sysfs_only_names helper hash for the vgid/lvid check to work still.

This also resolves commit 6129d2e64d14047169048775dc7081135c0fcc50
which was then reverted by commit 109b7e2095a7bc5603bf79db0224b8399463af7c
due to performance issues it may have brought (...and it didn't resolve
the problem fully anyway).

8 years agotest: Add missing directory
Marian Csontos [Tue, 29 Mar 2016 06:24:52 +0000 (08:24 +0200)]
test: Add missing directory

Fix commit bb93a28bc1

8 years agopost-commit
Alasdair G Kergon [Sat, 26 Mar 2016 09:07:21 +0000 (09:07 +0000)]
post-commit

8 years agopre-release v2_02_148
Alasdair G Kergon [Sat, 26 Mar 2016 09:04:50 +0000 (09:04 +0000)]
pre-release

8 years agolibdm: Raid status region units are sectors
Alasdair G Kergon [Thu, 24 Mar 2016 17:42:36 +0000 (17:42 +0000)]
libdm: Raid status region units are sectors

8 years agolvmdbusd: Add '-' to allowable PV device path chars
Tony Asleson [Thu, 24 Mar 2016 17:26:28 +0000 (12:26 -0500)]
lvmdbusd: Add '-' to allowable PV device path chars

8 years agorevert: 6129d2e64d14047169048775dc7081135c0fcc50
Peter Rajnoha [Thu, 24 Mar 2016 13:04:43 +0000 (14:04 +0100)]
revert: 6129d2e64d14047169048775dc7081135c0fcc50

Unfortunately, commit 6129d2e64d14047169048775dc7081135c0fcc50 may
cause performance issue. There's going to be a better fix...

8 years agoWHATS_NEW: commit 6129d2e64d14047169048775dc7081135c0fcc50
Peter Rajnoha [Thu, 24 Mar 2016 11:47:35 +0000 (12:47 +0100)]
WHATS_NEW: commit 6129d2e64d14047169048775dc7081135c0fcc50

8 years agomonitoring: sync /dev content before contacting dmeventd for monitor/unmonitor
Peter Rajnoha [Thu, 24 Mar 2016 10:13:21 +0000 (11:13 +0100)]
monitoring: sync /dev content before contacting dmeventd for monitor/unmonitor

dmeventd daemon may call further code itself that looks at /dev, e.g.
via dmeventd_lvm2_command call. We need to have a consistent view of
the /dev content at that time. Therefore, sync /dev content before
calling monitoring hook which contacts dmeventd.

This problem was quite hidden before, but now it has manifested itself
because of recent additions to dev-cache code where we started looking
at device holders as seen in sysfs. What happened here was that the
device was already in sysfs, but not yet under /dev and this triggered
the new error message sometimes:

  log_error("%s: failed to find associated device structure for holder %s.", devname, devpath);

This problem has manifested recently in our api/pytest.sh test from
testsuite where we create thin pool LVs and thin LVs and hence it also
causes dmeventd to be used as well and these error messages were
visible there.

8 years agotest: Move bus configuration to prepare function
Marian Csontos [Tue, 22 Mar 2016 08:15:40 +0000 (09:15 +0100)]
test: Move bus configuration to prepare function

8 years agotest: Remove pidfile after killing the process
Marian Csontos [Wed, 23 Mar 2016 11:18:08 +0000 (12:18 +0100)]
test: Remove pidfile after killing the process

Though unlikely keeping files in place may result in random process
killed.

8 years agotest: Fix lvmdbusd tests to work with installed testsuite
Marian Csontos [Wed, 23 Mar 2016 10:56:25 +0000 (11:56 +0100)]
test: Fix lvmdbusd tests to work with installed testsuite

8 years agotest: Fix checks to skip lvmdbusd tests
Marian Csontos [Wed, 23 Mar 2016 10:45:21 +0000 (11:45 +0100)]
test: Fix checks to skip lvmdbusd tests

The executable is always present in the tree, need to check the
runtime dependencies.

8 years agoproperties: use proper 'get' variant for unimplemented _pv_major_get and _pv_minor_ge...
Peter Rajnoha [Wed, 23 Mar 2016 09:52:46 +0000 (10:52 +0100)]
properties: use proper 'get' variant for unimplemented _pv_major_get and _pv_minor_get fns

8 years agoraid: Tidy dm_get_status_raid. [HM]
Alasdair G Kergon [Tue, 22 Mar 2016 21:39:52 +0000 (21:39 +0000)]
raid: Tidy dm_get_status_raid. [HM]

8 years agolibdm: Move _skip_fields within file.
Alasdair G Kergon [Tue, 22 Mar 2016 19:27:34 +0000 (19:27 +0000)]
libdm: Move _skip_fields within file.

8 years agolibdm: Change _advance_to_next_word to _skip_fields
Alasdair G Kergon [Tue, 22 Mar 2016 19:26:13 +0000 (19:26 +0000)]
libdm: Change _advance_to_next_word to _skip_fields

8 years agoactivate: Use macros for target and module names.
Alasdair G Kergon [Tue, 22 Mar 2016 17:46:15 +0000 (17:46 +0000)]
activate: Use macros for target and module names.

8 years agocoverity: fix some issues reported by coverity for recent code
Peter Rajnoha [Tue, 22 Mar 2016 15:03:51 +0000 (16:03 +0100)]
coverity: fix some issues reported by coverity for recent code

8 years agotests: update vg-check-devs-used.sh
Peter Rajnoha [Tue, 22 Mar 2016 10:18:16 +0000 (11:18 +0100)]
tests: update vg-check-devs-used.sh

Snapshot needs to be activated exclusively in cluster...

8 years agotests: update vg-check-devs-used.sh
Peter Rajnoha [Tue, 22 Mar 2016 10:13:28 +0000 (11:13 +0100)]
tests: update vg-check-devs-used.sh

8 years agodev: also count with suffixes in UUID for LVs when constructing VGID and LVID index
Peter Rajnoha [Tue, 22 Mar 2016 09:28:01 +0000 (10:28 +0100)]
dev: also count with suffixes in UUID for LVs when constructing VGID and LVID index

UUID for LV is either "LVM-<vg_uuid><lv_uuid>" or "LVM-<vg_uuid><lv_uuid>-<suffix>".
The code before just checked the length of the UUID based on the first
template, not the variant with suffix - so LVs with this suffix were not
processed properly.

For example a thin pool LV (as an example of an LV that contains
sub LVs where UUIDs have suffixes):

[0] fedora/~ # lsblk -s /dev/vg/lvol1
NAME              MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vg-lvol1          253:8    0    4M  0 lvm
`-vg-pool-tpool   253:6    0  116M  0 lvm
  |-vg-pool_tmeta 253:2    0    4M  0 lvm
  | `-sda           8:0    0  128M  0 disk
  `-vg-pool_tdata 253:3    0  116M  0 lvm
    `-sda           8:0    0  128M  0 disk

Before this patch (spurious warning message about device mismatch):

[0] fedora/~ # pvs
  WARNING: Device mismatch detected for vg/lvol1 which is accessing /dev/mapper/vg-pool-tpool instead of (null).
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda   vg     lvm2 a--  124.00m    0

With this patch applied (no spurious warning message about device mismatch):

[0] fedora/~ # pvs
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda   vg     lvm2 a--  124.00m    0

8 years agodev: also check for blank sysfs value containing only '\n'
Peter Rajnoha [Tue, 22 Mar 2016 08:29:24 +0000 (09:29 +0100)]
dev: also check for blank sysfs value containing only '\n'

8 years agoreport: Add pv_major, pv_minor to reports.
Alasdair G Kergon [Tue, 22 Mar 2016 00:12:08 +0000 (00:12 +0000)]
report: Add pv_major, pv_minor to reports.

8 years agolvmdbusd: Change print statements to log_error
Tony Asleson [Mon, 21 Mar 2016 22:24:04 +0000 (17:24 -0500)]
lvmdbusd: Change print statements to log_error

Should not be using print() in the service code.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbusd: Add lvm flight recorder
Tony Asleson [Mon, 21 Mar 2016 22:22:56 +0000 (17:22 -0500)]
lvmdbusd: Add lvm flight recorder

To help out with debug, when an exception is thrown in the dbus service we
will dump all the information we have on the last 16 commands that were
executed along with the stack strace.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbusd: Allow PV devices to be referenced by symlink(s)
Tony Asleson [Mon, 21 Mar 2016 22:19:38 +0000 (17:19 -0500)]
lvmdbusd: Allow PV devices to be referenced by symlink(s)

See: https://bugzilla.redhat.com/show_bug.cgi?id=1318754

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbusd: Remove --udev in service file
Tony Asleson [Mon, 21 Mar 2016 15:18:18 +0000 (10:18 -0500)]
lvmdbusd: Remove --udev in service file

With commit 2d5dc6512e10924ab68e6a139081d7121bc3f7d6 the dbus server
no longer needs to utilize udev to know when to update its internal
state.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agotests: add vg-check-devs-used.sh
Peter Rajnoha [Mon, 21 Mar 2016 15:21:30 +0000 (16:21 +0100)]
tests: add vg-check-devs-used.sh

8 years agodev: be safer when reading sysfs properties
Peter Rajnoha [Mon, 21 Mar 2016 14:48:36 +0000 (15:48 +0100)]
dev: be safer when reading sysfs properties

Check if the value we read from sysfs is not blank and replace the '\n'
at the end only when needed ('\n' should usually be there for sysfs values,
but better check this).

8 years agotest: Turn on dbus test
Marian Csontos [Tue, 23 Feb 2016 08:00:35 +0000 (09:00 +0100)]
test: Turn on dbus test

(cherry picked from commit f1ea96c6c1dc6414169bda1a18cf14cd9ebb1493)

8 years agometadata: use own mem pool to report PV device mismatch in VG
Peter Rajnoha [Mon, 21 Mar 2016 13:38:49 +0000 (14:38 +0100)]
metadata: use own mem pool to report PV device mismatch in VG

8 years agodev: detect mismatch between devices used and devices assumed for an LV
Peter Rajnoha [Wed, 16 Mar 2016 13:01:26 +0000 (14:01 +0100)]
dev: detect mismatch between devices used and devices assumed for an LV

It's possible for an LVM LV to use a device during activation which
then differs from device which LVM assumes based on metadata later on.

For example, such device mismatch can occur if LVM doesn't have
complete view of devices during activation or if filters are
misbehaving or they're incorrectly set during activation.

This patch adds code that can detect this mismatch by creating
VG UUID and LV UUID index while scanning devices for device cache.

The VG UUID index maps VG UUID to a device list. Each device in the
list has a device layered above as a holder which is an LVM LV device
and for which we know the VG UUID (and similarly for LV UUID index).

We can acquire VG and LV UUID by reading /sys/block/<dm_dev_name>/dm/uuid.
So these indices represent the actual state of PV device use in
the system by LVs and then we compare that to what LVM assumes
based on metadata.

For example:

[0] fedora/~ # lsblk /dev/sdq /dev/sdr /dev/sds /dev/sdt
NAME         MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sdq           65:0    0  104M  0 disk
|-vg-lvol0   253:2    0  200M  0 lvm
`-mpath_dev1 253:3    0  104M  0 mpath
sdr           65:16   0  104M  0 disk
`-mpath_dev1 253:3    0  104M  0 mpath
sds           65:32   0  104M  0 disk
|-vg-lvol0   253:2    0  200M  0 lvm
`-mpath_dev2 253:4    0  104M  0 mpath
sdt           65:48   0  104M  0 disk
`-mpath_dev2 253:4    0  104M  0 mpath

In this case the vg-lvol0 is mapped onto sdq and sds becauset this is
what was available and seen during activation. Then later on, sdr and
sdt appeared and mpath devices were created out of sdq+sdr (mpath_dev1)
and sds+sdt (mpath_dev2). Now, LVM assumes (correctly) that mpath_dev1
and mpath_dev2 are the PVs that should be used, not the mpath
components (sdq/sdr, sds/sdt).

[0] fedora/~ # pvs
  Found duplicate PV xSUix1GJ2SK82ACFuKzFLAQi8xMfFxnO: using /dev/mapper/mpath_dev1 not /dev/sdq
  Using duplicate PV /dev/mapper/mpath_dev1 from subsystem DM, replacing /dev/sdq
  Found duplicate PV MvHyMVabtSqr33AbkUrobq1LjP8oiTRm: using /dev/mapper/mpath_dev2 not /dev/sds
  Using duplicate PV /dev/mapper/mpath_dev2 from subsystem DM, ignoring /dev/sds
  WARNING: Device mismatch detected for vg/lvol0 which is accessing /dev/sdq, /dev/sds instead of /dev/mapper/mpath_dev1, /dev/mapper/mpath_dev2.
  PV                     VG     Fmt  Attr PSize   PFree
  /dev/mapper/mpath_dev1 vg     lvm2 a--  100.00m      0
  /dev/mapper/mpath_dev2 vg     lvm2 a--  100.00m      0

8 years agodevice: add DEV_OPEN_FAILURE flag
Peter Rajnoha [Thu, 17 Mar 2016 12:45:14 +0000 (13:45 +0100)]
device: add DEV_OPEN_FAILURE flag

DEV_OPEN_FAILURE flag is set if the most recent "open" for a device
failed and it's unset if any subsequent "open" succeeds.

8 years agopost-release
Alasdair G Kergon [Sat, 19 Mar 2016 01:18:28 +0000 (01:18 +0000)]
post-release

8 years agopre-release v2_02_147
Alasdair G Kergon [Sat, 19 Mar 2016 01:14:29 +0000 (01:14 +0000)]
pre-release

8 years agofsadm: use stat to get major:minor pair for non-standard /dev layouts
Peter Rajnoha [Fri, 18 Mar 2016 14:55:36 +0000 (15:55 +0100)]
fsadm: use stat to get major:minor pair for non-standard /dev layouts

If we're using non-standard /dev layout so we can't get the dm-X name
easily, we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair. Use "stat" in this case even though it triggers automounts
(but there's no better way for now).

8 years agofsadm: if available, use /proc/self/mountinfo to detect mounted volume
Peter Rajnoha [Fri, 18 Mar 2016 12:42:06 +0000 (13:42 +0100)]
fsadm: if available, use /proc/self/mountinfo to detect mounted volume

The /proc/self/mountinfo is not bound to device names like /proc/mounts
and it uses major:minor pairs instead.

This fixes a situation in which a volume is mounted and then renamed
later on - that makes /proc/mounts unreliable when detecting mounted
volumes.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1196910.

8 years agotests: stacked resize of thin on raid
Zdenek Kabelac [Tue, 15 Mar 2016 22:16:47 +0000 (23:16 +0100)]
tests: stacked resize of thin on raid

8 years agolvresize: fix stacked resize
Zdenek Kabelac [Tue, 15 Mar 2016 22:13:28 +0000 (23:13 +0100)]
lvresize: fix stacked resize

Commit b64703401da1f4bef60579a0b3766c087fcfe96a cause regression
when handling stacked resize of pool metadata volume that would
be a raid LV.

Fix it by properly setting up size also for layer extension.

8 years agotests: update lvconvert test
Zdenek Kabelac [Mon, 14 Mar 2016 22:22:19 +0000 (23:22 +0100)]
tests: update lvconvert test

8 years agotests: use own PID path for lvmetad checking
Zdenek Kabelac [Mon, 14 Mar 2016 22:16:45 +0000 (23:16 +0100)]
tests: use own PID path for lvmetad checking

Do not try to check PID of running lvmetad and use own path.

8 years agolvconvert: fix error path test
Zdenek Kabelac [Mon, 14 Mar 2016 22:19:22 +0000 (23:19 +0100)]
lvconvert: fix error path test

lvremove_single toollib function returns
ECMD_FAILED or ECMD_PROCESSED.

8 years agoreport: Use default vg_name field width too.
Alasdair G Kergon [Mon, 14 Mar 2016 09:30:51 +0000 (09:30 +0000)]
report: Use default  vg_name field width too.

8 years agopost-release
Alasdair G Kergon [Fri, 11 Mar 2016 00:21:53 +0000 (00:21 +0000)]
post-release

8 years agopre-release v2_02_146
Alasdair G Kergon [Fri, 11 Mar 2016 00:19:16 +0000 (00:19 +0000)]
pre-release

8 years agoman: vgcreate shared
David Teigland [Thu, 10 Mar 2016 21:40:37 +0000 (15:40 -0600)]
man: vgcreate shared

8 years agopvchange, pvresize: move exported VG check
David Teigland [Thu, 10 Mar 2016 19:28:47 +0000 (13:28 -0600)]
pvchange, pvresize: move exported VG check

Allow pvchange and pvresize to process exported VGs,
and have them check for the exported state in their
single function.

Previously, the exported VG state would trigger a
failure in vg_read()/ignore_vg() because the VGs are
being read with READ_FOR_UPDATE.  Because these commands
read all VGs to search for the intended PVs, any
exported VG would trigger a failure, even if it was
not related to the intended PV.

8 years agolvconvert: update --help
Zdenek Kabelac [Sat, 5 Mar 2016 20:02:30 +0000 (21:02 +0100)]
lvconvert: update --help

Use  <>  around user entered option parameters to make it visually
different (just like we use Italic style in man page).

TODO:

In the future we should consistently provide such notation and
possibly generate it automagically from some internal data structures.

Preferably for man pages as well so we report actual set of supported
options.

8 years agotests: uncache with missing PV
Zdenek Kabelac [Tue, 8 Mar 2016 09:56:36 +0000 (10:56 +0100)]
tests: uncache with missing PV

For now repair of cache with missing PVs via usage of --uncache.
More will follow later.

8 years agocleanup: display_lvname
Zdenek Kabelac [Mon, 7 Mar 2016 09:45:50 +0000 (10:45 +0100)]
cleanup: display_lvname

8 years agocleanup: reoder lines
Zdenek Kabelac [Mon, 7 Mar 2016 09:30:21 +0000 (10:30 +0100)]
cleanup: reoder lines

8 years agocleanup: add backtrace
Zdenek Kabelac [Mon, 7 Mar 2016 09:20:35 +0000 (10:20 +0100)]
cleanup: add backtrace

8 years agogcc: cast time_t to 64bit
Zdenek Kabelac [Mon, 7 Mar 2016 17:12:26 +0000 (18:12 +0100)]
gcc: cast time_t to 64bit

Value is printed as uint64, so make sure right type is passed on all
platforms. Fixes gcc warning on some 32bit platforms.

8 years agotopology: handle reported sizes smaller then sector
Zdenek Kabelac [Thu, 3 Mar 2016 19:53:08 +0000 (20:53 +0100)]
topology: handle reported sizes smaller then sector

Recent kernel (4.4) start to report values smaller then sector size
(but in reporting size for SSD which support data zeroing on discard).

For now log warning and assume it really means 1 sector.

Addressing RHBZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1313377

8 years agoman: drop extra braces
Zdenek Kabelac [Fri, 4 Mar 2016 20:59:04 +0000 (21:59 +0100)]
man: drop extra braces

doclifter tool noticed wrong brackets.

8 years agoman: updates
Zdenek Kabelac [Thu, 3 Mar 2016 19:27:09 +0000 (20:27 +0100)]
man: updates

Continuing with lvconvert style updates.

Minimize usage of '\:' as zero-width break space, since html renderers
do not handle this groff sign well (some of them seems to even render
':' there).
But since we do not want see badly rendered man pages itself, prefer
the 'man visual' appearence over html page generation (man2html should
be actually fixed).

Start to use 'user input option' with Capitals more consistently.

8 years agomakefiles: avoid using vpath for rules files
Zdenek Kabelac [Wed, 9 Mar 2016 16:52:29 +0000 (17:52 +0100)]
makefiles: avoid using vpath for rules files

Fixing vpath usage as it has been checking for existance of
generated file also in the $(scrdir) e.g.:

No need to remake target '10-dm.rules.in'; using VPATH name '...'

If the $(srcdir) had been also $(builddir) and contained already
generated rules file, it's been used instead generating new
one.

(See: http://make.mad-scientist.net/papers/how-not-to-use-vpath/)

8 years agolvconvert: improve vg parameter parsing
Zdenek Kabelac [Tue, 8 Mar 2016 09:13:38 +0000 (10:13 +0100)]
lvconvert: improve vg parameter parsing

Commit abd9618dd8b77ca1974074ae76fa6a08f1a687d9 tried to improve
parsing of vg name from logical path - but still missed couple
corner cases.

This patch further improves the logic and reuses
validate_lvname_param() for parsing of lv_name.

Also explicitly checks for LVM_VG_NAME in the right case.

So now also properly parses cases like:
  'lvconvert --repairt vg/'
and will provide correct error message.

8 years agocache: check for cache fail during flush
Zdenek Kabelac [Thu, 10 Mar 2016 16:56:43 +0000 (17:56 +0100)]
cache: check for cache fail during flush

Just WARN if the cache can't be flushed because it's failed.

8 years agolvconvert: uncache handles missing PV
Zdenek Kabelac [Tue, 8 Mar 2016 09:47:27 +0000 (10:47 +0100)]
lvconvert: uncache handles missing PV

Allow to process with --uncache when some PVs are missing in VG.

So it's now possible to --uncache cached LV if the cache-pool
has missing PV.

8 years agolibdm: parse more info from cache status
Zdenek Kabelac [Wed, 9 Mar 2016 17:00:57 +0000 (18:00 +0100)]
libdm: parse more info from cache status

Parse Fail/Error/need_check/ro status info from cache.

8 years agometadata: do not issue warning message about PV dev size being 0 when the device...
Peter Rajnoha [Thu, 10 Mar 2016 12:02:38 +0000 (13:02 +0100)]
metadata: do not issue warning message about PV dev size being 0 when the device has gone just after VG read

There's a window between doing VG read and checking PV device size
against real device size. If the device is removed in this window,
the dev cache still holds struct device and pv->dev still references
that and that PV is not marked as missing. However, if we're trying
to get size for such device, the open fails because that device
doesn't exists anymore.

We called existing pv_dev_size in _check_pv_dev_sizes fn. But
pv_dev_size assigned a size of 0 if the dev_get_size it called failed
(because the device is gone).

So call the dev_get_size directly and check for the return code
in _check_pv_dev_sizes and go further only if we really know the
device size. This is to avoid confusing warning messages like:

  Device /dev/sdd1 has size of 0 sectors which is smaller than corresponding PV size of 31455207 sectors. Was device resized?
  One or more devices used as PVs in VG helter_skelter have changed sizes.

8 years agoremove unused define
David Teigland [Wed, 9 Mar 2016 19:38:04 +0000 (13:38 -0600)]
remove unused define

8 years agotest: Remove work-in-progress code from dbustest
Marian Csontos [Wed, 9 Mar 2016 13:03:17 +0000 (14:03 +0100)]
test: Remove work-in-progress code from dbustest

(cherry picked from commit 3189d4d50492f5b78cf3920a7f499fd1020983c6)

8 years agospec: Fix gobject dependency
Marian Csontos [Wed, 9 Mar 2016 10:42:55 +0000 (11:42 +0100)]
spec: Fix gobject dependency

Use python3-gobject-base instead of python3-gobject requiring xorg

(cherry picked from commit d929d82116759f53484e662b967165ef4fe4257c)

8 years agotest: skip unrelated tests while testing lvmpolld
Ondrej Kozina [Wed, 9 Mar 2016 11:32:10 +0000 (12:32 +0100)]
test: skip unrelated tests while testing lvmpolld

8 years agotest: fix inverted condition
Ondrej Kozina [Wed, 9 Mar 2016 10:31:01 +0000 (11:31 +0100)]
test: fix inverted condition

8 years agotest: Add prepare_lvmdbusd
Marian Csontos [Tue, 1 Mar 2016 10:49:05 +0000 (11:49 +0100)]
test: Add prepare_lvmdbusd

- Check for running lvmdbusd at start
- Add teardown for lvmdbusd

8 years agospec: Add missing dependency for dbusd
Marian Csontos [Tue, 23 Feb 2016 09:30:39 +0000 (10:30 +0100)]
spec: Add missing dependency for dbusd

(cherry picked from commit 7435de21492f6b37ac7664d1f27b4a8dcc4d0dd4)

8 years agotest: Comment out incorrect lockd setup
Marian Csontos [Wed, 9 Mar 2016 09:56:39 +0000 (10:56 +0100)]
test: Comment out incorrect lockd setup

8 years agotest: Move udev-lvmlockd-test to check_system
Marian Csontos [Wed, 9 Mar 2016 09:50:32 +0000 (10:50 +0100)]
test: Move udev-lvmlockd-test to check_system

8 years agotest: Update kernels to skip thin-flags with
Marian Csontos [Tue, 8 Mar 2016 08:46:34 +0000 (09:46 +0100)]
test: Update kernels to skip thin-flags with

See ed5e5c38b5ac4b7c8cb7e809d9d35c72f087e29e

8 years agolvmdbus: Fix deprecated warnings for GObject use
Tony Asleson [Tue, 8 Mar 2016 22:04:44 +0000 (16:04 -0600)]
lvmdbus:  Fix deprecated warnings for GObject use

While running on F24 a number of warnings were being emitted from using the
deprecated GObject instead of GLib.  Tested on python 3.4 and 3.5.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbus: Fix exception during exception handling
Tony Asleson [Tue, 8 Mar 2016 21:57:15 +0000 (15:57 -0600)]
lvmdbus: Fix exception during exception handling

Python 3.5 in F24 was throwing the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/lvmdbusd/main.py", line 73, in process_request
    req.run_cmd()
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 73, in run_cmd
    self.register_error(-1, st)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 123, in register_error
    self._reg_ending(None, error_rc, error)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 115, in _reg_ending
    self.cb_error(self._rc_error)
  File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 669, in <lambda>
    keywords[error_callback] = lambda exception: _method_reply_error(connection, message, exception)
  File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 293, in _method_reply_error
    exception))
  File "/usr/lib64/python3.5/traceback.py", line 136, in format_exception_only
    return list(TracebackException(etype, value, None).format_exception_only())
  File "/usr/lib64/python3.5/traceback.py", line 442, in __init__
    if (exc_value and exc_value.__cause__ is not None
AttributeError: 'str' object has no attribute '__cause__'

This was caused because we were calling the dbus error callback with a
string instead of an actual exception.  On python 3.4 this was apparently
OK, but not with 3.5.  Corrected to pass the exception to error callback.
Change tested on both python 3.4 and 3.5.

Reported-by: Vratislav Podzimek <vpodzime@redhat.com>
Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agoreport: Tidy some field names, widths and headings.
Alasdair G Kergon [Tue, 8 Mar 2016 19:50:22 +0000 (19:50 +0000)]
report: Tidy some field names, widths and headings.

Specifying an output width of 0 now leads to a default minimum width
taken from the width of the column heading.  (Most fields should use
this.)

Components of field names are generally separated by underscores (which
are optional at run-time).  (Dropped 3 duplicate fields now covered by
this rule.)

Each field heading must be unique and generally doesn't have spaces
between words (which get capitalised) unless they are already short and
the fields are normally longer or clarity demands it.

8 years agotoollib: always process in use pvs
David Teigland [Mon, 7 Mar 2016 20:15:33 +0000 (14:15 -0600)]
toollib: always process in use pvs

With the recent conversion of pvcreate/pvremove to the
common toollib processing function, skipping in-use PVs
in _process_pvs_in_vg prevented them from being protected
as intended by the in-use flag.

The processing code for pvcreate/pvremove checks for the
in-use state itself and prevents using an in-use PV.
If a PV is skipped, it looks like an unused device and
is not protected from being used in pvcreate/pvremove.

This page took 0.077226 seconds and 5 git commands to generate.