]> sourceware.org Git - lvm2.git/log
lvm2.git
5 years agopvscan systemd service for event based activation
David Teigland [Mon, 26 Nov 2018 18:49:39 +0000 (12:49 -0600)]
pvscan systemd service for event based activation

The pvscan systemd service for autoactivation was
mistakenly dropped along with the lvmetad related
services.

The activation generator program now looks at the new
lvm.conf setting "event_activation" (default 1) to
switch between event activation and direct activation.

Previously, the old use_lvmetad setting was used to
switch between event and direct activation.

5 years agowritecache: set block_size using --cachesettings
David Teigland [Wed, 21 Nov 2018 21:16:23 +0000 (15:16 -0600)]
writecache: set block_size using --cachesettings

instead of a separate --writecacheblocksize option.
writecache block_size is not technically a setting,
but it can borrow the option as a special case.

5 years agoWHATS_NEW: sync io
David Teigland [Tue, 20 Nov 2018 15:20:28 +0000 (09:20 -0600)]
WHATS_NEW: sync io

5 years agobcache: sync io fixes
David Teigland [Fri, 16 Nov 2018 19:09:29 +0000 (13:09 -0600)]
bcache: sync io fixes

fix lseek error check
fix read/write error checks
handle zero return from read and write
don't return an error for short io
fix partial read/write loop

5 years agoio: use sync io if aio fails
David Teigland [Fri, 16 Nov 2018 18:21:20 +0000 (12:21 -0600)]
io: use sync io if aio fails

io_setup() for aio may fail if a system has reached the
aio request limit.  In this case, fall back to using
sync io.  Also, lvm use of aio can be disabled entirely
with config setting global/use_aio=0.

The system limit for aio requests can be seen from
  /proc/sys/fs/aio-max-nr

The current usage of aio requests can be seen from
  /proc/sys/fs/aio-nr

The system limit for aio requests can be increased by
setting fs.aio-max-nr using sysctl.

Also add last-byte limit to the sync io code.

5 years agotests: update required raid target
Zdenek Kabelac [Mon, 19 Nov 2018 17:06:39 +0000 (18:06 +0100)]
tests: update required raid target

