]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agoraid: cleanup raid4/5/6/10 validation check
Heinz Mauelshagen [Mon, 9 Oct 2017 14:13:45 +0000 (16:13 +0200)]
raid: cleanup raid4/5/6/10 validation check

7 years agoraid: fix validation check for raid0 segment data_offset member
Heinz Mauelshagen [Mon, 9 Oct 2017 13:21:51 +0000 (15:21 +0200)]
raid: fix validation check for raid0 segment data_offset member

Commit 2f754b73ffdaa95af4a6d703e31b76d4efbf7a36 missed one.

7 years agolvcreate: fix region size on striped RaidLVs
Heinz Mauelshagen [Mon, 9 Oct 2017 12:34:10 +0000 (14:34 +0200)]
lvcreate: fix region size on striped RaidLVs

Creating striped RaidLVs with lv size not divisible by region size
caused the region size to be adjusted:

# lvcreate   --type raid5 -n region_check.32.00m_3 -i 3 -L 1g --nosync -R 32.00m raid_sanity
  Using default stripesize 64.00 KiB.
  Rounding size 1.00 GiB (256 extents) up to stripe boundary size <1.01 GiB(258 extents).
  WARNING: New raid5 won't be synchronised. Don't read what you didn't write!
  Using reduced mirror region size of 8.00 MiB
  Logical volume region_check.32.00m_3 created.

Fix by not imposing "mirror" constraints on "raid".

Resolves: rhbz1404007

7 years agoraid: fix validation checks for segment data_offset member
Heinz Mauelshagen [Mon, 9 Oct 2017 12:00:46 +0000 (14:00 +0200)]
raid: fix validation checks for segment data_offset member

Commit 222e1e3acee399b0acf31565f784716d67c465a8 was not
valuing special case of data_ofset member equal to 1.

7 years agoraid: return previous reshape space allocation properly
Heinz Mauelshagen [Mon, 9 Oct 2017 11:53:27 +0000 (13:53 +0200)]
raid: return previous reshape space allocation properly

Fix returning previous allocation of reshape space.

7 years agoman: regenerate
Alasdair G Kergon [Fri, 6 Oct 2017 22:10:02 +0000 (23:10 +0100)]
man: regenerate

7 years agopost-release
Alasdair G Kergon [Fri, 6 Oct 2017 21:16:58 +0000 (22:16 +0100)]
post-release

7 years agopre-release v2_02_175
Alasdair G Kergon [Fri, 6 Oct 2017 21:10:48 +0000 (22:10 +0100)]
pre-release

7 years agovgmerge: Fix intermediate metadata corruption
Alasdair G Kergon [Fri, 6 Oct 2017 01:12:42 +0000 (02:12 +0100)]
vgmerge: Fix intermediate metadata corruption

vgmerge suffers from a similar problem to the one fixed in commit
8146548d25e9104f0d530d943290d448c1994c0a ("vgsplit: Fix intermediate
metadata corruption.")

When merging, splitting or renaming VGs, use a new PV status flag
PV_MOVED_VG to mark the PVs that hold metadata with the old VG name and
use this to provide PV-level granularity instead of incorrectly assuming
all PVs in the VG are the same.

7 years agodmeventd: ensure systemd service gets stopped on shutdown
Thomas Lamprecht [Thu, 5 Oct 2017 10:52:15 +0000 (12:52 +0200)]
dmeventd: ensure systemd service gets stopped on shutdown

Add these for dmeventd systemd unit (dm-event.service):

  Before: shutdown.target
  Conflicts: shutdown.target

This will cause the dmeventd to be properly stopped at shutdown (after
all the dmeventd clients unregistered their devices from monitoring)
with dm-event.service's stop action (there's no direct action defined
for the "stop" so systemd sends SIGTERM instead).

Before, we let dmeventd to get killed only as part of the very last
SIGTERM/SIGKILL for all the remaining processes late in the shutdown
sequence so we may have missed some logs if dmeventd encountered an
error during its shutdown (logging facilities are already off at this
late time in shutdown sequence).

Ref: https://www.redhat.com/archives/lvm-devel/2017-October/msg00000.html

7 years agofsadm: add --help
Zdenek Kabelac [Thu, 5 Oct 2017 08:16:20 +0000 (10:16 +0200)]
fsadm: add --help

Newer version of blockdev tool needs --help as the tool is no longer
printing help without this option like it used to in past.

7 years agodmeventd: schedule exit on break
Zdenek Kabelac [Wed, 4 Oct 2017 11:58:21 +0000 (13:58 +0200)]
dmeventd: schedule exit on break

