]> sourceware.org Git - lvm2.git/log
lvm2.git
3 years agotests: stress: Add single thread stress testing
Leo Yan [Thu, 3 Jun 2021 09:59:13 +0000 (17:59 +0800)]
tests: stress: Add single thread stress testing

This patch is to add the stress testing, which loops to create LV,
activate and deactivate LV in the single thread.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agotests: Add checking for lvmlockd log
Leo Yan [Thu, 3 Jun 2021 09:59:12 +0000 (17:59 +0800)]
tests: Add checking for lvmlockd log

Add checking for lvmlockd log, this can be used for the test cases which
are interested in the interaction with lvmlockd.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agotests: Cleanup idm context when prepare devices
Leo Yan [Thu, 3 Jun 2021 09:59:11 +0000 (17:59 +0800)]
tests: Cleanup idm context when prepare devices

For testing idm locking scheme, it's good to cleanup the idm context
before run the test cases.  This can give a clean environment for the
testing.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agotests: Support multiple backing devices
Leo Yan [Thu, 3 Jun 2021 09:59:10 +0000 (17:59 +0800)]
tests: Support multiple backing devices

In current implementation, the option "LVM_TEST_BACKING_DEVICE" only
supports to specify one backing device; this patch is to extend the
option to support multiple backing devices by using comma as separator,
e.g. below command specifies two backing devices:

  make check_lvmlockd_idm LVM_TEST_BACKING_DEVICE=/dev/sdj3,/dev/sdk3

This can allow the testing works on multiple drives and verify the
locking scheme if can work as expected for multiple drives case.  For
example, for Seagate IDM locking scheme, if a VG uses two PVs, every PV
is resident on a drive, thus the locking operations will be sent to two
drives respectively; so the extension for "LVM_TEST_BACKING_DEVICE" can
help to verify different drive configurations for locking.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agotests: Enable the testing for IDM locking scheme
Leo Yan [Thu, 3 Jun 2021 09:59:09 +0000 (17:59 +0800)]
tests: Enable the testing for IDM locking scheme

This patch is to introduce testing option LVM_TEST_LOCK_TYPE_IDM, with
specifying this option, the Seagate IDM lock manager will be launched as
backend for testing.  Also add the prepare and remove shell scripts for
IDM.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agopvchange: fix file locking deadlock
David Teigland [Wed, 2 Jun 2021 21:29:54 +0000 (16:29 -0500)]
pvchange: fix file locking deadlock

Calling clear_hint_file() to invalidate hints would acquire
the hints flock before the global flock which could cause deadlock.
The lock order requires the global lock to be taken first.

pvchange was always invalidating hints, which was unnecessary;
only invalidate hints when changing a PV uuid.  Because of the
lock ordering, take the global lock before clear_hint_file which
locks the hints file.

3 years agowritecache: don't pvmove device used by writecache
David Teigland [Wed, 2 Jun 2021 16:12:20 +0000 (11:12 -0500)]
writecache: don't pvmove device used by writecache

The existing check didn't cover the unusual case where the
cachevol exists on the same device as the origin LV.

3 years agowritecache: fix lv_on_pmem
David Teigland [Wed, 2 Jun 2021 15:51:12 +0000 (10:51 -0500)]
writecache: fix lv_on_pmem

dev_is_pmem on pv->dev requires a pv segment or it could segfault.

3 years agovdo: fix preload of kvdo
Zdenek Kabelac [Tue, 25 May 2021 22:19:28 +0000 (00:19 +0200)]
vdo: fix preload of kvdo

Commit 5bf1dba9eb8a8b77410e386e59dadeb27801b14e broke load of kvdo
kernel module - correct it by loading kvdo instead of trying dm-vdo.

3 years agolvremove: fix removing thin pool with writecache on data
David Teigland [Mon, 24 May 2021 21:08:27 +0000 (16:08 -0500)]
lvremove: fix removing thin pool with writecache on data

3 years agoenable command syntax for thin and writecache
David Teigland [Wed, 19 May 2021 19:36:40 +0000 (14:36 -0500)]
enable command syntax for thin and writecache

