1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

17565 Commits

Author SHA1 Message Date
Zdenek Kabelac
80ef913872 device_id: fix memleak and free idname
Remove extra code path used only for 'free()'
and free(idname) on all paths that do not add it to list
and avoid memleak in few cases.
2021-04-23 22:57:08 +02:00
Zdenek Kabelac
65c4f81dc2 pvscan: fix memleak
Commit 25b58310e3 add zalloc()
without correspoding free(), switch to use cmd mempool.
2021-04-23 22:55:39 +02:00
Zdenek Kabelac
5e8307f4bf lvmcache: fix memory leak
With commit 0b18c25d93 there
was introduced  'zalloc()' for allocation of outdates pvs,
but no matching  'free()' is present.
Switch to use cmd mempool instead of adding free() code into
several places.
2021-04-23 22:54:41 +02:00
David Teigland
66dd481f46 man/help: move implied annotation
from
[ --type foo (implied) ]

to
[ --type foo] (implied)
2021-04-21 12:05:10 -05:00
David Teigland
d651b340e6 commands: use AUTOTYPE in definitions
If a cmd def implies an LV type without --type
in the required options, then include the implied
type in the cmd def as AUTOTYPE: <type>
instead of including the redundant --type foo
in the OO list of options.

Including an implied --type in the OO list would
often cause multiple cmd defs to potentially be
identical when options were used, and a user
command could match more than one cmd def.

The AUTOTYPE values are listed in man page and
help output as
 [ --type foo (implied) ]

If a user command includes --type, it will usually
match a cmd def with --type in the required options.
But, if the user command matches a cmd def with
AUTOTYPE, then the specifed --type and AUTOTYPE must
match.

The man-generator program has a new --check
option that compares cmd defs to find any cmd defs
that are equivalent with the use of options,
and should have their options adjusted.
2021-04-21 08:41:37 -05:00
David Teigland
7b77226df2 man-generator: add option to check for repeated command definitions
Compares cmd defs based on two principles for avoiding repeated
commands (where a given command could match more than one cmd def):

. a cmd def should be a unique combination of required
  option args and position args

. avoid adding optional options to a cmd def that if
  used would make the command match a different cmd def

FIXME: record when repeated cmd defs are found so we can
avoid reporting them twice, e.g. once for A vs B and
second time for B vs A.
2021-04-20 10:31:00 -05:00
David Teigland
a616abba03 config: improve description for event_activation 2021-04-19 13:29:17 -05:00
Zdenek Kabelac
5eac292925 make: generate 2021-04-19 14:54:37 +02:00
Zdenek Kabelac
d1f8978ac5 man: replace empty lines 2021-04-19 14:54:37 +02:00
Zdenek Kabelac
5f75f5e2bc man: typography for raid and report
Some enhancements for better man page rendering.
2021-04-19 14:54:37 +02:00
Zdenek Kabelac
9164a393de man: typography fixes
Correcting some usage of Bold and Italics (files).
Adding some missing SEE ALSO.
Fixing missed replaceable paths that are configurable.
Be careful about .P in .TP sections - need to use .sp for space line.
Use .UR/.UE for URL references.
2021-04-19 14:54:37 +02:00
Zdenek Kabelac
0f87b015b5 args: documentation enhancements
Use #DEFAULT_SYS_DIR# replaceable string for devicesfile
so the man pages installation respects configured settings.

Update some missing lvm.conf(5) references.
2021-04-19 14:40:14 +02:00
Zdenek Kabelac
b1ad32acd6 commands: update definitions for thin creation
Add missing VG into description of thin pool creation command.

Remove one duplicated thin-pool creation command.
Remove options --discards and --errorwhenfull from the list when the command describes
only creation of a thin volume - as these options do apply for thin-pool.
Also use here more correct name OO_LVCONVERT_THINPOOL instead of OO_LVCONVERT_THIN.

Reorder extra options for cache & thin-pool before common pool options.
Order consistenly --stripes and --stripesize after --extents option
so the options related to pools are better together.

