| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
update for duplicate changes
|
| |
|
|
|
|
| |
update for duplicate changes
|
|
|
|
| |
Update for new duplicate processing.
|
|
|
|
|
|
|
|
| |
If a command begins repopulating the lvmetad cache,
and fails part way through, it should set the disabled
state in lvmetad so other commands don't use bad data.
If a subsequent scan succeeds, the disabled state is
cleared.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, duplicate PVs were processed as a side effect
of processing the "chosen" PV in lvmcache. The duplicate
PV would be hacked into lvmcache temporarily in place of
the chosen PV.
In the old way, we had to always process the "chosen" PV
device, even if a duplicate of it was named on the command
line. This meant we were processing a different device than
was asked for. This could be worked around by naming
multiple duplicate devs on the command line in which case
they were swapped in and out of lvmcache for processing.
Now, the duplicate devs are processed directly in their
own processing loop. This means we can remove the old
hacks related to processing dups as a side effect of
processing the chosen device. We can now simply process
the device that was named on the command line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wait to compare and choose alternate duplicate devices until
after all devices are scanned. During scanning, the first
duplicate dev is kept in lvmcache, and others are kept in a
new list (_found_duplicate_devs).
After all devices are scanned, compare all the duplicates
available for a given PVID and decide which is best.
If the dev used in lvmcache is changed, drop the old dev
from lvmcache entirely and rescan the replacement dev.
Previously the VG metadata from the old dev was kept in
lvmcache and only the dev was replaced.
A new config setting devices/strict_pv_device can be set
to 1 which will disallow modifying a VG when it contains
PVs with duplicate devices. Set to 0 is the old behavior
which allowed the VG to be changed.
The logic for which of two devs is preferred has changed.
The primary goal is to choose a device that is currently
in use if the other isn't, e.g. by an active LV.
. prefer dev with fs mounted if the other doesn't, else
. prefer dev that is dm if the other isn't, else
. prefer dev in subsystem if the other isn't
If neither device is preferred by these rules, then don't
change devices in lvmcache, leaving the one that was found
first.
The previous logic for preferring a device was:
. prefer dev in subsystem if the other isn't, else
. prefer dev without holders if the other has holders, else
. prefer dev that is dm if the other isn't
|
|
|
|
|
|
| |
This is no longer used since lvmetad no longer
keeps track of alternate devices for duplicate PVs,
but is simply disabled when duplicates appear.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When duplicate PVs are detected, set the disabled
flag so that commands will disable use of lvmetad.
This duplicate detection is done by lvmetad itself
when it's told about a single new PV with a PVID
that matches an existing PV on another device.
(This is different from the case where the command
is scanning all devices and detects the duplicate.)
Remove the "altdev" logic that attempted to keep
track of multiple devices for a single PV. It
is no longer used since lvmetad is disabled in
this case.
|
|
|
|
|
| |
When devices are being scanned, if duplicate PVs are seen,
tell lvmetad to set its disabled flag because of duplicate PVs.
|
|
|
|
| |
Unwanteadly enabled in previous check-in.
|
| |
|
|
|
|
|
|
| |
Using them only for debug so ignorable.
Also don't mark stack char buffer alignment, compiler already knows
what's the best here.
|
|
|
|
| |
Use 64bit input to remain with whole evaluation in 64bit.
|
| |
|
| |
|
|
|
|
| |
412f09ca332c644e08421e289a3e8d54890971ba missed parentheses.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check that @stats_list and @stats_print returned data in the
_stats_parse_list() and _stats_parse_region() functions before
attempting to operate on region and area values.
This avoids a coverity warning since fgets() could potentially
return no data from the memory buffer returned by the ioctl.
In both cases the ioctl would return an error, preventing these
functions from running, however it is cleaner to test for the
condition explicitly and fail in those cases.
|
|
|
|
|
|
| |
Figure out which test needs to see hidden volumes without [].
But normally use [] for debug printing in tests.
It's confusing otherwise.
|
|
|
|
|
| |
As mempool is destroyed on by caller don't bother for
mempool freeing here.
|
| |
|
|
|
|
|
| |
While we return internal error we should not let tool crash on NULL
access, so return valid string for such case.
|
|
|
|
|
| |
Coverity likes when the types are same through the whole expression.
And since dev_t is 64b - widen int type early.
|
| |
|
|
|
|
|
|
| |
Patch 74e704bb4465960b361711c890733cbae1f06e42 missed to update
error path. Since now we just need to 'return_0' as 'dmt is NULL
and thus may not be destroyed.
|
|
|
|
|
|
|
|
| |
Commit 52e0d0db4460d90172e9bd45b9ef30e7f4f75ae7 introduced regression
as code may access buf[0 - 1].
Reorder code to first remove '\n' and then check buffer size for
empty.
|
|
|
|
|
| |
Reuse libdm header in lvm so we have single definition
of MAJOR/MINOR/MKDEV macros in use.
|
|
|
|
| |
dm_strncpy() also check the size fits.
|
| |
|
| |
|
|
|
|
|
|
| |
When lvm is not using lvmetad, the lvmetad_connect()
in the forked polling process is not needed and was
generating unwanted warnings.
|
|
|
|
| |
Keep the code compilatible without warnings on newer glibc.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If lvmetad is running, and a command opts to not use it
(--config global/use_lvmetad=0), and the command changes
metadata, then the metadata change is not visible to
lvmetad. Subsequent commands using lvmetad to change
metadata may cause corruption based on the invalid
lvmetad state.
Eventually we can set the disabled state in lvmetad
to prevent this problem, but for now print a warning
about the possibility.
|
|
|
|
| |
Last commit was missing stub function.
|
|
|
|
|
|
|
|
| |
When command is not using lvmetad because
use_lvmetad=0 in the config, but the lvmetad
pidfile exists, print a warning (previously
this checked for the socket existing instead
of the pidfile existing.)
|
|
|
|
|
|
| |
We can connect if the socket is present, even
though the pidfile may not exist, since systemd
may start the process when the socket is opened.
|
|
|
|
|
|
|
| |
vg/snapshotN should not appear anywhere.
No code should be showing this, but it was noticed in some logs last
week and we can deal with it in display_lvname().
|
| |
|
| |
|
|
|
|
|
| |
When no debug.log* file is present whole stacktracking was skipped.
Add extra test the file exists to catch this case.
|
| |
|
|
|
|
| |
It should log action before taking it instead of only in error path.
|
|
|
|
|
|
| |
When user requested on cmdline disabling of lvmetad/lvmpoll,
respect it and when lvmlockd requires these daemon,
Error configure with clear message about misconfiguration.
|
|
|
|
|
| |
Detecs systems with /run/lock dir and use such path directly instead
of /var/lock.
|
|
|
|
|
|
| |
With commit 5e9e43074a6c, lvmetad connections are
now made explicitly, so a new connection must be
created from a child created for polling.
|
|
|
|
| |
Fix test case where a warning appears when it's not expected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lvmetad connection is created within the
init_connections() path during command startup,
rather than via the old lvmetad_active() check.
The old lvmetad_active() checks are replaced
with lvmetad_used() which is a simple check that
tests if the command is using/connected to lvmetad.
The old lvmetad_set_active(cmd, 0) calls, which
stopped the command from using lvmetad (to revert to
disk scanning), are replaced with lvmetad_make_unused(cmd).
|
| |
|