converting an LV with a writecache to thin pool data in
addition to previous attaching writecache to thin pool data

3 years agoconfigure: Add macro LOCKDIDM_SUPPORT
Leo Yan [Fri, 21 May 2021 02:56:37 +0000 (10:56 +0800)]
configure: Add macro LOCKDIDM_SUPPORT

The macro LOCKDIDM_SUPPORT is missed in configure.h.in file, thus when
execute "configure" command, it has no chance to add this macro in the
automatic generated header include/configure.h.

This patch adds macro LOCKDIDM_SUPPORT into configure.h.in.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agotools: Add support for "idm" lock type
Leo Yan [Fri, 7 May 2021 02:25:16 +0000 (10:25 +0800)]
tools: Add support for "idm" lock type

This patch is to update the comment and code to support "idm" lock type
which is used for LVM toolkit.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agolib: locking: Parse PV list for IDM locking
Leo Yan [Fri, 7 May 2021 02:25:15 +0000 (10:25 +0800)]
lib: locking: Parse PV list for IDM locking

For shared VG or LV locking, IDM locking scheme needs to use the PV
list assocated with VG or LV for sending SCSI commands, thus it requires
to use some places to generate PV list.

In reviewing the flow for LVM commands, the best place to generate PV
list is in the locking lib.  So this is why this patch parses PV list as
shown.  It iterates over all the PV nodes one by one, and compare with
the VG name or LV prefix string.  If any PV matches, then the PV is
added into the PV list.  Finally the PV list is sent to lvmlockd daemon.

Here as mentioned, it compares LV prefix string with the format
"lv_name_", the reason is it needs to find out all relevant PVs, e.g.
for the thin pool, it has LVs for metadata, pool, error, and raw LV, so
we can use the prefix string to find out all PVs belonging to the thin
pool.

For the global lock, it's not covered in this patch.  To avoid the egg
and chicken issue, we need to prepare the global lock ahead before any
locking can be used.  So the global lock's PV list is established in
lvmlockd daemon by iterating all drives with partition labeled with
"propeller".

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agolib: locking: Add new type "idm"
Leo Yan [Fri, 7 May 2021 02:25:14 +0000 (10:25 +0800)]
lib: locking: Add new type "idm"

We can consider the drive firmware a server to handle the locking
request from nodes, this essentially is a client-server model.
DLM uses the kernel as a central place to manage locks, so it also
complies with client-server model for locking operations.  This is
why IDM and DLM are similar with each other for their wrappers.

This patch largely works by generalizing the DLM code paths and then
providing degeneralized functions as wrappers for both IDM and DLM.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agolvmlockd: idm: Hook Seagate IDM wrapper APIs
Leo Yan [Fri, 7 May 2021 02:25:13 +0000 (10:25 +0800)]
lvmlockd: idm: Hook Seagate IDM wrapper APIs

To allow the IDM locking scheme be used by users, this patch hooks the
IDM wrapper; it also introducs a new locking type "idm" and we can use
it for global lock with option '-g idm'.

To support IDM locking type, the main change in the data structure is to
add pvs path arrary.  The pvs list is transferred from the lvm commands,
when lvmlockd core layer receives message, it extracts the message with
the keyword "path[idx]".  Finally, the pv list will pass to IDM lock
manager as the target drives for sending IDM SCSI commands.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agolvmlockd: idm: Introduce new locking scheme
Leo Yan [Fri, 7 May 2021 02:25:12 +0000 (10:25 +0800)]
lvmlockd: idm: Introduce new locking scheme

Alongside the existed locking schemes of DLM and sanlock, this patch is
to introduce new locking scheme: In-Drive-Mutex (IDM).

With the IDM support in the drive, the locks are resident in the drive,
thus, the locking lease is maintained in a central place: the drive
firmware.  We can consider this is a typical client-server model,
every host (or node) in the server cluster launches the request for
leasing mutex to a drive firmware, the drive firmware works as an
arbitrator to grant the mutex to a requester and it can reject other
applicants if the mutex has been acquired.  To satisfy the LVM
activation for different modes, IDM supports two locking modes:
exclusive and shareable.