When dmeventd receives SIGTERM/INT/HUP/QUIT it validates if exit is possible.
If there was any device still monitored, such exit request used to
be ignored/refused. This 'usually' worked reasonably well, however if there
is very short time period between last device is unmonitored and signal
reception - there was possibility such EXIT was ignored, as dmeventd has
not yet got into idle state even commands like 'vgchange -an' has already
finished.

This patch changes logic towards scheduling EXIT to the nearest
point when there is no monitored device.

EXIT is never forgotten.

NOTE: if there is only a single monitored device and someone sends
SIGTERM and later someone uses i.e. 'lvchange --refresh' after
unmonitoring dmeventd will exit and new instance needs to be
started.

7 years agoraid: enhance conversion rejection message
Heinz Mauelshagen [Wed, 4 Oct 2017 15:05:59 +0000 (17:05 +0200)]
raid: enhance conversion rejection message

Related: rhbz1439399

7 years agolvmdbusd: thread stacks dump support
Tony Asleson [Mon, 25 Sep 2017 20:20:03 +0000 (15:20 -0500)]
lvmdbusd: thread stacks dump support

If you send a SIGUSR1 (10) to the daemon it will dump all the
threads current stacks to stdout.  This will be useful when the
daemon is apparently hung and not processing requests.

eg.
$ sudo kill -10 <daemon pid>

7 years agolvmdbusd: Give threads names
Tony Asleson [Mon, 25 Sep 2017 20:18:43 +0000 (15:18 -0500)]
lvmdbusd: Give threads names

This will allow easier debug.

7 years agolvmdbusd: Main thread exception logging
Tony Asleson [Fri, 22 Sep 2017 14:59:50 +0000 (09:59 -0500)]
lvmdbusd: Main thread exception logging

Make sure that any and all code that executes in the main thread is
wrapped with a try/except block to ensure that at the very least
we log when things are going wrong.

7 years agopvmove: Change error message
Marian Csontos [Wed, 27 Sep 2017 11:20:25 +0000 (13:20 +0200)]
pvmove: Change error message

Change error message to match previously used one used by tests.

7 years agovgsplit: Fix intermediate metadata corruption.
Alasdair G Kergon [Fri, 22 Sep 2017 17:02:58 +0000 (18:02 +0100)]
vgsplit: Fix intermediate metadata corruption.

Changing the VG of a PV uses the same on-disk mechanism as vgrename.
This relies on recognising both the old and new VG names.  Prior to this
patch the vgsplit code incorrectly provided the new VG name twice
instead of the old and new ones.  This lead the low-level mechanism not
to recognise the device as already belonging to a VG and so paying no
attention to the location of its existing metadata, sometimes partly
overwriting it and then later trying to read the corrupt metadata and
issuing a checksum error.

7 years agoblkdeactivate: cleanup
Peter Rajnoha [Fri, 22 Sep 2017 09:10:57 +0000 (11:10 +0200)]
blkdeactivate: cleanup

Use a different variable for translated name in dm/md_deactivate fn
Fix dmraidoption/dmraidoptions in man page.

7 years agolvmdbusd: Improve args comparison
Tony Asleson [Thu, 21 Sep 2017 14:22:07 +0000 (09:22 -0500)]
lvmdbusd: Improve args comparison

7 years agolvmdbusd: Ensure vg_uuid is present
Tony Asleson [Wed, 20 Sep 2017 21:39:35 +0000 (16:39 -0500)]
lvmdbusd: Ensure vg_uuid is present

In some cases we are seeing where there are no VGs, but the data returned from
lvm shows that the PVs have the following for the VG:

"vg_name":"[unknown]", "vg_uuid":""

The code was only checking for the exitence of the VG name and we called into
the function get_object_path_by_uuid_lvm_id which requires both the VG name and
the LV name to exist (asserts this) which results in the following stack trace:

Traceback (most recent call last):
  File "/home/tasleson/lvm2/daemons/lvmdbusd/utils.py", line 563, in runner
    obj._run()
  File "/home/tasleson/lvm2/daemons/lvmdbusd/utils.py", line 584, in _run
    self.rc = self.f(*self.args)
  File "/home/tasleson/lvm2/daemons/lvmdbusd/fetch.py", line 26, in
_main_thread_load
    cache_refresh=False)[1]
  File "/home/tasleson/lvm2/daemons/lvmdbusd/pv.py", line 48, in load_pvs
    emit_signal, cache_refresh)
  File "/home/tasleson/lvm2/daemons/lvmdbusd/loader.py", line 37, in common
    objects = retrieve(search_keys, cache_refresh=False)
  File "/home/tasleson/lvm2/daemons/lvmdbusd/pv.py", line 40, in