For embeded reshaping operation require higher driver version.
(otherwise we get:

Converting vg/LV1 from raid6 (same as raid6_zr) is directly possible to the following layouts:
 raid6_nc
 raid6_nr
 raid6_la_6
 raid6_ls_6
 raid6_ra_6
 raid6_rs_6
 raid6_n_6

5 years agotests: missing copyright
Zdenek Kabelac [Mon, 19 Nov 2018 16:16:36 +0000 (17:16 +0100)]
tests: missing copyright

5 years agosanlock: update headers
Zdenek Kabelac [Mon, 19 Nov 2018 15:55:11 +0000 (16:55 +0100)]
sanlock: update headers

5 years agotests: generate slightly less volumes
Zdenek Kabelac [Mon, 19 Nov 2018 12:39:39 +0000 (13:39 +0100)]
tests: generate slightly less volumes

5 years agotests: speed-up testing full of lvm2 metadata
Zdenek Kabelac [Mon, 19 Nov 2018 12:15:05 +0000 (13:15 +0100)]
tests: speed-up testing full of lvm2 metadata

Generate faster full metadata condition.

FIXME: vgremove is extremaly slow with larger set of LVs.

5 years agotests: update parm for new kernel
Zdenek Kabelac [Sun, 18 Nov 2018 21:04:00 +0000 (22:04 +0100)]
tests: update parm for new kernel

5 years agotests: skip part of test
Zdenek Kabelac [Sun, 18 Nov 2018 21:01:27 +0000 (22:01 +0100)]
tests: skip part of test

On kernel 4.8 this test piece oopses machine (fc23).

5 years agotests: create whole path with mkdir
Zdenek Kabelac [Sun, 18 Nov 2018 20:42:27 +0000 (21:42 +0100)]
tests: create whole path with mkdir

Create also 'lvm' upper this if such one is missing in /run dir
and use '-p' with mkdir.

5 years agotests: skip portion of test for lvmpolld
Zdenek Kabelac [Sun, 18 Nov 2018 20:38:56 +0000 (21:38 +0100)]
tests: skip portion of test for lvmpolld

lvmpolld ATM is not desingned to preserve interval checking
in the same way the 'lvconvert' tool is doing - so the passed
'-i 40' is not respected and lvmpolld autonomously checks
state of conversion and updates lvm2 metadata and dm tables
when needed.

So skip portion of test that relayed on this and preserve this logic
only for command line invocation and forking of polling process
where the interval of checking is under full control.

5 years agotests: skip when gcore from gdb package is missing
Zdenek Kabelac [Sun, 18 Nov 2018 20:37:00 +0000 (21:37 +0100)]
tests: skip when gcore from gdb package is missing

gcore is needed for gathering all userspace mappings.

5 years agotests: prefer internal header
Zdenek Kabelac [Sat, 17 Nov 2018 00:38:39 +0000 (01:38 +0100)]
tests: prefer internal header

Although we primarily want to check externally used libdevmapper
library,   out internal  all.h is still keeping all symbols
as the original library has - so for simpler compilation keep
using this private copy for defining needed symbols.

5 years agotests: correcting header file enclosure
Zdenek Kabelac [Sat, 17 Nov 2018 00:11:13 +0000 (01:11 +0100)]
tests: correcting header file enclosure

Use "" for internal header file.

5 years agotests: still more libs needs
Zdenek Kabelac [Sat, 17 Nov 2018 00:00:06 +0000 (01:00 +0100)]
tests: still more libs needs

5 years agotests: makefile fixes
Zdenek Kabelac [Fri, 16 Nov 2018 23:52:19 +0000 (00:52 +0100)]
tests: makefile fixes

New tests needs more options and libs.

5 years agotests: drop unwanted backup
Zdenek Kabelac [Mon, 12 Nov 2018 16:57:40 +0000 (17:57 +0100)]
tests: drop unwanted backup

5 years agotests: raise minsize of xfs
Zdenek Kabelac [Tue, 13 Nov 2018 15:27:33 +0000 (16:27 +0100)]
tests: raise minsize of xfs

mkfs.xfs now needs at least ~1600...

5 years agotests: extend
Zdenek Kabelac [Fri, 16 Nov 2018 15:01:39 +0000 (16:01 +0100)]
tests: extend

5 years agotests: secure data erase
Zdenek Kabelac [Fri, 16 Nov 2018 21:15:23 +0000 (22:15 +0100)]
tests: secure data erase

5 years agolibdm: add memory barrier
Zdenek Kabelac [Fri, 16 Nov 2018 15:01:03 +0000 (16:01 +0100)]
libdm: add memory barrier

Just for case ensure compiler is not able to optimize
memset() away for resources that are released.

This idea of using memory barrier is taken from openssl.

Other options would be to check for 'explicit_bzero' function.

5 years agolibdm: print params only for ioctls using them
Zdenek Kabelac [Fri, 16 Nov 2018 14:57:15 +0000 (15:57 +0100)]
libdm: print params only for ioctls using them

When preparing ioctl buffer and flatting all parameters,
add table parameters only to ioctl that do process them.

Note: list of ioctl should be kept in sync with kernel code.

5 years agolibdm: add DM_DEVICE_ARM_POLL
Zdenek Kabelac [Fri, 16 Nov 2018 14:58:16 +0000 (15:58 +0100)]
libdm: add DM_DEVICE_ARM_POLL

Expose DM_DEVICE_ARM_POLL via standard API enum.

5 years agolibdm: do not add params for resume and remove
Zdenek Kabelac [Fri, 16 Nov 2018 14:54:09 +0000 (15:54 +0100)]
libdm: do not add params for resume and remove

DM_DEVICE_CREATE with table is doing several ioctl operations,
however only some of then takes parameters.
Since _create_and_load_v4() reused already existing dm task from
DM_DEVICE_RELOAD it has also kept passing its table parameters
to DM_DEVICE_RESUME ioctl - but this ioctl is supposed to not take
any argument and thus there is no wiping of passed data - and
since kernel returns buffer and shortens dmi->data_size accordingly,
anything past returned data size remained uncleared in zfree()
function.

This has problem if the user used dm_task_secure_data (i.e. cryptsetup),
as in this case binary expact secured data are erased from main memory
after use, but they may have been left in place.

This patch is also closing the possible hole for error path,
which also reuse same dm task structure for DM_DEVICE_REMOVE.

5 years agoscripts: remove lvmetad from makefile
David Teigland [Thu, 15 Nov 2018 15:25:55 +0000 (09:25 -0600)]
scripts: remove lvmetad from makefile

5 years agolvm2-monitoring service shouldn't refer to lvmetad
David Teigland [Thu, 15 Nov 2018 15:20:47 +0000 (09:20 -0600)]
lvm2-monitoring service shouldn't refer to lvmetad

5 years agoman: remove some clvmd references
David Teigland [Wed, 14 Nov 2018 16:00:23 +0000 (10:00 -0600)]
man: remove some clvmd references

5 years agoman: remove scattered lvmetad references
David Teigland [Wed, 14 Nov 2018 15:39:42 +0000 (09:39 -0600)]
man: remove scattered lvmetad references

5 years agoremove unused backgroundfork option
David Teigland [Wed, 14 Nov 2018 15:34:49 +0000 (09:34 -0600)]
remove unused backgroundfork option

5 years agoman: pvscan updates
David Teigland [Wed, 14 Nov 2018 15:34:30 +0000 (09:34 -0600)]
man: pvscan updates

5 years agopvscan: background option is not used
David Teigland [Tue, 13 Nov 2018 23:27:53 +0000 (17:27 -0600)]
pvscan: background option is not used

Move this into the list of ignored options so
it doesn't appear in the man page.

5 years agoman pvscan: replace lvmetad text
David Teigland [Tue, 13 Nov 2018 23:23:32 +0000 (17:23 -0600)]
man pvscan: replace lvmetad text

5 years agoman: remove lvmetad
David Teigland [Tue, 13 Nov 2018 22:22:34 +0000 (16:22 -0600)]
man: remove lvmetad

5 years agoman lvmdump: remove clvm reference
David Teigland [Tue, 13 Nov 2018 22:20:02 +0000 (16:20 -0600)]
man lvmdump: remove clvm reference

5 years agoman: remove clvmd man page
David Teigland [Tue, 13 Nov 2018 22:17:17 +0000 (16:17 -0600)]
man: remove clvmd man page

5 years agoman: remove cluster references
David Teigland [Tue, 13 Nov 2018 22:15:41 +0000 (16:15 -0600)]
man: remove cluster references

5 years agotests: add wait loop
Zdenek Kabelac [Mon, 12 Nov 2018 14:28:45 +0000 (15:28 +0100)]
tests: add wait loop

Add a little wait loop - since lvconvert started background process
and we need to wait till this bg task initiate its work -
adding ~1s loop should give reasonable enough time to start mirroring.

5 years agodevicemapper: retry mirror leg deactivation
Zdenek Kabelac [Mon, 12 Nov 2018 14:22:44 +0000 (15:22 +0100)]
devicemapper: retry mirror leg deactivation

This could be seen as continuation of
6cee8f1b063dcf5d809e14de38ba489ce5b8f562.
Some test maching with old udev system shows problem,
where udev 'jumps on' leg device after mirror target
releases its legs -  since udev does not (in this old case) skips
such device from scanning - it opens device - and this prevent
leg device to be deactivated - effectively such device stays
'leaked' in DM table invisibly to lvm2 command.

So to 'combat' this issue - if the device has '_mimage' in its name,
the retry of deactivation is automatically assumed.

NOTE: wider impact is unexpected - as it's touching only old mirror
target which is nowadays replaced with 'raid'.

In case there will be some problem identified - probably both patches
should be reverted.

5 years agoman: lvmcache update
David Teigland [Tue, 6 Nov 2018 22:14:59 +0000 (16:14 -0600)]
man: lvmcache update

for cache changes including writecache

5 years agotests: specify m1 for raid1 in cache-single-types
David Teigland [Thu, 8 Nov 2018 20:08:41 +0000 (14:08 -0600)]
tests: specify m1 for raid1 in cache-single-types

5 years agotests: futher test tunning
Zdenek Kabelac [Thu, 8 Nov 2018 16:19:39 +0000 (17:19 +0100)]
tests: futher test tunning

5 years agotests: add lvchange cachemode passthrough in cache-single-options
David Teigland [Thu, 8 Nov 2018 16:08:38 +0000 (10:08 -0600)]
tests: add lvchange cachemode passthrough in cache-single-options

5 years agotests: enable cachepolicy cleaner in cache-single-options
David Teigland [Thu, 8 Nov 2018 15:43:23 +0000 (09:43 -0600)]
tests: enable cachepolicy cleaner in cache-single-options

5 years agotests: enable writeback in cache-single-options
David Teigland [Thu, 8 Nov 2018 15:40:41 +0000 (09:40 -0600)]
tests: enable writeback in cache-single-options

5 years agotests: fix dd option in cache-single-options
David Teigland [Thu, 8 Nov 2018 15:33:09 +0000 (09:33 -0600)]
tests: fix dd option in cache-single-options

5 years agotests: updates
Zdenek Kabelac [Thu, 8 Nov 2018 09:21:13 +0000 (10:21 +0100)]
tests: updates

5 years agotests: keep results configurable
Zdenek Kabelac [Thu, 8 Nov 2018 09:01:21 +0000 (10:01 +0100)]
tests: keep results configurable

5 years agoconfigure: update
Zdenek Kabelac [Thu, 8 Nov 2018 11:22:07 +0000 (12:22 +0100)]
configure: update

5 years agodevicemapper: retry remove even for subLVs
Zdenek Kabelac [Thu, 8 Nov 2018 11:12:58 +0000 (12:12 +0100)]
devicemapper: retry remove even for subLVs

With older systems and udevs we don't have control over scanning of lvm2
internal devices - so far we set retry-removal only for top-level LVs,
but in occasional cases udev can be 'fast enough' to open device for
scanning and prevent removal of such device from DM table.

So to combat this case - try to pass 'retry' flag also for removal of
internal device so see how many races can go away with this simple
patch.

Note: patch is applied only to internal version of libdm so the external
API remains working in the old way for now.

5 years agoactivation: trimming string is expected
Zdenek Kabelac [Thu, 8 Nov 2018 09:02:28 +0000 (10:02 +0100)]
activation: trimming string is expected

Commit 813347cf84617a946d9184f44c5fbd275bb41766 added extra validation,
however in this particular we do want to trim suffix out so rather ignore
resulting error code here intentionaly.

5 years agodevices: reuse bcache fd when getting block size
David Teigland [Tue, 6 Nov 2018 22:03:17 +0000 (16:03 -0600)]
devices: reuse bcache fd when getting block size

This avoids an unnecessary open() on the device.

5 years agoAdd dm-writecache support
David Teigland [Mon, 27 Aug 2018 19:53:09 +0000 (14:53 -0500)]
Add dm-writecache support

dm-writecache is used like dm-cache with a standard LV
as the cache.

$ lvcreate -n main -L 128M -an foo /dev/loop0

$ lvcreate -n fast -L 32M -an foo /dev/pmem0

$ lvconvert --type writecache --cachepool fast foo/main

$ lvs -a foo -o+devices
  LV            VG  Attr       LSize   Origin        Devices
  [fast]        foo -wi-------  32.00m               /dev/pmem0(0)
  main          foo Cwi------- 128.00m [main_wcorig] main_wcorig(0)
  [main_wcorig] foo -wi------- 128.00m               /dev/loop0(0)

$ lvchange -ay foo/main

$ dmsetup table
foo-main_wcorig: 0 262144 linear 7:0 2048
foo-main: 0 262144 writecache p 253:4 253:3 4096 0
foo-fast: 0 65536 linear 259:0 2048

$ lvchange -an foo/main

$ lvconvert --splitcache foo/main

$ lvs -a foo -o+devices
  LV   VG  Attr       LSize   Devices
  fast foo -wi-------  32.00m /dev/pmem0(0)
  main foo -wi------- 128.00m /dev/loop0(0)

5 years agoAllow dm-cache cache device to be standard LV
David Teigland [Fri, 17 Aug 2018 20:45:52 +0000 (15:45 -0500)]
Allow dm-cache cache device to be standard LV

If a single, standard LV is specified as the cache, use
it directly instead of converting it into a cache-pool
object with two separate LVs (for data and metadata).

With a single LV as the cache, lvm will use blocks at the
beginning for metadata, and the rest for data.  Separate
dm linear devices are set up to point at the metadata and
data areas of the LV.  These dm devs are given to the
dm-cache target to use.

The single LV cache cannot be resized without recreating it.

If the --poolmetadata option is used to specify an LV for
metadata, then a cache pool will be created (with separate
LVs for data and metadata.)

Usage:

$ lvcreate -n main -L 128M vg /dev/loop0

$ lvcreate -n fast -L 64M vg /dev/loop1

$ lvs -a vg
  LV   VG Attr       LSize   Type   Devices
  main vg -wi-a----- 128.00m linear /dev/loop0(0)
  fast vg -wi-a-----  64.00m linear /dev/loop1(0)

$ lvconvert --type cache --cachepool fast vg/main

$ lvs -a vg
  LV           VG Attr       LSize   Origin       Pool  Type   Devices
  [fast]       vg Cwi---C---  64.00m                     linear /dev/loop1(0)
  main         vg Cwi---C--- 128.00m [main_corig] [fast] cache  main_corig(0)
  [main_corig] vg owi---C--- 128.00m                     linear /dev/loop0(0)

$ lvchange -ay vg/main

$ dmsetup ls
vg-fast_cdata   (253:4)
vg-fast_cmeta   (253:5)
vg-main_corig   (253:6)
vg-main (253:24)
vg-fast (253:3)

$ dmsetup table
vg-fast_cdata: 0 98304 linear 253:3 32768
vg-fast_cmeta: 0 32768 linear 253:3 0
vg-main_corig: 0 262144 linear 7:0 2048
vg-main: 0 262144 cache 253:5 253:4 253:6 128 2 metadata2 writethrough mq 0
vg-fast: 0 131072 linear 7:1 2048

$ lvchange -an vg/min

$ lvconvert --splitcache vg/main

$ lvs -a vg
  LV   VG Attr       LSize   Type   Devices
  fast vg -wi-------  64.00m linear /dev/loop1(0)
  main vg -wi------- 128.00m linear /dev/loop0(0)

5 years agocache: factor lvchange_cache
David Teigland [Mon, 5 Nov 2018 22:38:08 +0000 (16:38 -0600)]
cache: factor lvchange_cache

to prepare for future addition

5 years agocache: factor report functions
David Teigland [Mon, 5 Nov 2018 22:33:34 +0000 (16:33 -0600)]
cache: factor report functions

to prepare for future addition

5 years agocache: reorganize cache_set_policy
David Teigland [Mon, 5 Nov 2018 22:14:45 +0000 (16:14 -0600)]
cache: reorganize cache_set_policy

to prepare for future addition

5 years agocache: improve error message about flush
David Teigland [Mon, 5 Nov 2018 22:10:49 +0000 (16:10 -0600)]
cache: improve error message about flush

5 years agocache: improve warning message about cached thin data
David Teigland [Mon, 5 Nov 2018 22:08:31 +0000 (16:08 -0600)]
cache: improve warning message about cached thin data

5 years agocache: rename variable in _cache_add_target_line
David Teigland [Mon, 5 Nov 2018 22:05:28 +0000 (16:05 -0600)]
cache: rename variable in _cache_add_target_line

so it is not specific to lv/seg type

5 years agocache: rename variable in _cache_display
David Teigland [Mon, 5 Nov 2018 21:56:28 +0000 (15:56 -0600)]
cache: rename variable in _cache_display

so it is not specific to lv/seg type

5 years agocache: clean up segment line creation
David Teigland [Mon, 5 Nov 2018 21:50:37 +0000 (15:50 -0600)]
cache: clean up segment line creation

5 years agocache: factor getting cache mode
David Teigland [Mon, 5 Nov 2018 21:46:07 +0000 (15:46 -0600)]
cache: factor getting cache mode

so part can be called separately

5 years agocache: factor settings text import export
David Teigland [Mon, 5 Nov 2018 21:23:23 +0000 (15:23 -0600)]
cache: factor settings text import export

Pull out the export/import of settings text so
it can be used later from elsewhere.

5 years agocache: add cache_mode_num_to_str
David Teigland [Mon, 5 Nov 2018 20:53:52 +0000 (14:53 -0600)]
cache: add cache_mode_num_to_str

Requires only string and number, no specific lv/seg type.

5 years agotests: fix shell quoting
Zdenek Kabelac [Tue, 6 Nov 2018 16:26:15 +0000 (17:26 +0100)]
tests: fix shell quoting

5 years agotests: add wait for udev
Zdenek Kabelac [Tue, 6 Nov 2018 14:01:52 +0000 (15:01 +0100)]
tests: add wait for udev

Since the test is currently directly working with live directory,
which can be getting updates from system's udev - add wait
for settling so removal of all known PVs happens after that.
But still this has major influce on behavior of running system,
so the test should never be executed on a user used box.

5 years agopvscan: add error checking for write of online files
Zdenek Kabelac [Tue, 6 Nov 2018 14:04:35 +0000 (15:04 +0100)]
pvscan: add error checking for write of online files

When there is any write failure during writting file,
report this upward as error and fail command instead
of continuing futher.

5 years agodebug: missing backtrace
Zdenek Kabelac [Fri, 2 Nov 2018 21:19:26 +0000 (22:19 +0100)]
debug: missing backtrace

5 years agodebug: tracing fclose failure
Zdenek Kabelac [Fri, 2 Nov 2018 21:00:26 +0000 (22:00 +0100)]
debug: tracing fclose failure

Using log_debug (not returning error code) to trace possible
failure of fclose().

5 years agocleanup: move cast to det_t into MKDEV macro
Zdenek Kabelac [Sat, 3 Nov 2018 16:13:10 +0000 (17:13 +0100)]
cleanup: move cast to det_t into MKDEV macro

5 years agocov: avoid unsing unchecked label_scan_open
Zdenek Kabelac [Sat, 3 Nov 2018 16:19:33 +0000 (17:19 +0100)]
cov: avoid unsing unchecked label_scan_open

Drop extra call too label_scan_open() without checking return value,
and let code go through next call bellow.

5 years agocov: remove unused assigns
Zdenek Kabelac [Sat, 3 Nov 2018 15:48:20 +0000 (16:48 +0100)]
cov: remove unused assigns

5 years agocov: hide intentionaly ptr arithmetic report
Zdenek Kabelac [Fri, 2 Nov 2018 21:29:43 +0000 (22:29 +0100)]
cov: hide intentionaly ptr arithmetic report

Only single region count is ever replaced with on-stack uint64_t.

5 years agocov: mark warning as expected one
Zdenek Kabelac [Thu, 1 Nov 2018 14:44:13 +0000 (15:44 +0100)]
cov: mark warning as expected one

5 years agocov: trace failing pthread_kill
Zdenek Kabelac [Fri, 2 Nov 2018 21:11:18 +0000 (22:11 +0100)]
cov: trace failing pthread_kill

5 years agocov: add missing check for dm_strncpy
Zdenek Kabelac [Fri, 2 Nov 2018 20:50:29 +0000 (21:50 +0100)]
cov: add missing check for dm_strncpy

5 years agocov: overflow before widen
Zdenek Kabelac [Fri, 2 Nov 2018 20:10:21 +0000 (21:10 +0100)]
cov: overflow before widen

Evaluate as 64bit arithmetic (instead of doing 32bit mults which can
in this case purely teoretically overflow).

5 years agocov: explicit ignore if failures
Zdenek Kabelac [Thu, 1 Nov 2018 14:38:30 +0000 (15:38 +0100)]
cov: explicit ignore if failures

Here we can't do anything better than just ignore syscall failures
(with silence as there is no loging mechanism)

5 years agocov: split check for type assignment
Zdenek Kabelac [Thu, 1 Nov 2018 14:33:34 +0000 (15:33 +0100)]
cov: split check for type assignment

Check that type is always defined, if not make it explicit internal
error (although logged as debug - so catched only with proper lvm.conf
setting).
This ensures later type being NULL can't be dereferenced with coredump.

5 years agocov: remove uneeded code
Zdenek Kabelac [Thu, 1 Nov 2018 14:29:05 +0000 (15:29 +0100)]
cov: remove uneeded code

Since clvmd was dropped this code become useless.

5 years agolabel: add stack trace for failing dev_set_last_byte
Zdenek Kabelac [Fri, 2 Nov 2018 21:19:47 +0000 (22:19 +0100)]
label: add stack trace for failing dev_set_last_byte

Temporarily add check for failure, but whole function
needs to be likely traced for error result.

FIXME

5 years agolvmlockd: use standard major minor functions
David Teigland [Fri, 2 Nov 2018 20:58:47 +0000 (15:58 -0500)]
lvmlockd: use standard major minor functions

5 years agolvmlockd: fix handling of sanlock release error
David Teigland [Fri, 2 Nov 2018 17:11:09 +0000 (12:11 -0500)]
lvmlockd: fix handling of sanlock release error

When sanlock_release returns an error because of an i/o
timeout releasing the lease on disk, lvmlockd should just
consider the lock released.  sanlock will continue trying
to release the lease on disk after the original request
times out.

5 years agolvmlockd: deactivate lvmlock LV in vgchange
David Teigland [Thu, 25 Oct 2018 15:51:25 +0000 (10:51 -0500)]
lvmlockd: deactivate lvmlock LV in vgchange

When changing a VG to lock_type sanlock, the internal
lvmlock LV was left active at the end of vgchange.
It shouldn't be active until lockstart.

5 years agolvmlockd: fix size/resizing of internal lvmlock LV for sanlock
David Teigland [Wed, 24 Oct 2018 16:23:40 +0000 (11:23 -0500)]
lvmlockd: fix size/resizing of internal lvmlock LV for sanlock

The lvmlock LV size was not adjusted correctly for 512 vs 4K
sector sizes which influence the lease size used by sanlock.

When lvmlock was automatically extended, the zeroing through
bcache wasn't working.

5 years agolvmlockd: use new sanlock sector/align interface
David Teigland [Mon, 22 Oct 2018 20:45:23 +0000 (15:45 -0500)]
lvmlockd: use new sanlock sector/align interface

The choice about sector size and lease align size is
now made by the sanlock user, in this case lvmlockd.
This will allow lvmlockd to use other lease sizes in
the future.  This also prevents breakage if hosts
report different sector sizes, or the sector size
reported by a device changes.

5 years agodmsetup: fix stats report command output
Bryn M. Reeves [Thu, 1 Nov 2018 16:49:05 +0000 (16:49 +0000)]
dmsetup: fix stats report command output

Since the stats handle is neither bound nor listed before the
attempt to call dm_stats_get_nr_regions(), it will always return
zero: this prevents reporting of any dmstats regions on any
device.

Remove the dm_stats_get_nr_regions() check and instead rely on
the correct return status from dm_stats_populate() which only
returns 0 in the case that there are regions to inspect (and
which logs a specific error for all other cases).

Reported-by: Bryan Gurney <bgurney@redhat.com>
5 years agolibdm-stats: move no regions warning after dm_stats_list()
Bryn M. Reeves [Thu, 1 Nov 2018 16:47:56 +0000 (16:47 +0000)]
libdm-stats: move no regions warning after dm_stats_list()

It doesn't make sense to test or warn about the region count until
the stats handle has been listed: at this point it may or may not
contain valid information (but is guaranteed to be correct after
the list).

5 years agopost-release
Marian Csontos [Wed, 31 Oct 2018 14:41:22 +0000 (15:41 +0100)]
post-release

5 years agopre-release v2_03_01
Marian Csontos [Wed, 31 Oct 2018 14:39:50 +0000 (15:39 +0100)]
pre-release

5 years agobuild: Fix CLDFLAGS default
Marian Csontos [Mon, 22 Oct 2018 10:56:34 +0000 (12:56 +0200)]
build: Fix CLDFLAGS default

5 years agometadata: prevent writing beyond metadata area
David Teigland [Mon, 29 Oct 2018 21:53:17 +0000 (16:53 -0500)]
metadata: prevent writing beyond metadata area

lvm uses a bcache block size of 128K.  A bcache block
at the end of the metadata area will overlap the PEs
from which LVs are allocated.  How much depends on
alignments.  When lvm reads and writes one of these
bcache blocks to update VG metadata, it can also be
reading and writing PEs that belong to an LV.

If these overlapping PEs are being written to by the
LV user (e.g. filesystem) at the same time that lvm
is modifying VG metadata in the overlapping bcache
block, then the user's updates to the PEs can be lost.

This patch is a quick hack to prevent lvm from writing
past the end of the metadata area.

5 years agoRevert "raid: fix left behind SubLVs"
Heinz Mauelshagen [Thu, 25 Oct 2018 12:30:32 +0000 (14:30 +0200)]
Revert "raid: fix left behind SubLVs"

This reverts commit 16ae968d24b4fe3264dc9b46063345ff2846957b.

We need to come up with a better fix, because we fall short
wiping all known signatures when not using the wipe_lv API.

5 years agoraid: fix left behind SubLVs
Heinz Mauelshagen [Wed, 24 Oct 2018 13:26:19 +0000 (15:26 +0200)]
raid: fix left behind SubLVs

lvm metadata writes, commits and activations are performed
for (newly) allocated RAID metadata SubLVs to wipe any preexisiting
data thus avoid false raid superblock positives on RaidLV activation.

This process can be interrupted by command or system crashs
thus leaving stale SubLVs in the lvm metadata as a problem.

Because we hold an exclusive lock in this metadata SubLV wiping
process, we can address this problem by avoiding aforementioned
commits/writes/activations altogether wiping the respective first
sector of the first physical extent allocated to any metadata SubLV
directly via the existing dev_set() API.

Succeeds all LVM RAID tests.

Related: rhbz1633167

5 years agospec: lvmdbusd requires python3 setuptools
Marian Csontos [Mon, 22 Oct 2018 10:51:51 +0000 (12:51 +0200)]
spec: lvmdbusd requires python3 setuptools

5 years agotests: add new test for lvm on md devices
David Teigland [Thu, 18 Oct 2018 18:06:42 +0000 (13:06 -0500)]
tests: add new test for lvm on md devices

6 years agotests: missed char in list
Zdenek Kabelac [Wed, 17 Oct 2018 08:41:25 +0000 (10:41 +0200)]
tests: missed char in list

'=' also doesn't belong to property name.

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