Every IDM is identified with two IDs, one is the host ID and another is
the resource ID.  The resource ID is a unique identifier for what the
resource it's protected, in the integration with lvmlockd, the resource
ID is combined with VG's UUID and LV's UUID; for the global locking,
the bytes in resource ID are all zeros, and for the VG locking, the
LV's UUID is set as zero.   Every host can generate a random UUID and
use it as the host ID for the SCSI command, this ID is used to clarify
the ownership for mutex.

For easily invoking the IDM commands to drive, like other locking
scheme (e.g. sanlock), a daemon program named IDM lock manager is
created, so the detailed IDM SCSI commands are encapsulated in the
daemon, and lvmlockd uses the wrapper APIs to communicate with the
daemon program.

This patch introduces the IDM locking wrapper layer, it forwards the
locking requests from lvmlockd to the IDM lock manager, and returns the
result from drives' responding.

One thing should be mentioned is the IDM's LVB.  IDM supports LVB to max
7 bytes when stores into the drive, the most significant byte of 8 bytes
is reserved for control bits.  For this reason, the patch maps the
timestamp in macrosecond unit with its cached LVB, essentially, if any
timestamp was updated by other nodes, that means the local LVB is
invalidate.  When the timestamp is stored into drive's LVB, it's
possbile to cause time-going-backwards issue, which is introduced by the
time precision or missing synchronization acrossing over multiple nodes.
So the IDM wrapper fixes up the timestamp by increment 1 to the latest
value and write back into drive.

Currently LVB is used to track VG changes and its purpose is to notify
lvmetad cache invalidation when detects any metadata has been altered;
but lvmetad is not used anymore for caching metadata, LVB doesn't
really work.  It's possible that the LVB functionality could be useful
again in the future, so let's enable it for IDM in the first place.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
3 years agopost-release
Marian Csontos [Fri, 7 May 2021 20:36:56 +0000 (22:36 +0200)]
post-release

3 years agopre-release v2_03_12
Marian Csontos [Fri, 7 May 2021 20:34:45 +0000 (22:34 +0200)]
pre-release

3 years agomake: generate
Marian Csontos [Fri, 7 May 2021 15:44:43 +0000 (17:44 +0200)]
make: generate

3 years agotests: add lvextend-caches-on-thindata
David Teigland [Thu, 6 May 2021 20:59:37 +0000 (15:59 -0500)]
tests: add lvextend-caches-on-thindata

to test lvextend of thin pool data while it has
cache|writecache attached

3 years agowritecache: allow attaching to thin pool data
David Teigland [Thu, 6 May 2021 21:18:50 +0000 (16:18 -0500)]
writecache: allow attaching to thin pool data

3 years agotests: new lvextend-caches
David Teigland [Thu, 6 May 2021 19:43:10 +0000 (14:43 -0500)]
tests: new lvextend-caches

to test lvextend of LVs with attached cache|writecache

3 years agoblkid: simplify fs block size check
David Teigland [Wed, 5 May 2021 21:15:10 +0000 (16:15 -0500)]
blkid: simplify fs block size check

Only the LV path name is needed for blkid query,
the step of getting a dev struct is not needed.

3 years agodevices file: recommend removing filter
David Teigland [Wed, 5 May 2021 18:59:42 +0000 (13:59 -0500)]
devices file: recommend removing filter

When the devices file is enabled and the filter is set,
recommand that the user remove the filter from lvm.conf
since it's ignored.

3 years agopvremove: use consistent error message
David Teigland [Tue, 4 May 2021 18:03:25 +0000 (13:03 -0500)]
pvremove: use consistent error message

When the device is not a PV print
  "No PV found on device ..."

instead of
  "Failed to read lvm info for ... PVID ."

an earlier check had been added with a different
message for the same condition.

3 years agolabel_read_pvid: separate error and no-pvid
David Teigland [Fri, 23 Apr 2021 22:32:37 +0000 (17:32 -0500)]
label_read_pvid: separate error and no-pvid

error reading dev and no pvid on dev were both
returning 0.  make it easier for callers to
know which, if they care.