pvs_state_retrieve
    p["pv_attr"], p["pv_tags"], p["vg_name"], p["vg_uuid"]))
  File "/home/tasleson/lvm2/daemons/lvmdbusd/pv.py", line 84, in __init__
    vg_uuid, vg_name, vg_obj_path_generate)
  File "/home/tasleson/lvm2/daemons/lvmdbusd/objectmanager.py", line 318,
in get_object_path_by_uuid_lvm_id
    assert uuid
AssertionError

7 years agolvmdbusd: Fix hang in MThreadRunner
Tony Asleson [Wed, 20 Sep 2017 20:46:16 +0000 (15:46 -0500)]
lvmdbusd: Fix hang in MThreadRunner

When executing in the main thread, if we encounter an exception we
will bypass the notify_all call on the condition and the calling thread
never wakes up.

@staticmethod
    def runner(obj):
        # noinspection PyProtectedMember
Exception thrown here
 ----> obj._run()
So the following code doesn't run, which causes calling thread to hang
with obj.cond:
            obj.function_complete = True
            obj.cond.notify_all()

Additionally for some unknown reason the stderr is lost.
Best guess is it's something to do with scheduling a python function
into the GLib.idle_add.  That made finding issue quite difficult.

7 years agoblkdeactivate: also try to unmount /boot on blkdeactivate -u if on top of supported...
Peter Rajnoha [Thu, 21 Sep 2017 13:23:24 +0000 (15:23 +0200)]
blkdeactivate: also try to unmount /boot on blkdeactivate -u if on top of supported device

There's nothing special about /boot other than it's used during boot.
But when blkdeactivate is called either on all devices or including a
device where the /boot is on top, we should also include this mount
point when doing unmount before deactivation of supported devices.

7 years agoblk-availability: use blkdeactivate -r wait in blk-availability systemd service/inits...
Peter Rajnoha [Thu, 21 Sep 2017 13:10:23 +0000 (15:10 +0200)]
blk-availability: use blkdeactivate -r wait in blk-availability systemd service/initscript

7 years agoblkdeactivate: add blkdeactivate -r wait option to wait for MD resync/recovery/reshape
Peter Rajnoha [Thu, 21 Sep 2017 13:04:45 +0000 (15:04 +0200)]
blkdeactivate: add blkdeactivate -r wait option to wait for MD resync/recovery/reshape

The new blkdeactivate -r|mdraidoption wait causes blkdeactivate to wait
for any resync/recovery/reshape that is currently in progress before
deactivating the device.

If this option is used, blkdeactivate calls mdadm -W|--wait before
mdadm -S|--stop.

7 years agoblkdeactivate: fix blkdeactivate regression with failing DM/MD devs deactivation
Peter Rajnoha [Thu, 21 Sep 2017 11:39:52 +0000 (13:39 +0200)]
blkdeactivate: fix blkdeactivate regression with failing DM/MD devs deactivation

Revert dc50f2f4a03dd50c5e2411a258095484555421e9.

We're canonicalizing/escaping the names here and we're reusing the
variable name so the code doesn't need to use extra variables and
further assignments that may confuse us. Let's keep the code simple.

The

   local name=(...$name)

is not the same as

   local name
   name=(...$name)

(I know various code-checking tools fuss about this and recommend
the 2nd way, but let's ignore those tools' nitpicking here please.)

7 years agoblkdeactivate: fix --{dm,lvm,mpath}options option name recognition
Peter Rajnoha [Thu, 21 Sep 2017 15:03:42 +0000 (17:03 +0200)]
blkdeactivate: fix --{dm,lvm,mpath}options option name recognition

There was a typo in blkdeactivate --dmoption/--lvmoption/mpathoption,
it had missing "s" at the end and it was not recognized properly, only
short names for the options (-d/-l/-m).

7 years agoimprove error messages when command rules fail
David Teigland [Wed, 20 Sep 2017 15:51:52 +0000 (10:51 -0500)]
improve error messages when command rules fail

When certain cmd def RULE's fail, the error messages can
sometimes be confusing.  This expands the error messages
to help clarify why the rule failed, especially in cases
where options are used incorrectly.

7 years agopvmove: require LV name in a shared VG
David Teigland [Tue, 19 Sep 2017 18:08:41 +0000 (13:08 -0500)]
pvmove: require LV name in a shared VG

In a shared VG, only allow pvmove with a named LV,
so that only PE's used by the LV will be moved.
The LV is then activated exclusively, ensuring that
the PE's being moved are not used from another host.

