]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agopost-release
Alasdair G Kergon [Sat, 9 Apr 2016 01:10:39 +0000 (02:10 +0100)]
post-release

8 years agopre-release v2_02_150
Alasdair G Kergon [Sat, 9 Apr 2016 01:08:44 +0000 (02:08 +0100)]
pre-release

8 years agocleanup: avoid gcc warns
Zdenek Kabelac [Fri, 8 Apr 2016 09:36:02 +0000 (11:36 +0200)]
cleanup: avoid gcc warns

Some older systems may had global declaration to cause gcc warning.
Rename for cases we don't care...

8 years agocleanup: simplier to read condition
Zdenek Kabelac [Fri, 8 Apr 2016 17:34:56 +0000 (19:34 +0200)]
cleanup: simplier to read condition

Make more readable what we are looking for and just test for
KERNEL version at one place.

8 years agocleanup: reuse _setup_task
Zdenek Kabelac [Fri, 8 Apr 2016 17:28:35 +0000 (19:28 +0200)]
cleanup: reuse _setup_task

Shorten code and use common code from _setup_task.
Reorder naming of major:minor sscanf (as later it's been
also used swapped there was no real bug).

8 years agodev_manager: device_is_usable does not flush
Zdenek Kabelac [Fri, 8 Apr 2016 14:00:03 +0000 (16:00 +0200)]
dev_manager: device_is_usable does not flush

When scanning if device is being usable as PV,
we call STATUS - but this status should not cause
any flushing.
Skip also open_count information as it's not needed.

8 years agoactivation: Skip another non-prefixed info ioctl.
Alasdair G Kergon [Fri, 8 Apr 2016 15:27:12 +0000 (16:27 +0100)]
activation: Skip another non-prefixed info ioctl.

_percent() also does a lookup by dm uuid.
Also get kernel version from cmd->kernel_vsn.

8 years agotest: Fix testing of installed lvmdbusd
Marian Csontos [Fri, 1 Apr 2016 07:28:31 +0000 (09:28 +0200)]
test: Fix testing of installed lvmdbusd

If lvmdbusd is missing expression triggers ERR trap instead of skipping
the test.

8 years agoreport: remove superfluous SEGSSTATUS report type
Peter Rajnoha [Fri, 8 Apr 2016 12:18:00 +0000 (14:18 +0200)]
report: remove superfluous SEGSSTATUS report type

We don't have any report field of this type yet. Return this patch into
the play if we really need that. Currenly we always report status
(result of "status" dm ioctl) for an LV as a whole where we choose
segment which represents the LV, not calling status for each possible
segment it contains - we don't need this now so I'm removing it to
not make the code more complex uselessly.

8 years agocleanup: use common init/destroy_processing_handle in _report fn and cleanup error...
Peter Rajnoha [Fri, 8 Apr 2016 09:01:19 +0000 (11:01 +0200)]
cleanup: use common init/destroy_processing_handle in _report fn and cleanup error paths

8 years agocleanup: use #define for field's quote and pair character and also for the error...
Peter Rajnoha [Fri, 8 Apr 2016 08:55:13 +0000 (10:55 +0200)]
cleanup: use #define for field's quote and pair character and also for the error msg while extending output line

8 years agotests: require newer cache target
Zdenek Kabelac [Thu, 7 Apr 2016 22:04:26 +0000 (00:04 +0200)]
tests: require newer cache target

Older cache target is likely not updating status at all...

8 years agotests: use mkfs.ext3
Zdenek Kabelac [Thu, 7 Apr 2016 20:07:41 +0000 (22:07 +0200)]
tests: use mkfs.ext3

mkfs.ext4 is not really needed so use more widespread mkfs.ext3
so test runs on older system.

8 years agoactivation: do not check for devs without LVM-
Zdenek Kabelac [Thu, 7 Apr 2016 19:37:26 +0000 (21:37 +0200)]
activation: do not check for devs without LVM-

Devices without "LVM-" uuid prefix have been generated by very old
version of lvm2 2.00 and 2.01.
Since version 2.02 all lvm2 devices are using prefix "LVM-".