return 1 if the device could be read, regardless
of whether a pvid was found or not.
set has_pvid=1 if a pvid is found and 0 if no
pvid is found.

3 years agoRevert "cov: check label_read_pvid return value"
David Teigland [Fri, 23 Apr 2021 22:12:24 +0000 (17:12 -0500)]
Revert "cov: check label_read_pvid return value"

This reverts commit bf461b99c6d26e550835b77eaffe2204cbc9bed3.

label_read_pvid returns 0 for non-PVs and these callers want
to handle non-PVs.

3 years agomake: generate
Zdenek Kabelac [Thu, 22 Apr 2021 09:28:56 +0000 (11:28 +0200)]
make: generate

3 years agotests: use should for expected state
Zdenek Kabelac [Thu, 22 Apr 2021 16:28:50 +0000 (18:28 +0200)]
tests: use should for expected state

While we heavily try to spot arrays that are not yet in-sync,
some kernels tends to block our lvm2 command in kernel,
while we resume these smaller raid arrays even for 5 seconds.

But since the result is not really wrong - report these
check failures only as TEST WARNING.

3 years agocleanup: indent
Zdenek Kabelac [Fri, 23 Apr 2021 17:45:34 +0000 (19:45 +0200)]
cleanup: indent

3 years agomakefiles: add target for man-generator
Zdenek Kabelac [Fri, 23 Apr 2021 11:49:52 +0000 (13:49 +0200)]
makefiles: add target for man-generator

Add supporting target for recreating man-generator when dependencies needs it.

3 years agoman: add some resizing examples
Zdenek Kabelac [Fri, 23 Apr 2021 10:53:14 +0000 (12:53 +0200)]
man: add some resizing examples

Add some examples with -l% usage.

3 years agoman: add missing _iorig suffix
Zdenek Kabelac [Thu, 22 Apr 2021 10:37:18 +0000 (12:37 +0200)]
man: add missing _iorig suffix

3 years agoman: document fsadm -l option
Zdenek Kabelac [Thu, 22 Apr 2021 09:09:05 +0000 (11:09 +0200)]
man: document fsadm -l option

Missed -l option in man page, although users should prefer
lvresize -r when the also want to do a volume management,
as there they can specify i.e. extents for allocation.
Also mention dm-crypt support in command description.

3 years agoargs.h: bold command refference
Zdenek Kabelac [Fri, 23 Apr 2021 20:45:20 +0000 (22:45 +0200)]
args.h: bold command refference

3 years agoshellcheck: updates
Zdenek Kabelac [Thu, 22 Apr 2021 21:22:01 +0000 (23:22 +0200)]
shellcheck: updates

Ehance some shellcheck reported issues.

3 years agoclang: remove unused assignment
Zdenek Kabelac [Fri, 23 Apr 2021 15:27:44 +0000 (17:27 +0200)]
clang: remove unused assignment

3 years agoclang: ensure vg is defined
Zdenek Kabelac [Thu, 22 Apr 2021 20:42:54 +0000 (22:42 +0200)]
clang: ensure vg is defined

3 years agoclang: avoid possible use-after-free
Zdenek Kabelac [Thu, 22 Apr 2021 20:08:57 +0000 (22:08 +0200)]
clang: avoid possible use-after-free

If the 'act' has been already processed by add_client_result()
it could have been possibly release - so avoid accessin 'act->'
afterward and go for next item directly.

3 years agoclang: always initialized values
Zdenek Kabelac [Thu, 22 Apr 2021 19:49:30 +0000 (21:49 +0200)]
clang: always initialized values

3 years agocov: convert to code that analyzer may better understand
Zdenek Kabelac [Thu, 22 Apr 2021 13:06:48 +0000 (15:06 +0200)]
cov: convert to code that analyzer may better understand

Switch to code that is problematic to analyzer

3 years agocov: use correct enum type
Zdenek Kabelac [Thu, 22 Apr 2021 15:31:17 +0000 (17:31 +0200)]
cov: use correct enum type

Correct function declaration.

3 years agocov: explicitely ignore return value
Zdenek Kabelac [Thu, 22 Apr 2021 14:49:34 +0000 (16:49 +0200)]
cov: explicitely ignore return value