Previously, pvmove was mistakenly allowed on a full PV.
This won't work when LVs using that PV are active on
other hosts.

7 years agolvmlockd: activate mirror LVs in shared mode with cmirrord
David Teigland [Tue, 19 Sep 2017 16:52:36 +0000 (11:52 -0500)]
lvmlockd: activate mirror LVs in shared mode with cmirrord

Previously lvmlockd disallowed mirror LVs to be activated
in shared mode.

7 years agotests: use portable df output
Zdenek Kabelac [Wed, 20 Sep 2017 13:34:02 +0000 (15:34 +0200)]
tests: use portable df output

For awk parsing more 'predictable' format of output line is needed.

7 years agotests: repair of cachepool
Zdenek Kabelac [Wed, 20 Sep 2017 10:28:39 +0000 (12:28 +0200)]
tests: repair of cachepool

7 years agotests: check for free space in test dir
Zdenek Kabelac [Mon, 11 Sep 2017 12:33:07 +0000 (14:33 +0200)]
tests: check for free space in test dir

Avoid starting test, when test dir has less then 50M of free space.
Better to crash early before letting die machine on weird crash
in OOM cases...

Also show free disk space when test starts

7 years agolibdm: fix parentheses in assignment + comparison
Zdenek Kabelac [Wed, 20 Sep 2017 12:21:38 +0000 (14:21 +0200)]
libdm: fix parentheses in assignment + comparison

As reported, fix incorrect placement of parentheses.
TODO: add testing code.

7 years agolvconvert: support repair of cache/cachepool
Zdenek Kabelac [Mon, 18 Sep 2017 09:33:47 +0000 (11:33 +0200)]
lvconvert: support repair of cache/cachepool

Extend repair for cache and cachepool target
and user 'lvconvert_repair' routine name.

7 years agolvconvert: repair supports poometadatespare switch
Zdenek Kabelac [Wed, 13 Sep 2017 09:48:15 +0000 (11:48 +0200)]
lvconvert: repair supports poometadatespare switch

Enable handling of  --poolmetadataspare so if user can prevent
creation of _pmspare volume during --repair operation (just
like during actual lvcreate or lvconvert) for pool volumes.

7 years agoconfigure: Add warning for D-Bus w/o notifications
Marian Csontos [Wed, 20 Sep 2017 08:25:29 +0000 (10:25 +0200)]
configure: Add warning for D-Bus w/o notifications

Building D-Bus support without notifications is not recommended.

7 years agoconfigure: Update configure
Marian Csontos [Wed, 20 Sep 2017 08:13:39 +0000 (10:13 +0200)]
configure: Update configure

7 years agoliblvm: Add deprecation warning to configure
Marian Csontos [Wed, 20 Sep 2017 08:00:59 +0000 (10:00 +0200)]
liblvm: Add deprecation warning to configure

7 years agoliblvm: Deprecate library and bindings
Marian Csontos [Tue, 19 Sep 2017 13:17:01 +0000 (15:17 +0200)]
liblvm: Deprecate library and bindings

It is recommended to use D-Bus API instead of liblvm2app or python
bindings.

7 years agotoollib: fix parentheses in assignment + comparison
David Teigland [Tue, 19 Sep 2017 14:19:24 +0000 (09:19 -0500)]
toollib: fix parentheses in assignment + comparison

7 years agoman pvscan: just write --activate in description
David Teigland [Mon, 18 Sep 2017 15:56:39 +0000 (10:56 -0500)]
man pvscan: just write --activate in description

rather than -a|--activate, because web pages on
man7.org are not printing the | character.

7 years agodmsetup: Process -S to filter input device lists.
Alasdair G Kergon [Thu, 14 Sep 2017 22:41:17 +0000 (23:41 +0100)]
dmsetup: Process -S to filter input device lists.

The following commands now pass the device list through a
--select|-S filter before processing:

suspend resume clear wipe_table remove deps status table

7 years agolvcreate: use cmd defs to deny unspported lockd cases
David Teigland [Thu, 14 Sep 2017 17:20:29 +0000 (12:20 -0500)]
lvcreate: use cmd defs to deny unspported lockd cases

In a shared VG, lvconvert must be used to create thin pools
and cache pools, not the lvcreate variants of those commands.
Deny these cases early in lvcreate using the new command defs.
Denying these cases deeper in the code was missing some
cleanup of the partially completed command.

7 years agorevert tidy: prefer not using else after return
David Teigland [Thu, 14 Sep 2017 17:15:59 +0000 (12:15 -0500)]
revert tidy: prefer not using else after return