However checking for present of ancient non prefixed devices does
take extra IOCTL per every call and for majority of todays user
it will not find anything new.

So use the assumption that users with kernel 3.X and newer are not
really using such old versions of lvm2 (year <2005) and with their
new kernel they are also using new version of lvm2 and skip
checking for them.

This change also makes trace logs more readable.

8 years agolvcreate: %FREE -> %PVS
Zdenek Kabelac [Thu, 7 Apr 2016 09:12:49 +0000 (11:12 +0200)]
lvcreate: %FREE -> %PVS

This is hotfix for RHBZ: https://bugzilla.redhat.com/1324537
However already the %FREE is not a good fit and we need something
better. Meanwhile make  -l%PVS work at least as good as %FREE
for thin-pool.

TODO: this needs rework - it should be allocator to do all the size
decisions at one place.

8 years agoWHATS_NEW: update
Zdenek Kabelac [Thu, 7 Apr 2016 20:20:01 +0000 (22:20 +0200)]
WHATS_NEW: update

doc for previous commits.

8 years agolibdm: Correct typo.
Alasdair G Kergon [Thu, 7 Apr 2016 00:51:09 +0000 (01:51 +0100)]
libdm: Correct typo.

8 years agolvmdump: If dir exists check dir perms too.
Alasdair G Kergon [Wed, 6 Apr 2016 21:56:45 +0000 (22:56 +0100)]
lvmdump: If dir exists check dir perms too.

8 years agolvmdump: Allow dir to exist already if it is empty
Alasdair G Kergon [Wed, 6 Apr 2016 21:36:42 +0000 (22:36 +0100)]
lvmdump: Allow dir to exist already if it is empty

8 years agotests: do not break teardown on failing losetup
Zdenek Kabelac [Fri, 1 Apr 2016 07:36:23 +0000 (09:36 +0200)]
tests: do not break teardown on failing losetup

Ignore failing 'losetup -d' - i.e. device may have disappeared...

8 years agotests: verify repair of failing mirror
Zdenek Kabelac [Wed, 6 Apr 2016 09:50:18 +0000 (11:50 +0200)]
tests: verify repair of failing mirror

Improved test script to verify lost mirror image does not
cause mirror corruption while mirror is in use.

TODO: add more cases (lost mlog...), lost image from 3leg mirror...

8 years agocleanup: indent
Zdenek Kabelac [Wed, 6 Apr 2016 08:28:02 +0000 (10:28 +0200)]
cleanup: indent

8 years agolvconvert: show percent with %.2
Zdenek Kabelac [Tue, 5 Apr 2016 12:51:05 +0000 (14:51 +0200)]
lvconvert: show percent with %.2

lvm2 shows percent values with 2 decimal digits elsewhere so use
it consistently also for this output.

8 years agolibdm: improve debug message with ioctl
Zdenek Kabelac [Tue, 5 Apr 2016 12:59:59 +0000 (14:59 +0200)]
libdm: improve debug message with ioctl

Make the debug message a less difficult to read:
Ioctl shows  [ noopencount flush ] instead of cryptic [NF].

8 years agopreload: preserve flushing state
Zdenek Kabelac [Wed, 6 Apr 2016 08:29:57 +0000 (10:29 +0200)]
preload: preserve flushing state

When leaving preload routine it should not altet state of flush required
when it's been already set to 1 and drop it to 0.

The API here is unclean, but current usage expects the same
variable pointer is for all preload calls and combines 'flush_required'
across all of them.

8 years agosuspend: fix suspend with noflush limitation
Zdenek Kabelac [Wed, 6 Apr 2016 08:29:05 +0000 (10:29 +0200)]
suspend: fix suspend with noflush limitation

Commit 844b00958492224c448b30f89ae5532bb6591fd2 tried to move
limit for usage of noflush to 'preload' however this was not
correctly processed.

Intead explicitly check for which types we do not want noflush
and also add debug message in this case.

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

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