1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

4600 Commits

Author SHA1 Message Date
David Teigland
96dc03b337 lockd: vgrename fixes
If busy locks in lvmlockd prevent vgrename, use the
correct error exit path, and print a user-friendly
error message.
2015-09-03 10:21:44 -05:00
Peter Rajnoha
d1d00fdeec dev-cache: append (major:minor) to debug messages about adding device or its alias to cache
device/dev-cache.c:350         /dev/sda: Added to device cache (8:0)
device/dev-cache.c:346         /dev/disk/by-id/lvm-pv-uuid-5nPovF-EWp4-vBwd-ylCJ-9Y0B-yzHQ-ek1li2: Aliased to /dev/sda in device cache (8:0)
...
2015-09-03 14:36:15 +02:00
Peter Rajnoha
00b610e542 filters: do not print [none:nil] as external device info's [source:handler] if "none" source is used
Print [source:handler] in filters' debug messages only if external
device info source other than "none" is used.

$ lvmconfig --type full devices/external_device_info_source
external_device_info_source="none

Before this patch (from the -vvvv log):

filters/filter-usable.c:47         /dev/mapper/test: Skipping: Too small to hold a PV [none:(nil)]
filters/filter-md.c:33         /dev/sdb: Skipping md component device [none:(nil)]
filters/filter-partitioned.c:25         /dev/vda: Skipping: Partition table signature found [none:(nil)]

With this patch applied:

filters/filter-usable.c:44         /dev/mapper/test: Skipping: Too small to hold a PV
filters/filter-md.c:35         /dev/sdb: Skipping md component device
filters/filter-partitioned.c:27         /dev/vda: Skipping: Partition table signature found
2015-09-03 14:19:48 +02:00
Alasdair G Kergon
cc17210bce man: Add install_full_man makefile target.
'make install_full_man' installs all the man pages regardless of
which components were enabled when 'configure' was run.
2015-08-28 13:03:18 +01:00
David Teigland
e4d5d05119 lvmlockd: remove list of inactive lockspaces
This was only used to return two flags indicating specific
reasons for a lock failure so that a more specific error
message could be printed by the command (lockspace had been
stopped, or lockspace had an error starting.)

Remove the list, given its limited usefulness, the fact it
would easily become inaccurate, and the fact it was causing
misleading error messages.  The error conditions it was meant
to help could be reported differently.
2015-08-27 15:23:14 -05:00
David Teigland
e3f1b1dccb lvmlockd: skip lockd removal check for non-lockd VGs 2015-08-27 10:27:24 -05:00
David Teigland
fd238f3c0e lvmlockd: fix function def for non-lvmlockd build 2015-08-27 10:27:24 -05:00
David Teigland
32e22a0037 lvmlockd: rescan lockd VG in two new cases
Previously, a command would only rescan a lockd VG
when lvmetad returned the "vg_invalid" flag indicating
that the cached copy was invalid (which is done by
lvmlockd.)  This is still the only usual reason for
rescanning a lockd VG, but two new special cases are
added where we also do the rescan:

. When the --shared option is used to display lockd VGs
  from hosts not using lvmlockd.  This is the same case
  as using --foreign to display foreign VGs, but --shared
  was missing the corresponding bits to rescan the VGs.

. When a lockd VG is allowed to be read for displaying
  after failing to acquire the lock from lvmlockd.  In
  this case, the usual mechanism for validating the
  cache is missed, so assume the cache would have been
  invalidated.  (This had been a previous todo item
  that was lost during other cleanup.)