Revert the lvmlockd.c changes from:
  commit 0bf836aa14f98eb83969a6e81695a024f56a5eb5
  "tidy: prefer not using else after return"

The commit introduced at least one regression, which broke
lvcreate of a thin pool in a shared VG.

7 years agokernel: Refresh dm-ioctl.h
Alasdair G Kergon [Thu, 14 Sep 2017 16:50:56 +0000 (17:50 +0100)]
kernel: Refresh dm-ioctl.h

Adds DM_DEV_ARM_POLL

7 years agopost-release v2_02_174
Alasdair G Kergon [Wed, 13 Sep 2017 19:46:25 +0000 (20:46 +0100)]
post-release

7 years agopre-release
Alasdair G Kergon [Wed, 13 Sep 2017 19:38:29 +0000 (20:38 +0100)]
pre-release

7 years agoREADME: Include new github links
Alasdair G Kergon [Wed, 13 Sep 2017 19:20:04 +0000 (20:20 +0100)]
README: Include new github links

We've decided to mirror the upstream code onto github for the
convenience of people already using that platform.

7 years agodeamonize: restore detection of errors
Zdenek Kabelac [Wed, 6 Sep 2017 09:47:53 +0000 (11:47 +0200)]
deamonize: restore detection of errors

Keep forked environment for daemon more strick and check even
for nearly impossible to happen errors.

7 years agolvmlockd: always disallow mirror splitting
David Teigland [Tue, 5 Sep 2017 15:26:58 +0000 (10:26 -0500)]
lvmlockd: always disallow mirror splitting

lv_raid_split() was correctly prevented in a shared VG,
but lv_raid_split_and_track() was missing that check.

7 years agolvmlockd: fix check for no running lock manager
David Teigland [Tue, 29 Aug 2017 20:18:12 +0000 (15:18 -0500)]
lvmlockd: fix check for no running lock manager

In some cases it was reporting there was no running
lock manager when there is.

7 years agolvmlockd: print error about starting lock manager
David Teigland [Mon, 28 Aug 2017 21:24:00 +0000 (16:24 -0500)]
lvmlockd: print error about starting lock manager

In the case where lvmlockd is running, but no lock manager
is running, we should print a specific error message about
that situation.

7 years agocleanup: easier to read code
Zdenek Kabelac [Fri, 25 Aug 2017 09:53:26 +0000 (11:53 +0200)]
cleanup: easier to read code

Split into lines for better reading.

7 years agodmsetup: validate strtol reading
Zdenek Kabelac [Fri, 25 Aug 2017 09:48:17 +0000 (11:48 +0200)]
dmsetup: validate strtol reading

Better validation for --mode option.

7 years agodmsetup: add missing -- for option
Zdenek Kabelac [Fri, 25 Aug 2017 09:47:36 +0000 (11:47 +0200)]
dmsetup: add missing -- for option

7 years agoreporting: validate time parsing with strtol
Zdenek Kabelac [Fri, 25 Aug 2017 09:58:33 +0000 (11:58 +0200)]
reporting: validate time parsing with strtol

Check for out-of-range numbers being result of strtol parsing.

7 years agolvmlockd: log pthread_join errno code
Zdenek Kabelac [Fri, 25 Aug 2017 09:52:09 +0000 (11:52 +0200)]
lvmlockd: log pthread_join errno code

Log possible errno with pthread_join (and one close() instance).

7 years agolvmlockctl: fix check for failing close
Zdenek Kabelac [Fri, 25 Aug 2017 09:57:49 +0000 (11:57 +0200)]
lvmlockctl: fix check for failing close

On  close() failure it's -1.

7 years agolvmlockd: avoid double unlock of client_mutex
Zdenek Kabelac [Fri, 25 Aug 2017 12:07:45 +0000 (14:07 +0200)]
lvmlockd: avoid double unlock of client_mutex

Avoid double unlocking of client_mutex and
and unlock client_mutex in 'else' branch
since it's already unlocked in 'if (cl->dead)' branch.

7 years agodaemonize: more unified code
Zdenek Kabelac [Fri, 25 Aug 2017 09:55:38 +0000 (11:55 +0200)]
daemonize: more unified code

ATM we have several instances of daemonizing code.
Each has its 'special' logic so not completely easy
to unify them all into a single routine.

Start to unify them and use one strategy for rediricting
all input/outpus to /dev/null - use 'dup2' function for this
and open /dev/null before fork to make sure it's available.

7 years agolocking: avoid descriptor leak for nonblocking mode
Zdenek Kabelac [Fri, 25 Aug 2017 09:59:19 +0000 (11:59 +0200)]
locking: avoid descriptor leak for nonblocking mode