3 years agocov: check return value
Zdenek Kabelac [Thu, 22 Apr 2021 15:00:45 +0000 (17:00 +0200)]
cov: check return value

Log problems on fail path.

3 years agocov: fix typo and reduce stack usage
Zdenek Kabelac [Thu, 22 Apr 2021 13:27:58 +0000 (15:27 +0200)]
cov: fix typo and reduce stack usage

Buffer on stack was for single LV name plus some  short text around.
Use of 50* was a typo so use correly 50+.

3 years agocov: ensure fid is not null
Zdenek Kabelac [Thu, 22 Apr 2021 13:11:23 +0000 (15:11 +0200)]
cov: ensure fid is not null

3 years agocov: ensure segtype is not null
Zdenek Kabelac [Thu, 22 Apr 2021 13:11:08 +0000 (15:11 +0200)]
cov: ensure segtype is not null

3 years agocov: add explicit check for external not being null
Zdenek Kabelac [Fri, 23 Apr 2021 20:47:18 +0000 (22:47 +0200)]
cov: add explicit check for external not being null

Although the code should never evaluate for null external
add explict check for analyzer.

3 years agocov: daemonize avoid leak of FD on error path
Zdenek Kabelac [Thu, 22 Apr 2021 13:05:31 +0000 (15:05 +0200)]
cov: daemonize avoid leak of FD on error path

Use our common patter for reopening FDs to /dev/null
that avoids leaking FD on error path.

3 years agocov: check setup_devices return code
Zdenek Kabelac [Thu, 22 Apr 2021 10:34:16 +0000 (12:34 +0200)]
cov: check setup_devices return code

3 years agocov: avoid passed invalid dummy structure
Zdenek Kabelac [Thu, 22 Apr 2021 10:32:35 +0000 (12:32 +0200)]
cov: avoid passed invalid dummy structure

Altough this dummy structure should not be using pe_size anywhere,
make analyzer happier and avoid PV structures with zero pe_size.

3 years agocov: check label_read_pvid return value
Zdenek Kabelac [Thu, 22 Apr 2021 10:31:49 +0000 (12:31 +0200)]
cov: check label_read_pvid return value

Command can early exit when function returns 0.

3 years agocov: check _insert_dev return value
Zdenek Kabelac [Thu, 22 Apr 2021 10:30:26 +0000 (12:30 +0200)]
cov: check _insert_dev return value

Although we try later to validate device was inserted,
we can validate return value and early-exit.

3 years agocov: add checks to prevent NULL dereference
Zdenek Kabelac [Thu, 22 Apr 2021 13:08:04 +0000 (15:08 +0200)]
cov: add checks to prevent NULL dereference

3 years agocov: avoid leak when repeating options
Zdenek Kabelac [Thu, 22 Apr 2021 15:53:45 +0000 (17:53 +0200)]
cov: avoid leak when repeating options

Do not leak previous buffer, when option is set more then once.

3 years agocov: set error_vg only when pointer is non null
Zdenek Kabelac [Thu, 22 Apr 2021 10:41:25 +0000 (12:41 +0200)]
cov: set error_vg only when pointer is non null

3 years agocov: ensure there is space for 0 at eol
Zdenek Kabelac [Thu, 22 Apr 2021 13:08:34 +0000 (15:08 +0200)]
cov: ensure there is space for 0 at eol

Reserve 1 char for \0.

3 years agodev-cache: change message level to debug
Zdenek Kabelac [Fri, 23 Apr 2021 19:58:06 +0000 (21:58 +0200)]
dev-cache: change message level to debug

This case happens when i.e. we convert LV to another type,
when we change existing LV into a different type - so change
to debug level and avoid confusing users with message about
Device path  not match.

We may eventually enhnace caching code to drop cached info
after taking lock and reading VG.

3 years agodevicesfile: use pool memory
Zdenek Kabelac [Fri, 23 Apr 2021 13:03:11 +0000 (15:03 +0200)]
devicesfile: use pool memory

Switch to use command mempool instead of zalloc() as relase
part would be required otherwise.