These were long-standing todos that were lost track of.
2015-08-27 10:27:24 -05:00
David Teigland
231b7df6cc lvmlockd: improve VG removal for lock_type dlm
This makes lvmlockd removal steps for dlm VGs closely match
sanlock VGs.  Because dlm lockspaces are not required to be
stopped on all hosts before vgremove, there is an extra bit
for dlm lockspaces, where a flag is set in the VG lock lvb
indicating that the VG was removed.  If other hosts happen
to use the VG lock they will see this flag and stop their
lockspace.
2015-08-27 10:27:24 -05:00
David Teigland
de4db6a93b lvmlockd: add full changing of lock type
Remove the existing lock type using the same functions
used to remove the lockd components during vgremove.
This results in a "clean" VG and lvmlockd state after
the vgchange, i.e. no bits left over from previous
lock type.
2015-08-27 10:27:24 -05:00
Zdenek Kabelac
a4fdfc098d cache: report cache pool attrs also for pools
Since cache-pool actualy keeps info about caching,
display this info for cache-pool LV as well
(matches info for cache LV when cache-pool is asociated with it).
2015-08-26 11:24:41 +02:00
Zdenek Kabelac
cbe81ad393 cache: no report error for cpool without mode
It's perferctly valid to not have cachemode for
unused cache-pool.

https://bugzilla.redhat.com/show_bug.cgi?id=1255184
2015-08-26 10:49:23 +02:00
Bryn M. Reeves
82a27a85b5 macros: fix default symbol export control
Fix the version export macros to make it possible to export two
different DM_* versions of a symbol: currently it is only possible for a
DM_* symbol to override a symbol in Base. Attempting to export two
symbols at different DM_* version levels (e.g. DM_1_02_104 and
DM_1_02_106) leads to a linker error due to a duplicate symbol
definition.