When file-locking mode failed on locking, such description was leaked
(typically not an issue since command usually exists afterwards).
So shirt close() at the end of function and use it in all error paths.

Also make sure, when interrrupt is detected, it's really not holding
lock and returns 0.

7 years agoman lvmthin: change fsck references
David Teigland [Thu, 24 Aug 2017 15:25:01 +0000 (10:25 -0500)]
man lvmthin: change fsck references

to more generic terms like repair.

7 years agolvmlockd: fix mutex unlock
David Teigland [Wed, 23 Aug 2017 16:30:55 +0000 (11:30 -0500)]
lvmlockd: fix mutex unlock

Remove an unwanted pthread_mutex_unlock which would
lead to a double unlock.

7 years agolvmlockd: add comment about temp ls name
David Teigland [Wed, 23 Aug 2017 16:25:18 +0000 (11:25 -0500)]
lvmlockd: add comment about temp ls name

7 years agodebug: add stack trace point
Zdenek Kabelac [Tue, 22 Aug 2017 08:19:52 +0000 (10:19 +0200)]
debug: add stack trace point

7 years agolvmcache: check for lvmcache_foreach_mda return code
Zdenek Kabelac [Wed, 16 Aug 2017 12:29:12 +0000 (14:29 +0200)]
lvmcache: check for lvmcache_foreach_mda return code

lvmcache_foreach_mda() can fail for numerous reasons
and failing error code cannot be ignored (out-of-memory...)

TODO: might need more error handling tunning.

7 years agolvmlockd: shorter code
Zdenek Kabelac [Wed, 16 Aug 2017 12:12:48 +0000 (14:12 +0200)]
lvmlockd: shorter code

gcc warns here about storring 69 bytes in 64 byte array (losing
potentially 4 bytes from 'ls->name').

lvmlockd-core.c:2657:36: warning: ‘%s’ directive output may be truncated writing up to 64 bytes into a region of size 60 [-Wformat-truncation=]
  snprintf(tmp_name, MAX_NAME, "REM:%s", ls->name);
                                    ^~
lvmlockd-core.c:2657:2: note: ‘snprintf’ output between 5 and 69 bytes into a destination of size 64
  snprintf(tmp_name, MAX_NAME, "REM:%s", ls->name);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Replaced with slightly better code - but it still misses error path what
to do if the name would be truncated... - so added FIXME.

Also using all bytes for snprintf() buffer size
(as the size is with \0 included)

7 years agolibdm: fix errpath for control node creation
Zdenek Kabelac [Tue, 22 Aug 2017 08:19:40 +0000 (10:19 +0200)]
libdm: fix errpath for control node creation

When control node failure happens, umask was not restored.
Fix it by using common exit path.

7 years agolvmlockd: zero extended lvmlock LV
David Teigland [Tue, 15 Aug 2017 16:53:21 +0000 (11:53 -0500)]
lvmlockd: zero extended lvmlock LV

After the internal lvmlock LV (holding sanlock leases) is
extended to hold more leases, it needs to be zeroed.
sanlock expects to see either zeroed blocks or blocks
initialized with leases.

7 years agolvmlockd: reduce io impact for finding sanlock lv free lock offset
Zhang Huan [Tue, 15 Aug 2017 15:42:44 +0000 (10:42 -0500)]
lvmlockd: reduce io impact for finding sanlock lv free lock offset

currently, lvcreate for sanlock find the free lock offset
from the beginning of the lvmlock every time.
after created thousands of lvs, it will issue thousands of read
ios for lvcreate to find free lock offset.
remeber the last free lock offset will greatly reduce the impact

Signed-off-by: Zhang Huan <zhanghuan@huayun.com>
7 years agotest: pvcreate-bootloaderarea: pvcreate --restorefile --bootloaderarea not supported...
Peter Rajnoha [Tue, 15 Aug 2017 12:15:41 +0000 (14:15 +0200)]
test: pvcreate-bootloaderarea: pvcreate --restorefile --bootloaderarea not supported anymore

The fact that this combination is not supported anymore is tested
already in pvcreate-operation.sh test.

7 years agopvcreate: fix check for 2nd mda at end of disk fits if using pvcreate --restorefile
Peter Rajnoha [Tue, 15 Aug 2017 11:23:51 +0000 (13:23 +0200)]
pvcreate: fix check for 2nd mda at end of disk fits if using pvcreate --restorefile

