summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvresize: add new options and defaults for fs handlingdev-dct-lvresize-13David Teigland2022-09-0929-192/+3952
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new option "--fs String" for lvresize/lvreduce/lvextend controls the handling of file systems before/after resizing the LV. --resizefs is the same as --fs resize. The new option "--fsmode String" can be used to control mounting and unmounting of the fs during resizing. Possible --fs values: checksize Only applies to reducing size; does nothing for extend. Check the fs size and reduce the LV if the fs is not using the affected space, i.e. the fs does not need to be shrunk. Fail the command without reducing the fs or LV if the fs is using the affected space. resize Resize the fs using the fs-specific resize command. This may include mounting, unmounting, or running fsck. See --fsmode to control mounting behavior, and --nofsck to disable fsck. resize_fsadm Use the old method of calling fsadm to handle the fs (deprecated.) Warning: this option does not prevent lvreduce from destroying file systems that are unmounted (or mounted if prompts are skipped.) ignore Resize the LV without checking for or handling a file system. Warning: using ignore when reducing the LV size may destroy the file system. Possible --fsmode values: manage Mount or unmount the fs as needed to resize the fs, and attempt to restore the original mount state at the end. nochange Do not mount or unmount the fs. If mounting or unmounting is required to resize the fs, then do not resize the fs or the LV and fail the command. offline Unmount the fs if it is mounted, and resize the fs while it is unmounted. If mounting is required to resize the fs, then do not resize the fs or the LV and fail the command. Notes on lvreduce: When no --fs or --resizefs option is specified: . lvextend default behavior is fs ignore. . lvreduce default behavior is fs checksize (includes activating the LV.) With the exception of --fs resize_fsadm|ignore, lvreduce requires the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE. FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV, which determines if reducing the fs is necessary.
* lvresize: restructure codeDavid Teigland2022-09-0915-557/+889
| | | | | Rewrite top level resize function to prepare for adding new fs resizing.
* remove libblkid flag BLKID_SUBLKS_FSINFODavid Teigland2022-09-091-1/+1
| | | | | This flag is not needed in fs_block_size_and_type() added in the previous commit.
* fix fs block size detectionDavid Teigland2022-09-099-42/+84
| | | | | blkid_get_tag_value() is not a reliable way to query the fs BLOCK_SIZE, so use the "probe" functions instead.
* gitignore: updateZdenek Kabelac2022-09-072-3/+19
|
* tests: cache use 300M XFSZdenek Kabelac2022-09-074-15/+15
|
* tests: fsadm 300m xfsZdenek Kabelac2022-09-073-21/+23
|
* tests: writecache adapt to 300M XFSZdenek Kabelac2022-09-076-42/+40
|
* tests: use conv=fdatasyncZdenek Kabelac2022-09-072-9/+9
| | | | | When we only need wait for result - avoid using slow 'oflag=sync' with virtual layers
* tests: add /dev requirementZdenek Kabelac2022-09-071-12/+7
| | | | | | | | This test could only be run when user passes LVM_TEST_DEVDIR=/dev as it requires and expects actions to be going in this dir, skip otherwise. Also 'extend_filter' manages multiple args in on lvm.conf update.
* tests: add thin requirementZdenek Kabelac2022-09-071-0/+2
|
* tests: lvextend update for 300M XFSZdenek Kabelac2022-09-072-12/+12
|
* tests: no caching for blkid in testingZdenek Kabelac2022-09-071-1/+1
|
* tests: make damage optionalZdenek Kabelac2022-09-071-2/+3
| | | | | Investigate how to damage thin-pool across different versions/platforms. Until them - use 'should' for test result.
* tests: check for at least 1G of RAMZdenek Kabelac2022-09-071-0/+2
| | | | This test requires quite some RAM to be there.
* tests: remove slashZdenek Kabelac2022-09-071-1/+1
|
* tests: skip this test for 5.19Zdenek Kabelac2022-09-071-0/+4
| | | | | | mdraid has some breakage - so 5.19 is crashing (possibly even some more older version - that can be added as well) Test seems to pass with 6.0-rc kernel.
* tests: vdo emulation without vdo binaryZdenek Kabelac2022-09-072-2/+11
| | | | | Avoid inserting 'vdo' binary into path - and use alias and VDO_BINARY shell vars for emulation.
* tests: rework makefileZdenek Kabelac2022-09-071-118/+95
| | | | | | Improve dependency tracking Use 'foreach()' with better tracing support Link whole 'shell' dir instead of linking individual *.sh files
* make: update make.tmplZdenek Kabelac2022-09-072-13/+50
| | | | | | Add new define 'newline' for use in 'foreach()' Add new $(SHOW) for makefile printing output Add 'make print-VAR' for easier debugging of Makefiles' variables.
* python: variable without destdirZdenek Kabelac2022-09-071-1/+1
| | | | PYTHON_PREFIX without $(DESTDIR)
* gcc: eliminate warningsZdenek Kabelac2022-09-072-2/+2
| | | | | Gcc starts to show new warning - although unlikely to be able to hit initialize variables to 0.
* report: fix lv_active column type from STR to BINPeter Rajnoha2022-09-064-7/+10
| | | | | | | | Fix lv_active to be of BIN type instead of STR. This allows lv_active to follow the report/binary_values_as_numeric setting as well as --binary cmd line switch. Also, it makes it possible to use -S|--select with either textual or numeric representation of the value, like 'lvs -S active=active' but also 'lvs -S active=1'.
* vgimportdevices: fix locking when creating devices fileDavid Teigland2022-08-303-6/+12
| | | | | | | Take the devices file lock before creating a new devices file. (Was missed by the change to preemptively create the devices file prior to setup_devices(), which was done to improve the error path.)
* vgimportdevices: change result when devices are not addedDavid Teigland2022-08-302-13/+336
| | | | | | | | | | | | | | | | | | | | When using --all, if one VG is skipped, continue adding other VGs, and do not return an error from the command if some VGs are added. (A VG is skipped if it's missing PVs.) If the command fails during devices file setup or device scanning, then remove the devices file if it has been newly created by the command, and exit with an error. If devices from a named VG are not imported (e.g. the VG is missing devices), then remove the devices file if it has been newly created by the command, and exit with an error. If --all VGs are being imported, and no devices are found to include in the devices file, then remove the devices file if it has been newly created by the command, and exit with an error.
* mm: use mallinfo2 when availableZdenek Kabelac2022-08-302-3/+11
| | | | | Switch to mallinfo2() from a deprecated mallinfo() glibc call since struct size members where to small for 64b CPUs.
* mm: preallocate memory only with glibcZdenek Kabelac2022-08-301-1/+6
| | | | Use mallinfo() only with glibc.
* configure: remove some obsolete or duplicate checksZdenek Kabelac2022-08-303-178/+5
| | | | As autoupdate suggested, drop unneeded checks.
* configure: check for mallinfo2Zdenek Kabelac2022-08-303-1/+10
|
* thin: rename internal functionZdenek Kabelac2022-08-3010-66/+70
| | | | | | | | Names matching internal code layout. Functionc in thin_manip.c uses thin_pool in its name. Keep 'pool' only for function working for both cache and thin pools. No change of functionality.
* report: values: add note about self-decriptive values to reportPeter Rajnoha2022-08-262-0/+54
|
* args: add ARG_NONINTERACTIVE for cmds not supported in lvm shellPeter Rajnoha2022-08-265-1/+13
| | | | | | | | | | | Certain args can't be used in lvm shell ("interactive mode") because they are not supported there. Add ARG_NONINTERACTIVE flag to mark such args and error out if we're in interactive mode and at the same time we detect use of such argument. Currently, this is the case for --reportformat arg - we don't support changing the format per command in lvm shell. The whole shell is running under a reportformat chosen at shell's start.
* libdm: report: fix escaping of JSON quote char in reported fieldsPeter Rajnoha2022-08-242-16/+6
| | | | | | | | | | | | | | | | | | Commit 73ec3c954b21522352b6f5cce9a700d6bf30ccf4 added a way to print only a part of the report string (repstr) to support decoding individual string list items out of repstr. The repstr is normally printed through _safe_repstr_output so that any JSON_QUOTE character ('"') found within the repstr is escaped to not interfere with value quoting in JSON format. However, the commit 73ec3c954b21522352b6f5cce9a700d6bf30ccf4 missed checking the 'len' argument passed to _safe_repstr_output function when adding the rest of the repstr after all previous JSON_QUOTE characters were escaped (when calling the last dm_pool_grow_object). When 'len' is 0, we need to calculate the 'len' ourselves in the function by simply calling strlen. This is because 'len' is passed to the function only if we're taking a part of repstr, not as a whole.
* shell: add pre-cmd log report object type and enable lastlog for itPeter Rajnoha2022-08-224-4/+10
| | | | | | | If we failed or logged anything before we actually execute given command in lvm shell, we couldn't report the log using lastlog command after. This patch adds specific 'pre-cmd' log report object type to identify such log messages and enables lastlog to report even this log.
* devices file: fix pvcreate --uuid matching pvid entry with no device idDavid Teigland2022-08-192-3/+17
| | | | | | pvcreate with --uuid would segfault if a devices file entry matched the specified pvid, but the devices file entry had no device_id, which could happen if the entry has a devname idtype.
* devices: drop double // from sysfs pathZdenek Kabelac2022-08-193-7/+7
| | | | dm_sysfs_dir() comes internally as /sys/.
* dmsetup: check also for ouf of range valueZdenek Kabelac2022-08-191-1/+2
| | | | Check errno result from strtoull().
* mm: remove libaio from being skippedZdenek Kabelac2022-08-191-1/+0
| | | | | Since libaio is now used also in critical section, keep the libaio locked in memory.
* vdo: extend volume and pool without flushZdenek Kabelac2022-08-193-1/+8
| | | | | | | | | | | | When the volume size is extended, there is no need to flush IO operations (nothing can be targeting new space yet). VDO target is supported as target that can safely work with this condition. Such support is also needed, when extending VDOPOOL size while the pool is reaching its capacity - since this allows to continue working without reaching 'out-of-space' condition due to flushing of all in flight IO.
* vdo: reset errno before strtoullZdenek Kabelac2022-08-191-0/+1
| | | | Missed errno reset in commit ebad057579aeff0980a1b8af7eaacd56e62ed0c9.
* config: check for possible mempool errors in _out_line_fnPeter Rajnoha2022-08-171-3/+9
|
* config: remove unnecessary copy of config line's space prefix before printingPeter Rajnoha2022-08-171-5/+3
| | | | | | | | | | | | | | | | When we wanted to insert '#' before a config line (to comment it out), we used dm_pool_strndup to temporarily copy the space prefix first so we can assemble the final line with: "<space_prefix># <key>=<value>": out of original: "<space_prefix><key>=<value>". The space_prefix copy is not necessary, we can just use fprintf's precision modifier "%.*s" to print the exact part if we alrady know space_prefix length.
* lvmconfig: add --valuesonly optionPeter Rajnoha2022-08-177-3/+43
| | | | | | | | | | | | | | | | | | | | | The new --valuesonly option causes the lvmconfig output to contain only values without keys for each config node. This is practical mainly in case where we use lvmconfig in scripts and we want to assign the value to a different custom key or simply output the value itself without the key. For example: # lvmconfig --type full activation/raid_fault_policy raid_fault_policy="warn" # lvmconfig --type full activation/raid_fault_policy --valuesonly "warn" # my_var=$(lvmconfig --type full activation/raid_fault_policy --valuesonly) # echo $my_var "warn"
* report: report numeric values (not string synonyms) for NUM and BIN fields ↵Peter Rajnoha2022-08-164-3/+19
| | | | | | | | | | | | | | | | with json_std format Internally, NUM and BIN fields are marked as DM_REPORT_FIELD_TYPE_NUM_NUMBER through libdevmapper API. The new 'json_std' format mandates that the report string representing such a value must be a number, not an arbitrary string. This is because numeric values in 'json_std' format do not have double quotes around them. This practically means, we can't use string synonyms ("named reserved values") for such values and the report string must always represent a proper number. With 'json' and 'basic' formats, this is not an issue because 'basic' format doesn't have any structure or typing at all and 'json' format puts all values in quotes, including numeric ones.
* _vg_read_raw_area: fix segfault caused by using null pointerWu Guanghao2022-08-151-1/+1
| | | | | | | | | | | | | When we tested lvm2, the kernel injected various random faults. (gdb) bt ... (gdb) p vg $1 = (struct volume_group *) 0x0 (gdb) p use_previous_vg $2 = (unsigned int *) 0x0 Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
* autoreconf: support newer archsZdenek Kabelac2022-08-157-6690/+8343
| | | | | | | | | | | Update to more recent version of configure script to support more new architecture types like RISCV64. Tools in use ATM: autoconf-2.71-3.fc37.noarch autoconf-archive-2022.02.11-3.fc37.noarch automake-1.16.5-9.fc37.noarch Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2118243
* vdo: fix --vdosettings parserZdenek Kabelac2022-08-151-5/+9
| | | | | Parser was incorrectly parsing vdo_use_features - move the skip of 'use_' prefix into internal loop which handles skipping of '_'.
* vdo: use only verbose log level for reformatingZdenek Kabelac2022-08-151-2/+8
| | | | | | | | | When lvcreate is makeing VDO pool and user has not specified -V size, ATM we actually run 'vdoformat' twice to get properly 'extent' aligned size matching lvm2 properties - so the 2nd. run of vdoformat actually can stay with 'log_verbose()' so the standard printed result is not showing confusing info (which is now also correctly using print_unless_silent)
* lvconvert: correct test support for vdo-poolZdenek Kabelac2022-08-153-2/+7
|
* WHATS_NEW: updatePeter Rajnoha2022-08-112-1/+3
|