This is because the DM_EXPORTED_SYMBOL macro makes each exported symbol
the default (@@VERSION):

       __asm__(".symver " #func "_v" #ver ", " #func "@@DM_" #ver )

Fix the macro to use a single '@' for a symbols exported in multiple
versions and rename the macros to DM_EXPORT_*:

  DM_EXPORT_SYMBOL(func,ver)
  DM_EXPORT_SYMBOL_BASE(func,ver)

For functions that have multiple implementations these macros control
symbol export and versioning.

Function definitions that exist in only one version never need to use
these macros.

Backwards compatible implementations must include a version tag of
the form "_v1_02_104" as a suffix to the function name and use the
macro DM_EXPORT_SYMBOL to export the function and bind it to the
specified version string.

Since versioning is only available when compiling with GCC the entire
compatibility version should be enclosed in '#if defined(__GNUC__)',
for example:

  int dm_foo(int bar)
  {
    return bar;
  }

  #if defined(__GNUC__)
  // Backward compatible dm_foo() version 1.02.104
  int dm_foo_v1_02_104(void);
  int dm_foo_v1_02_104(void)
  {
    return 0;
  }
  DM_EXPORT_SYMBOL(dm_foo,1_02_104)
  #endif

A prototype for the compatibility version is required as these
functions must not be declared static.

The DM_EXPORT_SYMBOL_BASE macro is only used to export the base
versions of library symbols prior to the introduction of symbol
versioning: it must never be used for new symbols.
2015-08-24 20:03:21 +01:00
Zdenek Kabelac
6d9e7d48fb cleanup: add . 2015-08-21 15:35:45 +02:00
Zdenek Kabelac
e4b9ac46d7 thin: metadata size cannot be reduced
Until we implement offline metadata manipulation,
the size of metadata LV cannot be reduced.
2015-08-21 15:35:45 +02:00
David Teigland
d08427030d config: improve description text layout
This mainly makes the description text use 80 columns.
There are a few minor adjustments to wording to help
the text layout, and a couple minor improvements to
descriptions.
2015-08-18 14:02:32 -05:00
Zdenek Kabelac
28b4fa3e27 Revert "lvmcache: check for too long pvid"
This reverts commit 70db1d523d.
Since we use 'strncpy' even for case where it exactly matches
the buffer size and \0 is not expected to be added there.
2015-08-18 15:22:13 +02:00
Zdenek Kabelac
a8fd88463e cleanup: trace error from lvmcache_update_vgname_and_id
Check result value from lvmcache_update_vgname_and_id().
2015-08-18 15:00:08 +02:00
Zdenek Kabelac
40af31729f cleanup: typo fix and drop \
Fix 'th e'  and use % directly.
2015-08-18 15:00:08 +02:00
Zdenek Kabelac
58f8f29c41 cleanup: add FMTssize_t
Add define to print nicely ssize_t type.
2015-08-18 15:00:08 +02:00
Zdenek Kabelac
55a9262bdb cleanup: unused header files (Coverity) 2015-08-18 15:00:08 +02:00
Zdenek Kabelac
70db1d523d lvmcache: check for too long pvid 2015-08-18 14:53:36 +02:00
David Teigland
dece918bc8 config: create lists of accepted values in descriptions 2015-08-17 14:50:41 -05:00
David Teigland
b091c37595 config: add empty lines around examples
When --withspaces is used, a blank line is
added before and after an Example section,
making the text less dense.
2015-08-17 13:52:34 -05:00
David Teigland
ca70770cfd config: recognize a blank comment line
Consider the comment line "#\n" to be a blank line, and
print a blank line at that position when --withspaces is set.
2015-08-17 13:52:34 -05:00
David Teigland
5243a81c29 config: explain automatic default values
Before printing a commented automatic config value,
print a line describing what it is.  Otherwise, the
commented value can look like it's a part of an
example preceding it.
2015-08-17 13:52:34 -05:00
Alasdair G Kergon
be1db6b6c1 pre-release 2015-08-17 17:20:14 +01:00
Zdenek Kabelac
80bc87e377 cache: more comments for new setting 2015-08-17 17:26:39 +02:00
Zdenek Kabelac
4b28383b1c cache: move detection code to cache_set_policy
Move code which runtime detects settings for cache_policy
out of config dir to cache seg handling code.

Also mark cache_mode as command profilable setting.
2015-08-17 15:52:06 +02:00
Alasdair G Kergon
623b46a17d device: Don't try to close config file on failure.
$file: open failed: Permission denied
Failed to load config file $file
Attempt to close device '$file' which is not open.
2015-08-17 12:57:01 +01:00
Zdenek Kabelac
79ea81b8a8 thin: restore transaction_id handling
Revert back to already existing behavior which has been slightly
modified by a900d150e4.

At the end however it seem to be equal to change TID right with first
metadata write.

Existing code missed handling for 'unused' thin-pool which would
require to also check empty message list for TID==0.

So with the fix we now again preserve 'active' thin-pool volume
when first thin volume is created - this property was lost and caused
problems in cluster, where the lock was hold, but volume was no longer
active on the node.

Another missing part was the proper support for already increased,
but unfinished TID change.

So going back here with existing logic -

TID is increased with first MDA update.

Code allows start with either same TID or (TID-1).

If there are messages, TID must be lower by 1 for sending,
otherwise messages were already posted.
2015-08-17 11:25:03 +02:00
Zdenek Kabelac
d4c024c836 cache: use undefined settings for cache_policy
As cache_policy is evaluated in runtime, we no longer should use
CFG_COMMENTED, but have to switch to CFG_UNDEFINED.

So as long as the value is undefined, it's runtime evaluated.
Once it's set - it's always respected (no runtime fallback).

Also fix version of introduced settings to 2.2.128.
2015-08-17 11:25:03 +02:00
David Teigland
829384f46d config: description updates
Make the first line of every description a complete one
line sentence for the benefit of lvmconfig --withsummary.
2015-08-12 15:35:45 -05:00
Bryn M. Reeves
a8b9e2eccd dmsetup: use timerfd for interval timing if available
If the Linux timerfd interface to POSIX timers is available at compile
time use it for all report interval timekeeping. This gives more
accurate interval timing when the per-interval processing time is less
than the configured interval and simplifies the timestamp bookkeeping
required to keep accurate time.

For systems without timerfd support fall back to the simple usleep based
timer.
2015-08-12 15:09:57 +01:00
Zdenek Kabelac
48ed8ac50c cleanup: indent 2015-08-12 14:33:16 +02:00
Zdenek Kabelac
ece758457d cleanup: use IEC KiB units
Reduce mixing of KB, kiB and use just KiB.
2015-08-12 14:33:15 +02:00
Zdenek Kabelac
9edd2258ff config: extend definition for Allocation
Extend comment for this section.
2015-08-12 14:33:15 +02:00
Zdenek Kabelac
13c7bbf8a9 config: support longer config paths
64 bytes might not be enough, so use larger buffer size.
2015-08-12 14:33:15 +02:00
Zdenek Kabelac
533ac4d47d cache: add more validation 2015-08-12 14:33:14 +02:00
Zdenek Kabelac
f0c18fceb4 cache: api update
Change logic and naming of some internal API functions.

cache_set_mode() and cache_set_policy() both take segment.

cache mode is now correctly 'masked-in'.

If the passed segment is 'cache' segment - it will automatically
try to find 'defaults' according to profiles if the are NOT
specified on command line or they are NOT already set for cache-pool.

These defaults are never set for cache-pool.
2015-08-12 14:32:24 +02:00
Zdenek Kabelac
22a1337a9b cache: undefined policy is mq
If the policy_name is unspecified in metadata,
it's automatically 'mq'.
2015-08-12 14:11:18 +02:00
Zdenek Kabelac
969ee25a74 toollib: get_cache_params
Enhance  get_cache_params() to read common cache args.
2015-08-12 14:11:18 +02:00
Zdenek Kabelac
feb8e9a790 cache: runtime detect default policy
When the policy is not preset in lvm.conf,
detect in runtime whether to use 'mq' or
new available 'smq'.
2015-08-12 14:11:17 +02:00
Zdenek Kabelac
8a74d1ec79 cache: detect smq policy presence
Add code to detect available cache features.
Support policy_mq & policy_smq  features which might be disabled.

Introduce global_cache_disabled_features_CFG.
2015-08-12 14:11:17 +02:00
Zdenek Kabelac
036d90bba6 cache: add cache_policy cache_settings
Add new profilable configurables:

allocation/cache_policy
allocation/cache_settings

and mark allocation/cache_pool_chunk_size as profilable as well.

Obsolete allocation/cache_pool_cachemode and
introduce new allocation/cache_mode instead.

Rename DEFAULT_CACHE_POOL_POLICY to DEFAULT_CACHE_POLICY.
2015-08-12 14:11:16 +02:00
David Teigland
53c08f0bba lvrename: fix lockd LV locking
lvrename should not be done if the LV is active on another host.
This check was mistakenly removed when the code was changed to
use LV uuids in locks rather than LV names.
2015-08-10 15:46:21 -05:00
David Teigland
1aa7fa354e vgremove: fix locking when lvmlockd global lock is removed
When vgremove is used to remove multiple VGs in one command,
e.g. vgremove foo bar, the first VG (foo) that is removed
may have held the sanlock global lock.  In this case,
do not continue removing further VGs (bar) without the
global lock.
2015-08-10 13:04:11 -05:00
David Teigland
fd1782b5fc lvmlockd: handle loss of sanlock lease storage
This adds the infrastructure, code paths, error reporting,
etc. to handle storage errors, or storage loss, under the
sanlock leases in a VG that is being used.  The loss of
storage means sanlock cannot renew its leases, which means
that the host needs to stop using the shared VG before its
leases expire.

This still requires manually shutting down a VG that has
lost lease storage, e.g. unmounting file systems,
deactivating LVs in the VG.  The next step is to
automatically use a command like blkdeactivate to do that.
2015-08-05 10:21:45 -05:00
Peter Rajnoha
f02cdcff00 coverity: check vg->lvm1_system_id is not NULL before calling strncmp with that
lib/format1/import-export.c:167: var_deref_model: Passing null pointer "vg->lvm1_system_id" to "strncmp", which dereferences it.
2015-08-04 10:35:31 +02:00
Peter Rajnoha
83541123c8 coverity: fix cppcheck warnings
/lib/log/log.c:88: warning[invalidScanfArgType_int]: %llu in format string (no. 2) requires 'unsigned long long *' but the argument type is 'long long *'.
daemons/lvmlockd/lvmlockd-core.c:791: error[uninitstring]: Dangerous usage of 'version' (strncpy doesn't always null-terminate it).
2015-08-04 09:33:55 +02:00