Fix code checking that the 2nd mda which is at the end of disk really
fits the available free space and avoid any DA and MDA interleaving when
we already have DA preallocated. This mainly applies when we're restoring
a PV from VG backup using pvcreate --restorefile where we may already have
some DA preallocated - this means the PV was in a VG before with already
allocated space from it (the LVs were created). Hence we need to avoid
stepping into DA - the MDA can never ever be inside in such case!

The code responsible for this calculation was already in
_text_pv_add_metadata_area fn, but it had a bug in the calculation where
we subtracted one more sector by mistake and then the code could still
incorrectly allocate the MDA inside existing DA. The patch also renames
the variable in the code so it doesn't confuse us in future.

Also, if the 2nd mda doesn't fit, don't silently continue with just 1
MDA (at the start of the disk). If 2nd mda was requested and we can't
create that due to unavailable space, error out correctly (the patch
also adds a test to shell/pvcreate-operation.sh for this case).

7 years agoraid: more validation checks for segment data_offset member
Heinz Mauelshagen [Mon, 14 Aug 2017 13:00:15 +0000 (15:00 +0200)]
raid: more validation checks for segment data_offset member

Upgrade commit fb641c342343ac48cc623c8079900b1f4f395a69 with additional checks.

7 years agopvcreate: Use maximum metadata area size with --restorefile
Alasdair G Kergon [Fri, 11 Aug 2017 19:41:37 +0000 (20:41 +0100)]
pvcreate: Use maximum metadata area size with --restorefile

If the PV was originally created with a larger-than-default
metadata area the restored one wasn't and might not even be
large enough to hold the metadata!

7 years agopvcreate: Wipe cached bootloaderarea when wiping label.
Alasdair G Kergon [Fri, 11 Aug 2017 19:32:04 +0000 (20:32 +0100)]
pvcreate: Wipe cached bootloaderarea when wiping label.

Previously the cache remembered an existing bootloaderarea and
reinstated it (without even checking for overlap) when asked to
write out the PV.  pvcreate could write out an incorrect layout.

7 years agopvcreate: Disallow --bootloaderareasize with --restorefile.
Alasdair G Kergon [Fri, 11 Aug 2017 19:28:53 +0000 (20:28 +0100)]
pvcreate: Disallow --bootloaderareasize with --restorefile.

The backup file already holds the bootloader area details to use so
don't overcomplicate things.

7 years agocommands: recognize lvm command -?
David Teigland [Wed, 9 Aug 2017 20:06:36 +0000 (15:06 -0500)]
commands: recognize lvm command -?

and interpret it as lvm command -h

7 years agocommands: recognize -? for help
David Teigland [Wed, 9 Aug 2017 14:34:33 +0000 (09:34 -0500)]
commands: recognize -? for help

It's not known when this last worked, but there has
been documentation suggesting it worked, so enable it.

7 years agolvmlockd: global name doesn't apply to sanlock
David Teigland [Mon, 7 Aug 2017 15:43:28 +0000 (10:43 -0500)]
lvmlockd: global name doesn't apply to sanlock

When adopting locks, we shouldn't skip the special
dlm global lockspace name when using sanlock.

7 years agolvmlockd: fix lm running check during adoption
David Teigland [Mon, 7 Aug 2017 15:37:22 +0000 (10:37 -0500)]
lvmlockd: fix lm running check during adoption

When trying to adopt locks in startup, we want to ignore
a lock manager that isn't running, not fail.

7 years agolvmconfig: Add options to produce file preamble
Alasdair G Kergon [Sat, 5 Aug 2017 15:18:36 +0000 (16:18 +0100)]
lvmconfig: Add options to produce file preamble

Use --withgeneralpreamble and --withlocalpreamble instead of
concatenating files.

7 years agodmsetup: Add --concise to dmsetup create.
Alasdair G Kergon [Fri, 4 Aug 2017 18:38:34 +0000 (19:38 +0100)]
dmsetup: Add --concise to dmsetup create.

Add the new concise format to dmsetup create, either as a single
command-line parameter or from stdin.

Based on patches submitted by
Enric Balletbo i Serra <enric.balletbo@collabora.com>.

7 years agoioctl: Allow minor without major.
Alasdair G Kergon [Fri, 4 Aug 2017 13:45:20 +0000 (14:45 +0100)]
ioctl: Allow minor without major.

There's no need to insist on a major number being supplied when the
code's going to override it if it's wrong anyway.

7 years agotests: update checked message
Zdenek Kabelac [Tue, 1 Aug 2017 22:04:35 +0000 (00:04 +0200)]
tests: update checked message

7 years agotests: update makefiles
Zdenek Kabelac [Tue, 1 Aug 2017 16:53:25 +0000 (18:53 +0200)]
tests: update makefiles