3 years agodevice_id: fix memleak and free idname
Zdenek Kabelac [Thu, 22 Apr 2021 22:25:14 +0000 (00:25 +0200)]
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.

3 years agopvscan: fix memleak
Zdenek Kabelac [Fri, 23 Apr 2021 13:11:36 +0000 (15:11 +0200)]
pvscan: fix memleak

Commit 25b58310e3d606a85abc9bd50991ccb7ddcbfe25 add zalloc()
without correspoding free(), switch to use cmd mempool.

3 years agolvmcache: fix memory leak
Zdenek Kabelac [Fri, 23 Apr 2021 12:44:57 +0000 (14:44 +0200)]
lvmcache: fix memory leak

With commit 0b18c25d934564015402de33e15a267045ed1b8c 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.

3 years agoman/help: move implied annotation
David Teigland [Wed, 21 Apr 2021 17:05:10 +0000 (12:05 -0500)]
man/help: move implied annotation

from
[ --type foo (implied) ]

to
[ --type foo] (implied)

3 years agocommands: use AUTOTYPE in definitions
David Teigland [Tue, 20 Apr 2021 22:03:09 +0000 (17:03 -0500)]
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.

3 years agoman-generator: add option to check for repeated command definitions dev-dct-cmd-defs-check
David Teigland [Tue, 20 Apr 2021 15:24:47 +0000 (10:24 -0500)]
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.

3 years agoconfig: improve description for event_activation
David Teigland [Mon, 19 Apr 2021 18:29:17 +0000 (13:29 -0500)]
config: improve description for event_activation

3 years agomake: generate
Zdenek Kabelac [Thu, 15 Apr 2021 18:11:52 +0000 (20:11 +0200)]
make: generate

3 years agoman: replace empty lines
Zdenek Kabelac [Fri, 16 Apr 2021 13:57:01 +0000 (15:57 +0200)]
man: replace empty lines

3 years agoman: typography for raid and report
Zdenek Kabelac [Thu, 15 Apr 2021 20:18:05 +0000 (22:18 +0200)]
man: typography for raid and report

Some enhancements for better man page rendering.

3 years agoman: typography fixes
Zdenek Kabelac [Thu, 15 Apr 2021 11:16:41 +0000 (13:16 +0200)]
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.

3 years agoargs: documentation enhancements
Zdenek Kabelac [Thu, 15 Apr 2021 19:41:33 +0000 (21:41 +0200)]
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.

3 years agocommands: update definitions for thin creation
Zdenek Kabelac [Fri, 16 Apr 2021 16:31:27 +0000 (18:31 +0200)]
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.

3 years agotools: correct units description
Zdenek Kabelac [Fri, 16 Apr 2021 19:29:10 +0000 (21:29 +0200)]
tools: correct units description

Option --units takes also [Number] to express size in configurable
units.

3 years agoman-generator: markup updates
Zdenek Kabelac [Fri, 16 Apr 2021 22:21:31 +0000 (00:21 +0200)]
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.

