| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The toollib code for processing PVs given on commandline tried to be smart and
use pv_read, avoiding real metadata scanning. The premise of the optimisation
was that if there is an active MDA on the PV, it can be reliably used to
establish VG membership. This assumption is however wrong, since it's entirely
possible that this particular MDA is simply out of date, and the PV is not
actually in any VG. While this is a subtle and rare bug, it's still a bug. One
way to trigger it would be to hotplug an old disk which at some point was a PV
in an existing VG, having a seemingly valid MDA but with an old sequence
number. All commands that use normal scanning realize that this PV does not
belong into the VG anymore, but anything based on pv_read alone will believe it
does.
|
| |
|
|
|
|
|
| |
Do not parse yes_no_arg inside tools code and use already
available result as uint.
|
|
|
|
| |
Do not return 64bit values - return just plain int 0 or 1
|
|
|
|
|
| |
buffer_write now accepts const pointer
Simplify loops and drop goto when not needed.
|
|
|
|
|
|
|
|
|
| |
Check for enough space in preallocated buffer.
Fixes problem, when lvm code started to suddenly allocate
too big memory chunks.
TODO: lvmetad protocol should announce needed size ahead,
so if metadata have 1MB we are not reallocating memory...
|
|
|
|
| |
Use matching dm_ functions for internally used buffers.
|
|
|
|
|
|
|
|
|
|
| |
When vgname has not existed in metadata, it has crashed on double free
in format_instance destroy() - since VG was created, used FID and was
released - which also released FID, so further use was accessing bad
memory.
Fix it for this code path before release_vg() so FID will exists
when _vg_read_file_name() returns NULL.
|
|
|
|
|
|
| |
Revert commit 37ffe6a. If static variables are to be used then we
will put them elsewhere and limit the optimization to reporting
code, rather that have it be used in the general case.
|
|
|
|
|
| |
Device count is never negative. Change 'dev_count' to be
uint32_t instead of int.
|
|
|
|
|
|
|
|
| |
Assumed size of 4M was too large and the test was failing because
'dd' was failing to perform its write.
Calculate the size we need to write with 'dd' instead, so we
don't overrun the device.
|
| |
|
|
|
|
|
|
| |
Use proper max size as a multiple of extent size.
And use 64bit arithmentic for validation of minsize.
(in release fix).
|
|
|
|
|
| |
Simplier code with struct assign.
Drop unneeded zeroing of zallocated memory.
|
|
|
|
|
| |
Since init_unknown_segtype returns zalloced memory,
NULL assign is not needed.
|
|
|
|
|
|
|
|
|
| |
aux updates:
prepare_vg now created clustered VG for cluster tests.
since dm-raid doesn't work in cluster, skip the cluster
test when someone checks for dm-raid target until fixed.
|
|
|
|
|
|
| |
Add some minor checks after first_seg(lv).
Use direct check for thin pool segment.
Drop some unneeded {}
|
|
|
|
| |
And also use static struct for _out_spec.
|
|
|
|
|
| |
use of tmp_rq2 is unrelated to tmp_rq - so use separate
variable.
|
| |
|
|
|
|
| |
Drop heades which do not provide any used symbols.
|
|
|
|
| |
Ensure the target line will work only with segment with pool.
|
|
|
|
| |
If the used stream has been stdout, do not close it.
|
|
|
|
|
| |
When a user has not proceeded with conversion,
print the error message why the command has failed.
|
|
|
|
| |
Do not leave replay uninitialized for internal error.
|
| |
|
|
|
|
|
|
|
|
| |
Reinstate the previous sort order for origin_size, so that LVs with
an empty origin_size continue to appear at the start of the list
not the end.
Ref. 9d445f371c7658969d6580748233dc33c3ba0453
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Support vgsplit for VGs with thin pools and thin volumes.
In case the thin data and thin metadata volumes are moved to a new VG,
move there also all related thin volumes and check that external origins
are also present in this new VG.
|
| |
|
|
|
|
|
|
|
| |
These were missing in distclean target under scripts dir:
blk_availability_init_red_hat
blk_availability_systemd_red_hat.service
blkdeactivate.sh
|
|
|
|
|
|
| |
This part of the code has not been used for ages, if ever.
If needed anytime in future, we should use some library
instead - libblkid?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use mpath filtering (enabled by devices/multipath_component_detection=1
lvm.conf setting) to avoid a situation in which we could end up with
duplicate PVs found. We need to filter out the mpath components and
use only the top-level multipath mapping instead for PV scans.
However, if the there are partitions on multipath components, we need
to filter out these partitions. This patch fixes it so those
partitions found on multipath components are filtered as well.
For example, let's consider following configuration:
The sda and sdb are mpath components, sda1 and sdb1 the partitions
on these components, mpath-test the mpath mapping and mpath-test1
the partition mapping - created automatically by kpartx right
after mpath-test creation. The PV resides on top.
(LVM PV)
|
mpath-test1
|
mpath-test
|
sda1 ---------- sdb1
\ | |/
sda sdb
E.g. for sda1 and sdb1, the code will detect this and it skips
the partition that belongs to the multipath component:
<snippet from the log>
#filters/filter-mpath.c:156 /dev/sda1: Device is a partition, using primary device /dev/sda for mpath component detection
130 #ioctl/libdm-iface.c:1724 dm status (253:2) OF[16384](*1)
131 #filters/filter-mpath.c:196 /dev/sda1: Skipping mpath component device
</snippet from the log>
Othewise, we'd see the same PV label on sda1/sdb1 and mpath-test1
at the same time ending up with "Duplicate PV found...".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dev_get_primary_dev fn now returns:
0 if the dev is already a primary dev
1 if the dev is a partition, primary dev is returned in "result" (output arg)
-1 on error
This way, we can better differentiate between the error state
and the state in which the dev supplied is not a partition
in the caller (this was same return value before).
Also, if we already have information about the device type,
we can check its major number against the list of known device
types (cmd->dev_types) directly, so we don't need to go through
the sysfs - we only check the major:minor pair which is a bit
more straightforward and faster. If the dev_types does not have
any info about this device type, the code just fallbacks to
the original sysfs interface to get the partition info.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
- move device type registration out of "type filter" (filter.c)
to a separate and new dev-type.[ch] for common use throughout the code
- the structure for keeping the major numbers detected for available
device types and available partitioning available is stored in
"dev_types" structure now
- move common partitioning detection code to dev-type.[ch] as well
together with other device-related functions bound to dev_types
(see dev-type.h for the interface)
The dev-type interface contains all common functions used to detect
subsystems/device types, signature/superblock recognition code,
type-specific device properties and other common device properties
(bound to dev_types), including partitioning support.
- add dev_types instance to cmd context as cmd->dev_types for common use
- use cmd->dev_types throughout as a central point for providing
information about device types
|
| |
|
| |
|
|
|
|
|
| |
And remove superfluous cmd->sysfs_dir and
set_sysfs_dir_path/sysfs_dir_path fn from lvm-globals.[ch].
|
|
|
|
|
|
|
| |
Fix the usecase when only PV list is specified.
With --poolmetadatasize PV list is used for metadata extents.
Without --poolmetadatasize PV list is used for 100% extension of LV.
Handle the case, when nothing could be resized (i.e. in dmeventd)
|