Remove invalid snapshot creation description - since this case is
handled through our configurable spare volume creation.

Add some missing optional --type parameters for few command instancies.
2021-04-19 14:40:14 +02:00
Zdenek Kabelac
82e3b2e0ad tools: correct units description
Option --units takes also [Number] to express size in configurable
units.
2021-04-19 14:40:14 +02:00
Zdenek Kabelac
7bde16f5e1 man-generator: markup updates
Emit .ad l / .ad b less frequently around larger blocks
we want to keep left aligned.

Avoid emittting empty lines.

Reduce .HP usage and replace it with .TP.
However keep .HP for all option listings, as i.e. html rendering
can't handle well combintion of .TP an .HP together and .TP alone
is not indenting 2nd. line of long option line.
(For .TP line we don't need to emit .br)

Surround .SH with dots for better look.

For some .TP use plain more readable .I for a line.

Support rendering of optional [Number] (for --units).

Use better markup for units and instead of long markup string,
show individual units with markup.
2021-04-19 14:40:07 +02:00
Zdenek Kabelac
d94e5ba5af man-generator: use \(em
Use \(em in command title description and command multidefs.
2021-04-19 14:37:08 +02:00
Zdenek Kabelac
efd0939583 man-generator: decorate optional option prefixes
Enhance man typography decoration of optional option
prefixes like --[raid]writebeind and use regular font to render []
as these are not part of the option name itself.
2021-04-19 14:37:08 +02:00
Zdenek Kabelac
679116a9b8 man: with internal build install cache, thin, vdo
Do not install .7 man pages when building --without internal segtype
support for types: cache, thin, vdo.
2021-04-19 14:37:08 +02:00
Zdenek Kabelac
dc934b13b9 man: use editline reference
When compiled with editline, refer this in man page as well
instead of readline.
2021-04-19 14:37:07 +02:00
Zdenek Kabelac
54f98c94b4 makefiles: generate only needed text
Avoid storing see_also & _end parts in  generated doc,
since these we can easily 'cat' while making man pages.
2021-04-19 14:37:07 +02:00
Zdenek Kabelac
adfdfd9c58 makefiles: improved hyphenation replacement
Sed replacements script missed to properly replace several '-' to '\-'.
Replace it with simpler set of regexes.

Also add new target 'make checksed' for testing with examples,
where the replacement should or should not occure for easier testing.
2021-04-19 14:37:07 +02:00
David Teigland
b94f2a8b55 remove unused flag DEV_UDEV_INFO_MISSING 2021-04-16 16:01:19 -05:00
David Teigland
8daf5cd45f man/help: change LV type listing
Previously, accepted LV types were presented as a series of suffixes
after the "LV" on the command line.  The addition of many new types
resulted in this becoming too long, e.g

  lvconvert --type cache --cachepool LV LV_linear_striped_thinpool_vdo_vdopool_vdopooldata_raid

For man pages, move these types from the command line to a new line
dedicated to listing accepted LV types:

  lvconvert --type cache --cachepool LV LV1
  ...

  LV1 types: linear striped thinpool vdo vdopool vdopooldata raid

The special "LV1" is used as a reference to avoid confusion
with other LVs that may appear on the command line.  There
are currently no commands with more than one typed LV, but
if there are cases with more, then "LV2" could also be used.

For command line usage/-h output, drop the LV types from the
command line specification.  The more detailed is not needed
in the help output and can be found in the man page.
2021-04-14 17:25:10 -05:00
Zdenek Kabelac
353718785f man: typography
With to use .TP where it's easy and doesn't change layout
(since .HP is marked as deprecated) - but .TP is not always perfetc match.

Avoid submitting empty lines to troff and replace them mostly with .P
and use '.' at line start to preserve 'visual' presence of empty line
while editing man page manually when there is no extra space needed.

Fix some markup.

Add some missing SEE ALSO section.

Drop some white-space at end-of-lines.

Improve hyphenation logic so we do not split options.

Use '.IP numbers' only with first one the row (others in row
automatically derive this value)

Use automatic enumeration for .SH titles.

Guidelines in-use:
https://man7.org/linux/man-pages/man7/groff.7.html
https://www.gnu.org/software/groff/manual/html_node/Man-usage.html
https://www.gnu.org/software/groff/manual/html_node/Lists-in-ms.html
2021-04-14 11:04:04 +02:00
Zdenek Kabelac
0004ffa73a makefiles: fix replacing path for LVM_PATH
Man pages were generated with incorrect LVM_PATH.
2021-04-14 10:53:34 +02:00
Zdenek Kabelac
b75e26874e WHATS_NEW: update 2021-04-14 10:53:34 +02:00
Zdenek Kabelac
87a3ea7f8f Revert "thinpool: support lvconvert without zeroing"
This reverts commit 8e7690b798.

Actully this was bad idea - to make it on pair.
-Zn for thin-pools is already used - so here user must have
create new pool and swap existing thin-pool metadata into.

So reverting this commit to avoid any possible regression.
2021-04-14 10:53:34 +02:00
Zdenek Kabelac
94c264b975 Revert "tests: add check for lvconvert without zeroing"
This reverts commit accf324ccb.
2021-04-14 10:53:34 +02:00
Zdenek Kabelac
9a33388c1a tests: race on md raid still being hit on 5.12-rc6
Still hits the race in initialization:

kernel BUG at drivers/md/raid5.c:7549!
invalid opcode: 0000 [#1] SMP PTI
CPU: 0 PID: 525149 Comm: dmsetup Tainted: G           OEi
    --------- ---  5.12.0-0.rc6.184.fc35.x86_64 #1
Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007
RIP: 0010:raid5_run+0x40b/0x4b0 [raid456]
Code: 00 8b 83 3c 01 00 00 39 83 bc 00 00 00 0f 85 ac 00 00 00
      48 c7 44 24 08 00 00 00 00 8b bb 30 01 00 00 85 ff 0f 84
      88 fd ff ff <0f> 0b 48 8b 43 48 48 c7 c6 40 93 92 c0 48
      c7 c7 70 2c 93 c0 48 85
Call Trace:
 md_run+0x4d6/0xbc0
 ? super_validate+0x2e1/0x4b0 [dm_raid]
 raid_ctr+0x133e/0x281b [dm_raid]
 dm_table_add_target+0x167/0x330
 table_load+0x103/0x350
 ctl_ioctl+0x1b4/0x430
 ? dev_suspend+0x2c0/0x2c0
 dm_ctl_ioctl+0xa/0x10
 __x64_sys_ioctl+0x82/0xb0
 do_syscall_64+0x33/0x40
 entry_SYSCALL_64_after_hwframe+0x44/0xae
2021-04-12 12:04:50 +02:00
Zdenek Kabelac
9eca131256 make: generate
Oops, previous generate was not correct.
2021-04-12 11:12:40 +02:00
Zdenek Kabelac
396d93937d tests: enable for 5.12+ kernels
Should not longer kill kernel.
2021-04-12 10:47:06 +02:00
Zdenek Kabelac
31410447fd makefiles: add devmapper for devmapper-event
Older linkers do not take this dependency automatically from
libdevmapper-event so need to be passed with linker command.
2021-04-12 10:35:55 +02:00
Zdenek Kabelac
a5f83cb612 WHATS_NEW: updates 2021-04-12 09:54:16 +02:00
Zdenek Kabelac
151377dd50 make: generate 2021-04-12 09:54:16 +02:00
Zdenek Kabelac
19ff0d983e man: hyphenation improvements 2021-04-12 09:54:16 +02:00
Zdenek Kabelac
53fa1582d9 man-generator: spaces 2021-04-12 09:54:16 +02:00
Zdenek Kabelac
e01ce8e2ae man-generator: option description indented
Left indention is needed only for options, but is actually
unwanted for decription itself.
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
441b702362 man-generator: remove ',' between some options
It would be complicated to handle ',' alignment after hyphenation
changes ATM, but these commas seems to be there rather unneeded
so remove them and make the man output more clear.
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
d86b583644 man-generator: improve hyphenation for longer option list
Disable hyphenation around longer option lists (>42 chars)
and use \: to markup places for line splits.

The code ATM is somewhat mixtured so it's not easy to encapsulate
section .nh ... .hy.

ATM global _was_hyphen is used to properly finish sections after
disabled hyphenation.
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
b76283c4b3 man: use commas in SEE ALSO
Add ',' between each ref.
Use left alignment and no hyphenation.
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
f5efe1beb5 makefiles: no need for double Q
We already use $(Q) while calling macros
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
2e84dd47d4 makefiles: reuse CSCOPE_DIRS for ctags
Create ctags only from real source files.
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
ebf33323b9 makefiles: deps also for cxx
Generate deps also for .cxx.
Remove include dir deps - there is nothing to build.
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
75424dd692 libdm: replace deprecated security_context_t
Use 'char *' instead of deprecated security_context_t.
In more details i.e.:

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1776
2021-04-12 09:54:16 +02:00
Zdenek Kabelac
57b5bc9c87 configure: make aio optional
Add support for external AIO_CFLAGS and AIO_LIBS so user
can point to his own build - this might be useful when
user wants to use own libaio library.
2021-04-12 09:54:15 +02:00
Zdenek Kabelac
744afec6c0 configure: better support for use of --without
When --with-... option is used as --without-... it gets
assigned value 'no' - so support it better where we can.

Also remove 'shared' from help as it's not supported.
2021-04-12 09:54:15 +02:00
Zdenek Kabelac
aee0cd6530 makefiles: static linking enhancements 2021-04-12 09:54:15 +02:00
David Teigland
01f108c4d0 tests: skip autoactivation-metadata with lvmlockd
shared vgs are not autoactivated
2021-04-08 16:08:45 -05:00
David Teigland
0a28e3c44b Add metadata-based autoactivation property for VG and LV
The autoactivation property can be specified in lvcreate
or vgcreate for new LVs/VGs, and the property can be changed
by lvchange or vgchange for existing LVs/VGs.

 --setautoactivation y|n
 enables|disables autoactivation of a VG or LV.

Autoactivation is enabled by default, which is consistent with
past behavior.  The disabled state is stored as a new flag
in the VG metadata, and the absence of the flag allows
autoactivation.

If autoactivation is disabled for the VG, then no LVs in the VG
will be autoactivated (the LV autoactivation property will have
no effect.)  When autoactivation is enabled for the VG, then
autoactivation can be controlled on individual LVs.

The state of this property can be reported for LVs/VGs using
the "-o autoactivation" option in lvs/vgs commands, which will
report "enabled", or "" for the disabled state.

Previous versions of lvm do not recognize this property.  Since
autoactivation is enabled by default, the disabled setting will
have no effect in older lvm versions.  If the VG is modified by
older lvm versions, the disabled state will also be dropped from
the metadata.

The autoactivation property is an alternative to using the lvm.conf
auto_activation_volume_list, which is still applied to to VGs/LVs
in addition to the new property.

If VG or LV autoactivation is disabled either in metadata or in
auto_activation_volume_list, it will not be autoactivated.

An autoactivation command will silently skip activating an LV
when the autoactivation property is disabled.

To determine the effective autoactivation behavior for a specific
LV, multiple settings would need to be checked:
the VG autoactivation property, the LV autoactivation property,
the auto_activation_volume_list.  The "activation skip" property
would also be relevant, since it applies to both normal and auto
activation.
2021-04-07 15:32:49 -05:00
Zdenek Kabelac
6f6583afed libdm: fix compiling with older gcc 2021-04-06 22:31:23 +02:00