3 years agoman-generator: use \(em
Zdenek Kabelac [Fri, 16 Apr 2021 22:21:04 +0000 (00:21 +0200)]
man-generator: use \(em

Use \(em in command title description and command multidefs.

3 years agoman-generator: decorate optional option prefixes
Zdenek Kabelac [Thu, 15 Apr 2021 18:00:09 +0000 (20:00 +0200)]
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.

3 years agoman: with internal build install cache, thin, vdo
Zdenek Kabelac [Mon, 19 Apr 2021 09:24:16 +0000 (11:24 +0200)]
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.

3 years agoman: use editline reference
Zdenek Kabelac [Fri, 16 Apr 2021 12:40:42 +0000 (14:40 +0200)]
man: use editline reference

When compiled with editline, refer this in man page as well
instead of readline.

3 years agomakefiles: generate only needed text
Zdenek Kabelac [Sun, 18 Apr 2021 18:37:37 +0000 (20:37 +0200)]
makefiles: generate only needed text

Avoid storing see_also & _end parts in  generated doc,
since these we can easily 'cat' while making man pages.

3 years agomakefiles: improved hyphenation replacement
Zdenek Kabelac [Wed, 14 Apr 2021 12:39:17 +0000 (14:39 +0200)]
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.

3 years agoremove unused flag DEV_UDEV_INFO_MISSING
David Teigland [Fri, 16 Apr 2021 21:01:19 +0000 (16:01 -0500)]
remove unused flag DEV_UDEV_INFO_MISSING

3 years agoman/help: change LV type listing
David Teigland [Wed, 14 Apr 2021 21:34:04 +0000 (16:34 -0500)]
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.

3 years agoman: typography
Zdenek Kabelac [Tue, 13 Apr 2021 13:26:54 +0000 (15:26 +0200)]
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

3 years agomakefiles: fix replacing path for LVM_PATH
Zdenek Kabelac [Tue, 13 Apr 2021 13:26:05 +0000 (15:26 +0200)]
makefiles: fix replacing path for LVM_PATH

Man pages were generated with incorrect LVM_PATH.

3 years agoWHATS_NEW: update
Zdenek Kabelac [Wed, 14 Apr 2021 08:28:37 +0000 (10:28 +0200)]
WHATS_NEW: update

3 years agoRevert "thinpool: support lvconvert without zeroing"
Zdenek Kabelac [Wed, 14 Apr 2021 08:26:16 +0000 (10:26 +0200)]
Revert "thinpool: support lvconvert without zeroing"

This reverts commit 8e7690b7980ad3bc6e7c38d6e2028f885751c355.

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.

3 years agoRevert "tests: add check for lvconvert without zeroing"
Zdenek Kabelac [Wed, 14 Apr 2021 08:53:21 +0000 (10:53 +0200)]
Revert "tests: add check for lvconvert without zeroing"

This reverts commit accf324ccba681ad06cd8bcb27ead17ec191a471.

3 years agotests: race on md raid still being hit on 5.12-rc6
Zdenek Kabelac [Mon, 12 Apr 2021 10:04:50 +0000 (12:04 +0200)]
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

3 years agomake: generate
Zdenek Kabelac [Mon, 12 Apr 2021 09:11:51 +0000 (11:11 +0200)]
make: generate

Oops, previous generate was not correct.

3 years agotests: enable for 5.12+ kernels
Zdenek Kabelac [Mon, 12 Apr 2021 08:47:06 +0000 (10:47 +0200)]
tests: enable for 5.12+ kernels

Should not longer kill kernel.

3 years agomakefiles: add devmapper for devmapper-event
Zdenek Kabelac [Mon, 12 Apr 2021 08:35:55 +0000 (10:35 +0200)]
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.

3 years agoWHATS_NEW: updates
Zdenek Kabelac [Mon, 12 Apr 2021 07:49:23 +0000 (09:49 +0200)]
WHATS_NEW: updates

3 years agomake: generate
Zdenek Kabelac [Thu, 8 Apr 2021 19:08:48 +0000 (21:08 +0200)]
make: generate

3 years agoman: hyphenation improvements
Zdenek Kabelac [Sat, 10 Apr 2021 22:15:51 +0000 (00:15 +0200)]
man: hyphenation improvements

3 years agoman-generator: spaces
Zdenek Kabelac [Sun, 11 Apr 2021 18:10:21 +0000 (20:10 +0200)]
man-generator: spaces

3 years agoman-generator: option description indented
Zdenek Kabelac [Sun, 11 Apr 2021 17:53:16 +0000 (19:53 +0200)]
man-generator: option description indented

Left indention is needed only for options, but is actually
unwanted for decription itself.

3 years agoman-generator: remove ',' between some options
Zdenek Kabelac [Sun, 11 Apr 2021 12:28:51 +0000 (14:28 +0200)]
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.

3 years agoman-generator: improve hyphenation for longer option list
Zdenek Kabelac [Sat, 10 Apr 2021 22:47:00 +0000 (00:47 +0200)]
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.

3 years agoman: use commas in SEE ALSO
Zdenek Kabelac [Sun, 11 Apr 2021 19:11:02 +0000 (21:11 +0200)]
man: use commas in SEE ALSO

Add ',' between each ref.
Use left alignment and no hyphenation.

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