7 years agomakefiles: add DEFS_$@ for cxx
Zdenek Kabelac [Tue, 1 Aug 2017 16:13:21 +0000 (18:13 +0200)]
makefiles: add DEFS_$@ for cxx

Add DEFS_$@ for c++  (used only by test suite...)
Just to pair plain C build rules.

7 years agomakefiles: script executable missed dynamic
Zdenek Kabelac [Tue, 1 Aug 2017 16:19:12 +0000 (18:19 +0200)]
makefiles: script executable missed dynamic

Add missing  ELDFLAGS when linking binary.
Also pass CFLAGS for cases where we build code coverage compilation.

7 years agomakefiles: fix tested vars
Zdenek Kabelac [Tue, 1 Aug 2017 16:18:05 +0000 (18:18 +0200)]
makefiles: fix tested vars

For resolving usability of DEBUG_MEM - check proper translated make
vars for proper value.

7 years agoconfigure: tune BUILD_DMEVENTD
Zdenek Kabelac [Tue, 1 Aug 2017 16:17:06 +0000 (18:17 +0200)]
configure: tune  BUILD_DMEVENTD

Drop 'DMEVENT' make variable and use  BUILD_DMEVENTD like with other daemons.
NOTE: by default we do not build dmeventd - maybe time to change
as lot of build targets basically do need dmeventd...

Switch to use SYSTEMD_LIBS and avoid linking systemd library with
every linked tool when dbus notification are enabled.
(TODO  add missing testing for lib presence)

7 years agoconfigure: improve test for realtime clock
Zdenek Kabelac [Tue, 1 Aug 2017 10:41:45 +0000 (12:41 +0200)]
configure: improve test for realtime clock

Check first if we need to even link -lrt  - since clock functions
are normally emebeded with recent  glibc (>=2.17)
Use standard  RT_LIBS name.
Avoid duplicate test for realtime clock with lvmlockd
Show better error message when realtime clock support is missing or
disabled.
Link  RT_LIBS explicitely with lvmlockd and lvmetad.

7 years agotests: update makefile
Zdenek Kabelac [Tue, 1 Aug 2017 09:19:21 +0000 (11:19 +0200)]
tests: update makefile

7 years agomakefiles: cleanups
Zdenek Kabelac [Mon, 31 Jul 2017 21:58:51 +0000 (23:58 +0200)]
makefiles: cleanups

7 years agomakefiles: fixing linking
Zdenek Kabelac [Mon, 31 Jul 2017 22:01:07 +0000 (00:01 +0200)]
makefiles: fixing linking

Avoid adding -g more then once for debug builds.
Avoid enabling  DEBUG_MEM when we build multithreaded tools.
Link executables with -fPIE -pie and --export-dynamic LDFLAGS
Introduce PROGS_FLAGS to add option to pass flags for external libs.
Link  lvm2 internally library only when really used.
Link DAEMON_LIBS with daemons.
Pass VALGRIND_CFLAGS internally
Set shell failure mode on couple places.

7 years agomakefiles: use gcc warns with gcc only
Zdenek Kabelac [Mon, 31 Jul 2017 22:04:20 +0000 (00:04 +0200)]
makefiles: use gcc warns with gcc only

Avoid passing  'gcc' warning options to non-gcc compiler

7 years agomakefiles: RT_LIB
Zdenek Kabelac [Mon, 31 Jul 2017 21:56:58 +0000 (23:56 +0200)]
makefiles: RT_LIB

Link -lrt directly only with  libdevmapper.
All other users get dependency transiently.

7 years agolibdm: log_warn
Zdenek Kabelac [Mon, 24 Jul 2017 12:40:41 +0000 (14:40 +0200)]
libdm: log_warn

No real effect anyway - function returs '1' in all paths,
but just make sure we do not have 'log_error()' on non-error path.

7 years agoman: fix generated paths
Zdenek Kabelac [Tue, 1 Aug 2017 09:17:04 +0000 (11:17 +0200)]
man: fix generated paths

Use user configured paths instead of some developers paths ;)

7 years agothin: warn about too big chunks size
Zdenek Kabelac [Fri, 21 Jul 2017 18:58:33 +0000 (20:58 +0200)]
thin: warn about too big chunks size

lvm2 warned about zeroing and too big chunksize (>=512KiB), but
only during lvconvert, so lvcreate was creating thin-pools
without any warning about possible slowness of thin provisioning
because of zeroing.

7 years agotoolcontext: Improve invalid units error message.
Alasdair G Kergon [Wed, 26 Jul 2017 23:51:50 +0000 (00:51 +0100)]
toolcontext: Improve invalid units error message.

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