Projects
Mega:23.09
lvm2
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
_service:tar_scm:lvm2.spec
Changed
@@ -8,7 +8,7 @@ %global use_lockd_dlm 0 %endif -%ifnarch x86_64 aarch64 riscv64 sw_64 +%ifnarch x86_64 aarch64 riscv64 sw_64 loongarch64 ppc64le %global use_lockd_sanlock 0 %endif @@ -32,7 +32,7 @@ %global libselinux_version 1.30.19-4 %global persistent_data_version 0.7.0-0.1.rc6 %global sanlock_version 3.3.0-2 -%global device_mapper_version 1.02.182 +%global device_mapper_version 1.02.196 %global systemd_version 189-3 %global dracut_version 002-18 %global util_linux_version 2.24 @@ -42,13 +42,13 @@ %global dlm_version 4.0.6-2 Name: lvm2 -Version: 2.03.21 -Release: 3 +Version: 2.03.22 +Release: 4 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD URL: http://sourceware.org/lvm2 -Source0: https://sourceware.org/pub/lvm2/releases/LVM2.2.03.21.tgz +Source0: https://sourceware.org/pub/lvm2/releases/LVM2.2.03.22.tgz Patch1: 0001-lvm2-set-default-preferred_names.patch Patch2: 0002-lvm2-default-allow-changes-with-duplicate-pvs.patch Patch3: 0003-bugfix-lvm2-add-SSD.patch @@ -64,6 +64,7 @@ Patch13: 0013-udev-repeat.patch Patch14: 0014-use-sync-io-read-bcache-by-defaults.patch Patch15: 0015-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch +Patch16: 0016-dm-event-release-buffer-on-dm_event_get_version.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -490,6 +491,18 @@ %changelog +* Mon Jan 22 2024 peng.zou <peng.zou@shingroup.cn> - 8:2.03.22-4 +- lvm2-lockd: add suport for ppc64le + +* Wed Nov 22 2023 wangxiaomeng <wangxiaomeng@kylinos.cn> - 8:2.03.22-3 +- lvmlockd: add suport for loongarch64 + +* Tue Dec 19 2023 wangzhiqiang <wangzhiqiang95@huawei.com> - 8:2.03.22-2 +- dm-event: release buffer on dm_event_get_version + +* Fri Nov 03 2023 liweigang <weigangli99@gmail.com> - 8:2.03.22-1 +- update to version 2.03.22 + * Mon Sep 11 2023 EastDong <xudong23@iscas.ac.cn> - 8:2.03.21-3 - fixed not building .service files when building on RISC-V architecture
View file
_service:tar_scm:0016-dm-event-release-buffer-on-dm_event_get_version.patch
Added
@@ -0,0 +1,45 @@ +From a203499ba32aabec0e8a9002517e1608e4e83b2c Mon Sep 17 00:00:00 2001 +From: Zdenek Kabelac <zkabelac@redhat.com> +Date: Mon, 25 Sep 2023 11:47:40 +0200 +Subject: PATCH dm-event: release buffer on dm_event_get_version + +Avoid memory leak in this function. +--- + daemons/dmeventd/libdevmapper-event.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c +index 9e4dd2469..0aabc03e6 100644 +--- a/daemons/dmeventd/libdevmapper-event.c ++++ b/daemons/dmeventd/libdevmapper-event.c +@@ -844,6 +844,7 @@ int dm_event_get_registered_device(struct dm_event_handler *dmevh, int next) + int dm_event_get_version(struct dm_event_fifos *fifos, int *version) { + char *p; + struct dm_event_daemon_message msg = { 0 }; ++ int ret = 0; + + if (daemon_talk(fifos, &msg, DM_EVENT_CMD_HELLO, NULL, NULL, 0, 0)) + return 0; +@@ -851,13 +852,17 @@ int dm_event_get_version(struct dm_event_fifos *fifos, int *version) { + *version = 0; + + if (!p || !(p = strchr(p, ' '))) /* Message ID */ +- return 0; ++ goto out; + if (!(p = strchr(p + 1, ' '))) /* HELLO */ +- return 0; ++ goto out; + if ((p = strchr(p + 1, ' '))) /* HELLO, once more */ + *version = atoi(p); + +- return 1; ++ ret = 1; ++out: ++ free(msg.data); ++ ++ return ret; + } + + void dm_event_log_set(int debug_log_level, int use_syslog) +-- +2.39.3 \ No newline at end of file
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="url">git@gitee.com:src-openeuler/lvm2.git</param> <param name="scm">git</param> - <param name="revision">openEuler-23.09</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:LVM2.2.03.21.tgz/Makefile.in -> _service:tar_scm:LVM2.2.03.22.tgz/Makefile.in
Changed
@@ -38,7 +38,7 @@ udev po tools.distclean: test.distclean endif -DISTCLEAN_DIRS += lcov_reports* +DISTCLEAN_DIRS += lcov_reports* autom4te.cache DISTCLEAN_TARGETS += config.cache config.log config.status make.tmpl include make.tmpl
View file
_service:tar_scm:LVM2.2.03.21.tgz/README -> _service:tar_scm:LVM2.2.03.22.tgz/README
Changed
@@ -12,12 +12,18 @@ https://github.com/lvmteam/lvm2/releases The source code is stored in git: - https://sourceware.org/git/?p=lvm2.git - git clone git://sourceware.org/git/lvm2.git -mirrored to: - https://github.com/lvmteam/lvm2 + https://gitlab.com/lvmteam/lvm2 +Clone: + git clone git@gitlab.com:lvmteam/lvm2.git +Anonymous access: + git clone https://gitlab.com/lvmteam/lvm2.git +Mirrored to: +* https://github.com/lvmteam/lvm2 git clone https://github.com/lvmteam/lvm2.git git clone git@github.com:lvmteam/lvm2.git +* https://sourceware.org/git/?p=lvm2.git + git clone https://sourceware.org/git/lvm2.git + git clone git://sourceware.org/git/lvm2.git Mailing list for general discussion related to LVM2: linux-lvm@redhat.com
View file
_service:tar_scm:LVM2.2.03.21.tgz/VERSION -> _service:tar_scm:LVM2.2.03.22.tgz/VERSION
Changed
@@ -1,1 +1,1 @@ -2.03.21(2) (2023-04-21) +2.03.22(2) (2023-08-02)
View file
_service:tar_scm:LVM2.2.03.21.tgz/VERSION_DM -> _service:tar_scm:LVM2.2.03.22.tgz/VERSION_DM
Changed
@@ -1,1 +1,1 @@ -1.02.195 (2023-04-21) +1.02.196 (2023-08-02)
View file
_service:tar_scm:LVM2.2.03.21.tgz/WHATS_NEW -> _service:tar_scm:LVM2.2.03.22.tgz/WHATS_NEW
Changed
@@ -1,3 +1,28 @@ +version 2.03.22 - 02nd August 2023 +================================== + Fix pv_major/pv_minor report field types so they are integers, not strings. + Add lvmdevices --delnotfound to delete entries for missing devices. + Always use cachepool name for metadata backup LV for lvconvert --repair. + Make metadata backup LVs read-only after pool's lvconvert --repair. + Improve VDO and Thin support with lvmlockd. + Handle 'lvextend --usepolicies' for pools for all activation variants. + Fix memleak in vgchange autoactivation setup. + Update py-compile building script. + Support conversion from thick to fully provisioned thin LV. + Cache/Thin-pool can use error and zero volumes for testing. + Individual thin volume can be cached, but cannot take snapshot. + Better internal support for handling error and zero target (for testing). + Resize COW above trimmed maximal size is does not return error. + Support parsing of vdo geometry format version 4. + Add lvm.conf thin_restore and cache_restore settings. + Handle multiple mounts while resizing volume with a FS. + Handle leading/trailing spaces in sys_wwid and sys_serial used by deivce_id. + Enhance lvm_import_vdo and use snapshot when converting VDO volume. + Fix parsing of VDO metadata. + Fix failing -S|--select for non-reporting cmds if using LV info/status fields. + Allow snapshots of raid+integrity LV. + Fix multisegment RAID1 allocator to prevent using single disk for more legs. + version 2.03.21 - 21st April 2023 ================================= Fix activation of vdo-pool for with 0 length headers (converted pools). @@ -140,7 +165,7 @@ Fix IMSM MD RAID detection on 4k devices. Check for presence of VDO target before starting any conversion. Support metatadata profiles with volume VDO pool conversions. - Support -Zn for conversion of already formated VDO pools. + Support -Zn for conversion of already formatted VDO pools. Avoid removing LVs on error path of lvconvert during creation volumes. Fix crashing lvdisplay when thin volume was waiting for merge. Support option --errorwhenfull when converting volume to thin-pool. @@ -3226,7 +3251,7 @@ Add device name and offset to raw_read_mda_header error messages. Honour log argument when down-converting stacked mirror. Sleep to workaround clvmd -S race: socket closed early and server drops cmd. - Use early udev synchronisation and update of dev nodes for clustered mirrors. + Use early udev synchronization and update of dev nodes for clustered mirrors. Remove incorrect inclusion of kdev_t.h from cmirrord/functions.h. Add man pages for lvmconf and non-existent lvmsadc and lvmsar tools. Exit successfully when using -o help (but not -o +help) with LVM reports.
View file
_service:tar_scm:LVM2.2.03.21.tgz/WHATS_NEW_DM -> _service:tar_scm:LVM2.2.03.22.tgz/WHATS_NEW_DM
Changed
@@ -1,3 +1,6 @@ +Version 1.02.196 - 02nd August 2023 +=================================== + Version 1.02.195 - 21st April 2023 ================================== @@ -1119,7 +1122,7 @@ Version 1.02.36 - 6th August 2009 ================================= Add udevcookies, udevcomplete, udevcomplete_all and --noudevwait to dmsetup. - Add libdevmapper functions to support synchronisation with udev. + Add libdevmapper functions to support synchronization with udev. Version 1.02.35 - 28th July 2009 ================================
View file
_service:tar_scm:LVM2.2.03.21.tgz/autoconf/py-compile -> _service:tar_scm:LVM2.2.03.22.tgz/autoconf/py-compile
Changed
@@ -1,9 +1,9 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2011-06-08.12; # UTC +scriptversion=2023-03-30.00; # UTC -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2023 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ # bugs to <bug-automake@gnu.org> or send patches to # <automake-patches@gnu.org>. -if -z "$PYTHON" ; then +if test -z "$PYTHON"; then PYTHON=python fi @@ -62,13 +62,19 @@ ;; -h|--help) cat <<\EOF -Usage: py-compile --help --version --basedir DIR --destdir DIR FILES..." +Usage: py-compile options FILES... Byte compile some python scripts FILES. Use --destdir to specify any leading directory path to the FILES that you don't want to include in the byte compiled file. Specify --basedir for any additional path information you do want to be shown in the byte compiled file. +Options: + --basedir DIR Prefix all FILES with DIR, and include in error messages. + --destdir DIR Prefix all FILES with DIR before compiling. + -v, --version Display version information. + -h, --help This help screen. + Example: py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py @@ -94,77 +100,143 @@ shift done -files=$* -if test -z "$files"; then - usage_error "no files given" +if test $# -eq 0; then + usage_error "no files given" fi # if basedir was given, then it should be prepended to filenames before # byte compilation. -if -z "$basedir" ; then - pathtrans="path = file" +if test -z "$basedir"; then + pathtrans="path = file" else - pathtrans="path = os.path.join('$basedir', file)" + pathtrans="path = os.path.join('$basedir', file)" fi # if destdir was given, then it needs to be prepended to the filename to # byte compile but not go into the compiled file. -if -z "$destdir" ; then - filetrans="filepath = path" +if test -z "$destdir"; then + filetrans="filepath = path" else - filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" fi -$PYTHON -c " -import sys, os, py_compile, imp +python_major=`$PYTHON -c 'import sys; print(sys.version_info0)'` +if test -z "$python_major"; then + usage_error "could not determine $PYTHON major version" +fi -files = '''$files''' +case $python_major in +01) + usage_error "python version 0.x and 1.x not supported" + ;; +esac + +python_minor=`$PYTHON -c 'import sys; print(sys.version_info1)'` + +# NB: When adding support for newer versions, prefer copying & adding new cases +# rather than try to keep things merged with shell variables. + +# First byte compile (no optimization) all the modules. +# This works for all currently known Python versions. +$PYTHON -c " +import sys, os, py_compile + +try: + import importlib +except ImportError: + importlib = None + +# importlib.util.cache_from_source was added in 3.4 +if ( + hasattr(importlib, 'util') + and hasattr(importlib.util, 'cache_from_source') +): + destpath = importlib.util.cache_from_source +else: + destpath = lambda filepath: filepath + 'c' sys.stdout.write('Byte-compiling python modules...\n') -for file in files.split(): +for file in sys.argv1:: $pathtrans $filetrans - if not os.path.exists(filepath) or not (len(filepath) >= 3 - and filepath-3: == '.py'): - continue - sys.stdout.write(file) + if ( + not os.path.exists(filepath) + or not (len(filepath) >= 3 and filepath-3: == '.py') + ): + continue + sys.stdout.write(file + ' ') sys.stdout.flush() - if hasattr(imp, 'get_tag'): - py_compile.compile(filepath, imp.cache_from_source(filepath), path) - else: - py_compile.compile(filepath, filepath + 'c', path) -sys.stdout.write('\n')" || exit $? + py_compile.compile(filepath, destpath(filepath), path) +sys.stdout.write('\n')" "$@" || exit $? -# this will fail for python < 1.5, but that doesn't matter ... +# Then byte compile w/optimization all the modules. $PYTHON -O -c " -import sys, os, py_compile, imp - -# pypy does not use .pyo optimization -if hasattr(sys, 'pypy_translation_info'): +import sys, os, py_compile + +try: + import importlib +except ImportError: + importlib = None + +# importlib.util.cache_from_source was added in 3.4 +if ( + hasattr(importlib, 'util') + and hasattr(importlib.util, 'cache_from_source') +): + destpath = importlib.util.cache_from_source +else: + destpath = lambda filepath: filepath + 'o' + +# pypy2 does not use .pyo optimization +if sys.version_info.major <= 2 and hasattr(sys, 'pypy_translation_info'): sys.exit(0) -files = '''$files''' sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') -for file in files.split(): +for file in sys.argv1:: + $pathtrans + $filetrans + if ( + not os.path.exists(filepath) + or not (len(filepath) >= 3 and filepath-3: == '.py') + ): + continue + sys.stdout.write(file + ' ') + sys.stdout.flush() + py_compile.compile(filepath, destpath(filepath), path) +sys.stdout.write('\n')" "$@" 2>/dev/null || exit $? + +# Then byte compile w/more optimization. +# Only do this for Python 3.5+, see https://bugs.gnu.org/38043 for background. +case $python_major.$python_minor in +2.*|3.0-4) + ;; +*) + $PYTHON -OO -c " +import sys, os, py_compile, importlib + +sys.stdout.write('Byte-compiling python modules (more optimized versions)' + ' ...\n')
View file
_service:tar_scm:LVM2.2.03.21.tgz/conf/example.conf.in -> _service:tar_scm:LVM2.2.03.22.tgz/conf/example.conf.in
Changed
@@ -650,11 +650,6 @@ # This configuration option has an automatic default value. # vdo_block_map_period = 16380 - # Configuration option allocation/vdo_check_point_frequency. - # The default check point frequency for VDO volume. - # This configuration option has an automatic default value. - # vdo_check_point_frequency = 0 - # Configuration option allocation/vdo_use_sparse_index. # Enables sparse indexing for VDO volume. # This configuration option has an automatic default value. @@ -1201,7 +1196,7 @@ # Configuration option global/thin_check_executable. # The full path to the thin_check command. - # LVM uses this command to check that a thin metadata device is in a + # LVM uses this command to check that a thin pool metadata device is in a # usable state. When a thin pool is activated and after it is # deactivated, this command is run. Activation will only proceed if # the command has an exit status of 0. Set to "" to skip this check. @@ -1225,6 +1220,14 @@ # This configuration option has an automatic default value. # thin_repair_executable = "@THIN_REPAIR_CMD@" + # Configuration option global/thin_restore_executable. + # The full path to the thin_restore command. + # LVM uses this command to restore generated data for a thin pool metadata device. + # Also see thin_restore_options. + # (See package device-mapper-persistent-data or thin-provisioning-tools) + # This configuration option has an automatic default value. + # thin_restore_executable = "@THIN_RESTORE_CMD@" + # Configuration option global/thin_check_options. # List of options passed to the thin_check command. # With thin_check version 2.1 or newer you can add the option @@ -1239,6 +1242,11 @@ # This configuration option has an automatic default value. # thin_repair_options = "" + # Configuration option global/thin_restore_options. + # List of options passed to the thin_restore command. + # This configuration option has an automatic default value. + # thin_restore_options = "" + # Configuration option global/thin_disabled_features. # Features to not use in the thin driver. # This can be helpful for testing, or to avoid using a feature that is @@ -1287,6 +1295,14 @@ # This configuration option has an automatic default value. # cache_repair_executable = "@CACHE_REPAIR_CMD@" + # Configuration option global/cache_restore_executable. + # The full path to the cache_restore command. + # LVM uses this command to restore generated data for a cache metadata device. + # Also see cache_restore_options. + # (See package device-mapper-persistent-data or thin-provisioning-tools) + # This configuration option has an automatic default value. + # cache_restore_executable = "@CACHE_RESTORE_CMD@" + # Configuration option global/cache_check_options. # List of options passed to the cache_check command. # With cache_check version 5.0 or newer you should include the option @@ -1299,6 +1315,11 @@ # This configuration option has an automatic default value. # cache_repair_options = "" + # Configuration option global/cache_restore_options. + # List of options passed to the cache_restore command. + # This configuration option has an automatic default value. + # cache_restore_options = "" + # Configuration option global/vdo_format_executable. # The full path to the vdoformat command. # LVM uses this command to initial data volume for VDO type logical volume @@ -1313,10 +1334,10 @@ # Configuration option global/vdo_disabled_features. # Features to not use in the vdo driver. # This can be helpful for testing, or to avoid using a feature that is - # causing problems. Features include: online_rename + # causing problems. Features include: online_rename, version4 # # Example - # vdo_disabled_features = "online_rename" + # vdo_disabled_features = "online_rename", "version4" # # This configuration option does not have a default value defined. @@ -1790,7 +1811,7 @@ # Configuration option activation/polling_interval. # Check pvmove or lvconvert progress at this interval (seconds). # When pvmove or lvconvert must wait for the kernel to finish - # synchronising or merging data, they check and report progress at + # synchronizing or merging data, they check and report progress at # intervals of this number of seconds. If this is set to 0 and there # is only one thing to wait for, there are no progress reports, but # the process is awoken immediately once the operation is complete.
View file
_service:tar_scm:LVM2.2.03.21.tgz/conf/vdo-small.profile -> _service:tar_scm:LVM2.2.03.22.tgz/conf/vdo-small.profile
Changed
@@ -8,7 +8,6 @@ vdo_minimum_io_size=4096 vdo_block_map_cache_size_mb=128 vdo_block_map_period=16380 - vdo_check_point_frequency=0 vdo_use_sparse_index=0 vdo_index_memory_size_mb=256 vdo_slab_size_mb=2048
View file
_service:tar_scm:LVM2.2.03.21.tgz/configure -> _service:tar_scm:LVM2.2.03.22.tgz/configure
Changed
@@ -1712,8 +1712,8 @@ --disable-app-machineid disable LVM system ID using app-specific machine-id --disable-blkid_wiping disable libblkid detection of signatures when wiping and use native code instead - --enable-udev_sync enable synchronisation with udev processing - --enable-udev_rules install rule files needed for udev synchronisation + --enable-udev_sync enable synchronization with udev processing + --enable-udev_rules install rule files needed for udev synchronization --enable-udev-rule-exec-detection enable executable path detection in udev rules --enable-units-compat enable output compatibility with old versions that @@ -10858,7 +10858,7 @@ # # Do we need to use the API?? -# Do we want to link lvm2 with a big library for vdoformating ? +# Do we want to link lvm2 with a big library for vdoformatting ? # #AC_ARG_WITH(vdo-include, # AS_HELP_STRING(--with-vdo-include=PATH, @@ -13156,8 +13156,8 @@ ################################################################################ -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable synchronisation with udev processing" >&5 -printf %s "checking whether to enable synchronisation with udev processing... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable synchronization with udev processing" >&5 +printf %s "checking whether to enable synchronization with udev processing... " >&6; } # Check whether --enable-udev_sync was given. if test ${enable_udev_sync+y} then : @@ -13314,8 +13314,8 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable installation of udev rules required for synchronisation" >&5 -printf %s "checking whether to enable installation of udev rules required for synchronisation... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable installation of udev rules required for synchronization" >&5 +printf %s "checking whether to enable installation of udev rules required for synchronization... " >&6; } # Check whether --enable-udev_rules was given. if test ${enable_udev_rules+y} then :
View file
_service:tar_scm:LVM2.2.03.21.tgz/configure.ac -> _service:tar_scm:LVM2.2.03.22.tgz/configure.ac
Changed
@@ -625,7 +625,7 @@ The path to 'vdoformat', if available.) # # Do we need to use the API?? -# Do we want to link lvm2 with a big library for vdoformating ? +# Do we want to link lvm2 with a big library for vdoformatting ? # #AC_ARG_WITH(vdo-include, # AS_HELP_STRING(--with-vdo-include=PATH, @@ -1133,18 +1133,18 @@ Use blkid wiping by default.) ################################################################################ -dnl -- Enable udev synchronisation -AC_MSG_CHECKING(whether to enable synchronisation with udev processing) +dnl -- Enable udev synchronization +AC_MSG_CHECKING(whether to enable synchronization with udev processing) AC_ARG_ENABLE(udev_sync, AS_HELP_STRING(--enable-udev_sync, - enable synchronisation with udev processing), + enable synchronization with udev processing), UDEV_SYNC=$enableval, UDEV_SYNC="no") AC_MSG_RESULT($UDEV_SYNC) AS_IF(test "$UDEV_SYNC" = "yes", PKG_CHECK_MODULES(UDEV, libudev >= 143, UDEV_PC="libudev") UDEV_STATIC_LIBS=$("$PKG_CONFIG" --static --libs libudev) - AC_DEFINE(UDEV_SYNC_SUPPORT, 1, Define to 1 to enable synchronisation with udev processing.) + AC_DEFINE(UDEV_SYNC_SUPPORT, 1, Define to 1 to enable synchronization with udev processing.) AC_CHECK_LIB(udev, udev_device_get_is_initialized, AC_DEFINE(HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED, 1, Define to 1 if udev_device_get_is_initialized is available.)) @@ -1152,10 +1152,10 @@ ) dnl -- Enable udev rules -AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) +AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronization) AC_ARG_ENABLE(udev_rules, AS_HELP_STRING(--enable-udev_rules, - install rule files needed for udev synchronisation), + install rule files needed for udev synchronization), UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) AC_MSG_RESULT($UDEV_RULES)
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/cmirrord/cluster.c -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/cmirrord/cluster.c
Changed
@@ -1091,6 +1091,7 @@ (rq->u_rq.request_type != DM_ULOG_RESUME) && (rq->u_rq.request_type != DM_ULOG_CLEAR_REGION) && (rq->u_rq.request_type != DM_ULOG_CHECKPOINT_READY)) { + /* coveritysuspicious_sizeof allocation is using varargs data @end */ tmp_rq = malloc(DM_ULOG_REQUEST_SIZE); if (!tmp_rq) { /* @@ -1340,6 +1341,7 @@ goto out; } + /* coveritysuspicious_sizeof allocation is using varargs data @end */ rq = malloc(DM_ULOG_REQUEST_SIZE); if (!rq) { LOG_ERROR("cpg_config_callback: "
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/cmirrord/functions.c -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/cmirrord/functions.c
Changed
@@ -67,7 +67,7 @@ uint32_t recoverer; uint64_t recovering_region; /* -1 means not recovering */ uint64_t skip_bit_warning; /* used to warn if region skipped */ - int sync_search; + unsigned sync_search; int resume_override; @@ -220,7 +220,7 @@ if (r < 0) LOG_ERROR("%s rw_log: read failure: %s", SHORT_UUID(lc->uuid), strerror(errno)); - if (r != lc->disk_size) + if ((unsigned) r != lc->disk_size) return -EIO; /* Failed disk read */ return 0; } @@ -298,7 +298,7 @@ DIR *dp; struct dirent *dep; struct stat statbuf; - int major, minor; + unsigned major, minor; if (!strstr(major_minor_str, ":")) { r = stat(major_minor_str, &statbuf);
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/dmeventd/dmeventd.c -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/dmeventd/dmeventd.c
Changed
@@ -987,6 +987,7 @@ DEBUGLOG("Unregistering monitor for %s.", thread->device.name); _unregister_for_timeout(thread); + /* coveritymissing_lock no missing lock here */ if ((thread->status != DM_THREAD_REGISTERING) && !_do_unregister_device(thread)) log_error("%s: %s unregister failed.", __func__, @@ -1969,6 +1970,7 @@ (void) close(fd); } + /* coverityleaked_handle dont't care */ if ((open("/dev/null", O_RDONLY) < 0) || (open("/dev/null", O_WRONLY) < 0) || (open("/dev/null", O_WRONLY) < 0))
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c
Changed
@@ -123,6 +123,7 @@ int dmeventd_lvm2_run(const char *cmdline) { + /* coveritymissing_lock no locking for run part */ return (lvm2_run(_lvm_handle, cmdline) == LVM2_COMMAND_SUCCEEDED); }
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/lvmdbusd/Makefile.in -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/lvmdbusd/Makefile.in
Changed
@@ -51,18 +51,14 @@ .PHONY: install_lvmdbusd -all: - $(Q) test -x $(LVMDBUSD) || chmod 755 $(LVMDBUSD) - install_lvmdbusd: $(LVMDBUSD) @echo " INSTALL $<" $(Q) $(INSTALL_DIR) $(sbindir) $(Q) $(INSTALL_SCRIPT) $(LVMDBUSD) $(sbindir) - $(Q) $(INSTALL_DIR) $(lvmdbusdir) + $(Q) $(INSTALL_DIR) $(lvmdbusdir) $(lvmdbusdir)/__pycache__ $(Q) (cd $(srcdir); $(INSTALL_DATA) $(LVMDBUS_SRCDIR_FILES) $(lvmdbusdir)) $(Q) $(INSTALL_DATA) $(LVMDBUS_BUILDDIR_FILES) $(lvmdbusdir) $(Q) PYTHON=$(PYTHON3) $(PYCOMPILE) --destdir "$(DESTDIR)" --basedir "$(lvmdbuspydir)" $(LVMDBUS_SRCDIR_FILES) $(LVMDBUS_BUILDDIR_FILES) - $(Q) $(CHMOD) 755 $(lvmdbusdir)/__pycache__ $(Q) $(CHMOD) 444 $(lvmdbusdir)/__pycache__/*.pyco install_lvm2: install_lvmdbusd
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/lvmdbusd/lvm_shell_proxy.py.in -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/lvmdbusd/lvm_shell_proxy.py.in
Changed
@@ -154,6 +154,8 @@ # If any env variables contain LVM we will propagate them too for k, v in os.environ.items(): + if "PATH" in k: + local_envk = v if "LVM" in k: local_envk = v
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/lvmlockd/lvmlockd-core.c -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/lvmlockd/lvmlockd-core.c
Changed
@@ -5280,7 +5280,7 @@ { char buf164; char buf264; - int i, j; + unsigned i, j; memset(buf1, 0, sizeof(buf1)); memset(buf2, 0, sizeof(buf2)); @@ -6280,9 +6280,8 @@ .daemon_fini = NULL, .daemon_main = main_loop, }; - daemon_host_id_file = NULL; - static struct option long_options = { + static const struct option long_options = { {"help", no_argument, 0, 'h' }, {"version", no_argument, 0, 'V' }, {"test", no_argument, 0, 'T' }, @@ -6300,6 +6299,8 @@ {0, 0, 0, 0 } }; + daemon_host_id_file = NULL; + while (1) { int c; int lm;
View file
_service:tar_scm:LVM2.2.03.21.tgz/daemons/lvmpolld/lvmpolld-data-utils.h -> _service:tar_scm:LVM2.2.03.22.tgz/daemons/lvmpolld/lvmpolld-data-utils.h
Changed
@@ -45,18 +45,18 @@ * accessing following vars doesn't * require struct lvmpolld_lv lock */ - struct lvmpolld_state *const ls; + struct lvmpolld_state *ls; const enum poll_type type; - const char *const lvid; - const char *const lvmpolld_id; - const char *const devicesfile; - const char *const lvname; /* full vg/lv name */ + const char *lvid; + const char *lvmpolld_id; + const char *devicesfile; + const char *lvname; /* full vg/lv name */ const unsigned pdtimeout; /* in seconds */ - const char *const sinterval; - const char *const lvm_system_dir_env; - struct lvmpolld_store *const pdst; - const char *const *cmdargv; - const char *const *cmdenvp; + const char *sinterval; + const char *lvm_system_dir_env; + struct lvmpolld_store *pdst; + const char **cmdargv; + const char **cmdenvp; /* only used by write */ pid_t cmd_pid;
View file
_service:tar_scm:LVM2.2.03.21.tgz/device_mapper/all.h -> _service:tar_scm:LVM2.2.03.22.tgz/device_mapper/all.h
Changed
@@ -2243,7 +2243,7 @@ int dm_cookie_supported(void); /* - * Udev synchronisation functions. + * Udev synchronization functions. */ void dm_udev_set_sync_support(int sync_with_udev); int dm_udev_get_sync_support(void);
View file
_service:tar_scm:LVM2.2.03.21.tgz/device_mapper/ioctl/libdm-iface.c -> _service:tar_scm:LVM2.2.03.22.tgz/device_mapper/ioctl/libdm-iface.c
Changed
@@ -2066,7 +2066,7 @@ /* * Prevent udev vs. libdevmapper race when processing nodes * and symlinks. This can happen when the udev rules are - * installed and udev synchronisation code is enabled in + * installed and udev synchronization code is enabled in * libdevmapper but the software using libdevmapper does not * make use of it (by not calling dm_task_set_cookie before). * We need to instruct the udev rules not to be applied at @@ -2076,7 +2076,7 @@ if (!dmt->cookie_set && dm_udev_get_sync_support()) { log_debug_activation("Cookie value is not set while trying to call %s " "ioctl. Please, consider using libdevmapper's udev " - "synchronisation interface or disable it explicitly " + "synchronization interface or disable it explicitly " "by calling dm_udev_set_sync_support(0).", dmt->type == DM_DEVICE_RESUME ? "DM_DEVICE_RESUME" : dmt->type == DM_DEVICE_REMOVE ? "DM_DEVICE_REMOVE" :
View file
_service:tar_scm:LVM2.2.03.21.tgz/device_mapper/libdm-common.c -> _service:tar_scm:LVM2.2.03.22.tgz/device_mapper/libdm-common.c
Changed
@@ -2311,7 +2311,7 @@ if (maxid < 0) { log_warn("Kernel not configured for semaphores (System V IPC). " - "Not using udev synchronisation code."); + "Not using udev synchronization code."); return 0; } @@ -2334,7 +2334,7 @@ if (!(r = udev_queue_get_udev_is_active(udev_queue))) log_debug_activation("Udev is not running. " - "Not using udev synchronisation code."); + "Not using udev synchronization code."); udev_queue_unref(udev_queue); udev_unref(udev);
View file
_service:tar_scm:LVM2.2.03.21.tgz/device_mapper/libdm-file.c -> _service:tar_scm:LVM2.2.03.22.tgz/device_mapper/libdm-file.c
Changed
@@ -223,7 +223,6 @@ } /* coverityleaked_handle intentional leak of fd handle here */ - return 1; fail_close_unlink:
View file
_service:tar_scm:LVM2.2.03.21.tgz/device_mapper/vdo/target.h -> _service:tar_scm:LVM2.2.03.22.tgz/device_mapper/vdo/target.h
Changed
@@ -81,7 +81,6 @@ uint32_t block_map_era_length; // format period uint32_t block_map_period; // supported alias }; - uint32_t check_point_frequency; uint32_t index_memory_size_mb; // format uint32_t slab_size_mb; // format
View file
_service:tar_scm:LVM2.2.03.21.tgz/device_mapper/vdo/vdo_reader.c -> _service:tar_scm:LVM2.2.03.22.tgz/device_mapper/vdo/vdo_reader.c
Changed
@@ -128,6 +128,14 @@ struct vdo_index_config index_config; } __packed; +struct vdo_volume_geometry_4 { + uint32_t release_version; + uint64_t nonce; + uuid_t uuid; + struct vdo_volume_region regionsVDO_VOLUME_REGION_COUNT; + struct vdo_index_config index_config; +} __packed; + /* Decoding mostly only some used stucture members */ static void _vdo_decode_version(struct vdo_version_number *v) @@ -146,13 +154,24 @@ static void _vdo_decode_geometry_region(struct vdo_volume_region *vr) { vr->id = le32_to_cpu(vr->id); - vr->start_block = le32_to_cpu(vr->start_block); + vr->start_block = le64_to_cpu(vr->start_block); } static void _vdo_decode_volume_geometry(struct vdo_volume_geometry *vg) { - vg->release_version = le64_to_cpu(vg->release_version); + vg->release_version = le32_to_cpu(vg->release_version); vg->nonce = le64_to_cpu(vg->nonce); + vg->bio_offset = le64_to_cpu(vg->bio_offset); + _vdo_decode_geometry_region(&vg->regionsVDO_DATA_REGION); +} + +static void _vdo_decode_volume_geometry_4(struct vdo_volume_geometry *vg, + struct vdo_volume_geometry_4 *vg_4) +{ + vg->release_version = le32_to_cpu(vg_4->release_version); + vg->nonce = le64_to_cpu(vg_4->nonce); + vg->bio_offset = 0; + vg->regionsVDO_DATA_REGION = vg_4->regionsVDO_DATA_REGION; _vdo_decode_geometry_region(&vg->regionsVDO_DATA_REGION); } @@ -174,9 +193,8 @@ bool dm_vdo_parse_logical_size(const char *vdo_path, uint64_t *logical_blocks) { char buffer4096; - int fh, n; + int fh; bool r = false; - off_t l; struct stat st; uint64_t size; uint64_t regpos; @@ -184,6 +202,7 @@ struct vdo_header h; struct vdo_version_number vn; struct vdo_volume_geometry vg; + struct vdo_volume_geometry_4 vg_4; struct vdo_component_41_0 pvc; *logical_blocks = 0; @@ -207,7 +226,7 @@ size = st.st_size; } - if ((n = read(fh, buffer, sizeof(buffer))) < 0) { + if (read(fh, buffer, sizeof(buffer)) < 0) { log_sys_debug("read", vdo_path); goto err; } @@ -220,32 +239,42 @@ memcpy(&h, buffer + MAGIC_NUMBER_SIZE, sizeof(h)); _vdo_decode_header(&h); - if (h.version.major_version != 5) { - log_debug_activation("Unsupported VDO version %u.%u.", h.version.major_version, h.version.minor_version); + if (h.id != 5) { + log_debug_activation("Expected geometry VDO block instead of block %u.", h.id); goto err; } - memcpy(&vg, buffer + MAGIC_NUMBER_SIZE + sizeof(h), sizeof(vg)); - _vdo_decode_volume_geometry(&vg); + switch (h.version.major_version) { + case 4: + memcpy(&vg_4, buffer + MAGIC_NUMBER_SIZE + sizeof(h), sizeof(vg_4)); + _vdo_decode_volume_geometry_4(&vg, &vg_4); + break; + case 5: + memcpy(&vg, buffer + MAGIC_NUMBER_SIZE + sizeof(h), sizeof(vg)); + _vdo_decode_volume_geometry(&vg); + break; + default: + log_debug_activation("Unsupported VDO version %u.%u.", h.version.major_version, h.version.minor_version); + goto err; + } - regpos = vg.regionsVDO_DATA_REGION.start_block * 4096; + regpos = (vg.regionsVDO_DATA_REGION.start_block - vg.bio_offset) * 4096; if ((regpos + sizeof(buffer)) > size) { log_debug_activation("File/Device is shorter and can't provide requested VDO volume region at " FMTu64 " > " FMTu64 ".", regpos, size); goto err; } - if ((l = lseek(fh, regpos, SEEK_SET)) < 0) { + if (lseek(fh, regpos, SEEK_SET) < 0) { log_sys_debug("lseek", vdo_path); goto err; } - if ((n = read(fh, buffer, sizeof(buffer))) < 0) { + if (read(fh, buffer, sizeof(buffer)) < 0) { log_sys_debug("read", vdo_path); goto err; } - memcpy(&vn, buffer + sizeof(struct vdo_geometry_block), sizeof(vn)); _vdo_decode_version(&vn);
View file
_service:tar_scm:LVM2.2.03.21.tgz/include/configure.h.in -> _service:tar_scm:LVM2.2.03.22.tgz/include/configure.h.in
Changed
@@ -695,7 +695,7 @@ /* Define to 1 if your <sys/time.h> declares `struct tm'. */ #undef TM_IN_SYS_TIME -/* Define to 1 to enable synchronisation with udev processing. */ +/* Define to 1 to enable synchronization with udev processing. */ #undef UDEV_SYNC_SUPPORT /* Enable a valgrind aware build of pool */
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/activate/activate.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/activate/activate.c
Changed
@@ -2555,7 +2555,7 @@ lv_is_partial(lv) && lv_is_raid(lv) && lv_raid_has_integrity((struct logical_volume *)lv)) { cmd->partial_activation = 0; cmd->degraded_activation = 0; - log_print("No degraded or partial activation for raid with integrity."); + log_print_unless_silent("No degraded or partial activation for raid with integrity."); } if ((!lv->vg->cmd->partial_activation) && lv_is_partial(lv)) { @@ -2605,6 +2605,8 @@ if (!lv_is_visible(lv) && lv_is_component(lv)) { laopts->read_only = 1; laopts->component_lv = lv; + } else if (lv_is_pool_metadata_spare(lv)) { + laopts->component_lv = lv; } else if (filter) laopts->read_only = _passes_readonly_filter(cmd, lv); @@ -2721,16 +2723,16 @@ /* Work all segments of @lv removing any existing, closed "*-missing_N_0" sub devices. */ static int _lv_remove_any_missing_subdevs(struct logical_volume *lv) { - if (lv) { - uint32_t seg_no = 0; - char name257; - struct lv_segment *seg; + char nameNAME_LEN; + struct lv_segment *seg; + uint32_t seg_no = 0; + if (lv) { dm_list_iterate_items(seg, &lv->segments) { if (dm_snprintf(name, sizeof(name), "%s-%s-missing_%u_0", seg->lv->vg->name, seg->lv->name, seg_no) < 0) return_0; if (!_remove_dm_dev_by_name(name)) - return 0; + return_0; seg_no++; } @@ -2748,10 +2750,10 @@ for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) == AREA_LV && !_lv_remove_any_missing_subdevs(seg_lv(seg, s))) - return 0; + return_0; if (seg->meta_areas && seg_metatype(seg, s) == AREA_LV && !_lv_remove_any_missing_subdevs(seg_metalv(seg, s))) - return 0; + return_0; } return 1;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/activate/dev_manager.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/activate/dev_manager.c
Changed
@@ -2066,6 +2066,8 @@ /* read-only component LV is also made visible */ if (_lv_has_mknode(lv) || (dminfo.read_only && lv_is_component(lv))) r = _dev_manager_lv_mknodes(lv); + else + r = 1; } else r = _dev_manager_lv_rmnodes(lv); @@ -2457,8 +2459,6 @@ dm_node_callback_t type, void *cb_data) { int ret, status = 0, fd; - const struct dm_config_node *cn; - const struct dm_config_value *cv; const struct pool_cb_data *data = cb_data; const struct logical_volume *pool_lv = data->pool_lv; const struct logical_volume *mlv = first_seg(pool_lv)->metadata_lv; @@ -2466,11 +2466,11 @@ long buf64 / sizeof(long); /* buffer for short disk header (64B) */ int args = 0; char *mpath; - const char *argv19 = { /* Max supported 15 args */ + const char *argvDEFAULT_MAX_EXEC_ARGS + 7 = { /* Max supported 15 args */ find_config_tree_str_allow_empty(cmd, data->exec, NULL) }; - if (!*argv0) /* *_check tool is unconfigured/disabled with "" setting */ + if (!argv0 || !*argv0) /* *_check tool is unconfigured/disabled with "" setting */ return 1; if (lv_is_cache_vol(pool_lv)) { @@ -2517,25 +2517,8 @@ } } - if (!(cn = find_config_tree_array(cmd, data->opts, NULL))) { - log_error(INTERNAL_ERROR "Unable to find configuration for pool check options."); - return 0; - } - - for (cv = cn->v; cv && args < 16; cv = cv->next) { - if (cv->type != DM_CFG_STRING) { - log_error("Invalid string in config file: " - "global/%s_check_options.", - data->global); - return 0; - } - argv++args = cv->v.str; - } - - if (args == 16) { - log_error("Too many options for %s command.", argv0); - return 0; - } + if (!prepare_exec_args(cmd, argv, &args, data->opts)) + return_0; argv++args = mpath; @@ -3000,34 +2983,51 @@ return 1; } +static int _bad_pv_area(struct lv_segment *seg, uint32_t s) +{ + struct stat info; + const char *name; + struct device *dev; + + if (!seg_pvseg(seg, s)) + return 1; + if (!seg_pv(seg, s)) + return 1; + if (!(dev = seg_dev(seg, s))) + return 1; + if (dm_list_empty(&dev->aliases)) + return 1; + /* FIXME Avoid repeating identical stat in dm_tree_node_add_target_area */ + name = dev_name(dev); + if (stat(name, &info) < 0) + return 1; + if (!S_ISBLK(info.st_mode)) + return 1; + return 0; +} + int add_areas_line(struct dev_manager *dm, struct lv_segment *seg, struct dm_tree_node *node, uint32_t start_area, uint32_t areas) { + struct cmd_context *cmd = seg->lv->vg->cmd; uint64_t extent_size = seg->lv->vg->extent_size; uint32_t s; char *dlid; - struct stat info; const char *name; unsigned num_error_areas = 0; unsigned num_existing_areas = 0; - /* FIXME Avoid repeating identical stat in dm_tree_node_add_target_area */ for (s = start_area; s < areas; s++) { - - /* FIXME: dev_name() does not return NULL! It needs to check if dm_list_empty(&dev->aliases) - but this knot of logic is too complex to pull apart without careful deconstruction. */ - - if ((seg_type(seg, s) == AREA_PV && - (!seg_pvseg(seg, s) || !seg_pv(seg, s) || !seg_dev(seg, s) || - !(name = dev_name(seg_dev(seg, s))) || !*name || - stat(name, &info) < 0 || !S_ISBLK(info.st_mode))) || - (seg_type(seg, s) == AREA_LV && !seg_lv(seg, s))) { - if (!seg->lv->vg->cmd->partial_activation) { - if (!seg->lv->vg->cmd->degraded_activation || - !lv_is_raid_type(seg->lv)) { - log_error("Aborting. LV %s is now incomplete " - "and '--activationmode partial' was not specified.", + if (((seg_type(seg, s) == AREA_PV) && _bad_pv_area(seg, s)) || + ((seg_type(seg, s) == AREA_LV) && !seg_lv(seg, s))) { + if (!cmd->partial_activation) { + if (!cmd->degraded_activation || + (!lv_is_raid_type(seg->lv) && + !lv_is_integrity(seg->lv) && + !lv_is_integrity_metadata(seg->lv) && + !lv_is_integrity_origin(seg->lv))) { + log_error("Aborting. LV %s is incomplete and --activationmode partial was not specified.", display_lvname(seg->lv)); return 0; } @@ -3588,9 +3588,6 @@ dm_tree_node_get_context(dnode)) return 1; - lvlayer->lv = lv; - lvlayer->visible_component = (laopts->component_lv == lv) ? 1 : 0; - /* * Add LV to dtree. * If we're working with precommitted metadata, clear any @@ -4114,7 +4111,7 @@ char offset_str32 = { 0 }; int copy_offset = 0; int spaces = 0; - int i, i_off = 0; + unsigned i, i_off = 0; if (!dmt) return_0;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/cache/lvmcache.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/cache/lvmcache.c
Changed
@@ -707,8 +707,8 @@ /* Different mpath devs with the same wwid shouldn't happen. */ if (dev_is_mp && dev_mp) { - log_print("Found multiple multipath devices for PVID %s WWID %s: %s %s", - pvid, wwid1_buf, dev_name(dev_mp), dev_name(dev)); + log_print_unless_silent("Found multiple multipath devices for PVID %s WWID %s: %s %s.", + pvid, wwid1_buf, dev_name(dev_mp), dev_name(dev)); continue; } @@ -1503,6 +1503,9 @@ */ dm_list_iterate_items_safe(vginfo, vginfo2, &_vginfos) { + char vgidID_LEN + 1 __attribute__((aligned(8))) = { 0 }; + memcpy(vgid, vginfo->vgid, ID_LEN); + dm_list_iterate_items_safe(info, info2, &vginfo->infos) { dev = info->dev; device_hint = _get_pvsummary_device_hint(dev->pvid); @@ -1557,6 +1560,10 @@ /* lvmcache_del will also delete vginfo if info was last one */ lvmcache_del(info); cmd->filter->wipe(cmd, cmd->filter, dev, NULL); + + /* If vginfo was deleted don't continue using vginfo->infos */ + if (!_search_vginfos_list(NULL, vgid)) + break; } } }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/commands/cmd_enum.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/commands/cmd_enum.h
Changed
@@ -12,7 +12,7 @@ enum { #define cmd(a, b) a , -#include "../../include/cmds.h" +#include "cmds.h" #undef cmd };
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/commands/toolcontext.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/commands/toolcontext.c
Changed
@@ -1506,7 +1506,7 @@ return; } - cmd->rand_seed = (unsigned) time(NULL) + (unsigned) getpid(); + cmd->rand_seed = (unsigned) ((time(NULL) + getpid()) & 0xffffffff); reset_lvm_errno(1); }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/config/config.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/config/config.c
Changed
@@ -741,13 +741,13 @@ } /* Proper value always starts with '#'. */ if (token0 != '#') - goto bad; + goto_bad; while (token) { /* Move to type identifier. Error on no char. */ token++; if (!token0) - goto bad; + goto_bad; /* Move to the actual value and decode any "##" into "#". */ p = token + 1; @@ -1300,8 +1300,9 @@ if (item->type != CFG_TYPE_STRING) log_error(INTERNAL_ERROR "%s cfg tree element not declared as string.", path); - str = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_STRING, profile) - : dm_config_tree_find_str(cmd->cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_STRING, profile)); + str = cfg_def_get_default_value(cmd, item, CFG_TYPE_STRING, profile); + if (!_config_disabled(cmd, item, path)) + str = dm_config_tree_find_str(cmd->cft, path, str); if (profile_applied && profile) remove_config_tree_by_source(cmd, profile->source); @@ -1324,8 +1325,9 @@ if (!(item->flags & CFG_ALLOW_EMPTY)) log_error(INTERNAL_ERROR "%s cfg tree element not declared to allow empty values.", path); - str = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_STRING, profile) - : dm_config_tree_find_str_allow_empty(cmd->cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_STRING, profile)); + str = cfg_def_get_default_value(cmd, item, CFG_TYPE_STRING, profile); + if (!_config_disabled(cmd, item, path)) + str = dm_config_tree_find_str_allow_empty(cmd->cft, path, str); if (profile_applied && profile) remove_config_tree_by_source(cmd, profile->source); @@ -1346,8 +1348,9 @@ if (item->type != CFG_TYPE_INT) log_error(INTERNAL_ERROR "%s cfg tree element not declared as integer.", path); - i = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_INT, profile) - : dm_config_tree_find_int(cmd->cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_INT, profile)); + i = cfg_def_get_default_value(cmd, item, CFG_TYPE_INT, profile); + if (!_config_disabled(cmd, item, path)) + i = dm_config_tree_find_int(cmd->cft, path, i); if (profile_applied && profile) remove_config_tree_by_source(cmd, profile->source); @@ -1368,8 +1371,9 @@ if (item->type != CFG_TYPE_INT) log_error(INTERNAL_ERROR "%s cfg tree element not declared as integer.", path); - i64 = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_INT, profile) - : dm_config_tree_find_int64(cmd->cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_INT, profile)); + i64 = cfg_def_get_default_value(cmd, item, CFG_TYPE_INT, profile); + if (!_config_disabled(cmd, item, path)) + i64 = dm_config_tree_find_int64(cmd->cft, path, i64); if (profile_applied && profile) remove_config_tree_by_source(cmd, profile->source); @@ -1390,8 +1394,9 @@ if (item->type != CFG_TYPE_FLOAT) log_error(INTERNAL_ERROR "%s cfg tree element not declared as float.", path); - f = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_FLOAT, profile) - : dm_config_tree_find_float(cmd->cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_FLOAT, profile)); + f = cfg_def_get_default_value(cmd, item, CFG_TYPE_FLOAT, profile); + if (!_config_disabled(cmd, item, path)) + f = dm_config_tree_find_float(cmd->cft, path, f); if (profile_applied && profile) remove_config_tree_by_source(cmd, profile->source); @@ -1410,8 +1415,9 @@ if (item->type != CFG_TYPE_BOOL) log_error(INTERNAL_ERROR "%s cfg tree element not declared as boolean.", path); - b = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_BOOL, NULL) - : dm_config_tree_find_bool(cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_BOOL, NULL)); + b = cfg_def_get_default_value(cmd, item, CFG_TYPE_BOOL, NULL); + if (!_config_disabled(cmd, item, path)) + b = dm_config_tree_find_bool(cft, path, b); return b; } @@ -1429,8 +1435,9 @@ if (item->type != CFG_TYPE_BOOL) log_error(INTERNAL_ERROR "%s cfg tree element not declared as boolean.", path); - b = _config_disabled(cmd, item, path) ? cfg_def_get_default_value(cmd, item, CFG_TYPE_BOOL, profile) - : dm_config_tree_find_bool(cmd->cft, path, cfg_def_get_default_value(cmd, item, CFG_TYPE_BOOL, profile)); + b = cfg_def_get_default_value(cmd, item, CFG_TYPE_BOOL, profile); + if (!_config_disabled(cmd, item, path)) + b = dm_config_tree_find_bool(cmd->cft, path, b); if (profile_applied && profile) remove_config_tree_by_source(cmd, profile->source);
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/config/config_settings.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/config/config_settings.h
Changed
@@ -732,8 +732,8 @@ "The maximum and recommended value is " DM_TO_STRING(DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM) "; the minimum value is " DM_TO_STRING(DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM) ".\n") -cfg(allocation_vdo_check_point_frequency_CFG, "vdo_check_point_frequency", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_CHECK_POINT_FREQUENCY, VDO_1ST_VSN, NULL, 0, NULL, - "The default check point frequency for VDO volume.\n") +cfg(allocation_vdo_check_point_frequency_CFG, "vdo_check_point_frequency", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_CHECK_POINT_FREQUENCY, VDO_1ST_VSN, NULL, vsn(2, 3, 22), NULL, + "Deprecated option to set default check point frequency for VDO volume.\n") // vdo format cfg(allocation_vdo_use_sparse_index_CFG, "vdo_use_sparse_index", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_SPARSE_INDEX, VDO_1ST_VSN, NULL, 0, NULL, @@ -1177,7 +1177,7 @@ cfg(global_thin_check_executable_CFG, "thin_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, THIN_CHECK_CMD, vsn(2, 2, 94), "@THIN_CHECK_CMD@", 0, NULL, "The full path to the thin_check command.\n" - "LVM uses this command to check that a thin metadata device is in a\n" + "LVM uses this command to check that a thin pool metadata device is in a\n" "usable state. When a thin pool is activated and after it is\n" "deactivated, this command is run. Activation will only proceed if\n" "the command has an exit status of 0. Set to \"\" to skip this check.\n" @@ -1195,6 +1195,12 @@ "an unusable state. Also see thin_repair_options.\n" "(See package device-mapper-persistent-data or thin-provisioning-tools)\n") +cfg(global_thin_restore_executable_CFG, "thin_restore_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, THIN_RESTORE_CMD, vsn(2, 3, 22), "@THIN_RESTORE_CMD@", 0, NULL, + "The full path to the thin_restore command.\n" + "LVM uses this command to restore generated data for a thin pool metadata device.\n" + "Also see thin_restore_options.\n" + "(See package device-mapper-persistent-data or thin-provisioning-tools)\n") + cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_CHECK_OPTIONS_CONFIG, vsn(2, 2, 96), NULL, 0, NULL, "List of options passed to the thin_check command.\n" "With thin_check version 2.1 or newer you can add the option\n" @@ -1205,6 +1211,9 @@ cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 100), NULL, 0, NULL, "List of options passed to the thin_repair command.\n") +cfg_array(global_thin_restore_options_CFG, "thin_restore_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_THIN_RESTORE_OPTIONS_CONFIG, vsn(2, 3, 22), NULL, 0, NULL, + "List of options passed to the thin_restore command.\n") + cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 99), NULL, 0, NULL, "Features to not use in the thin driver.\n" "This can be helpful for testing, or to avoid using a feature that is\n" @@ -1245,6 +1254,12 @@ "an unusable state. Also see cache_repair_options.\n" "(See package device-mapper-persistent-data or thin-provisioning-tools)\n") +cfg(global_cache_restore_executable_CFG, "cache_restore_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, CACHE_RESTORE_CMD, vsn(2, 3, 22), "@CACHE_RESTORE_CMD@", 0, NULL, + "The full path to the cache_restore command.\n" + "LVM uses this command to restore generated data for a cache metadata device.\n" + "Also see cache_restore_options.\n" + "(See package device-mapper-persistent-data or thin-provisioning-tools)\n") + cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_CHECK_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL, "List of options passed to the cache_check command.\n" "With cache_check version 5.0 or newer you should include the option\n" @@ -1253,6 +1268,9 @@ cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL, "List of options passed to the cache_repair command.\n") +cfg_array(global_cache_restore_options_CFG, "cache_restore_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_RESTORE_OPTIONS_CONFIG, vsn(2, 3, 22), NULL, 0, NULL, + "List of options passed to the cache_restore command.\n") + cfg(global_vdo_format_executable_CFG, "vdo_format_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, VDO_FORMAT_CMD, VDO_1ST_VSN, "@VDO_FORMAT_CMD@", 0, NULL, "The full path to the vdoformat command.\n" "LVM uses this command to initial data volume for VDO type logical volume\n") @@ -1263,10 +1281,10 @@ cfg_array(global_vdo_disabled_features_CFG, "vdo_disabled_features", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 3, 11), NULL, 0, NULL, "Features to not use in the vdo driver.\n" "This can be helpful for testing, or to avoid using a feature that is\n" - "causing problems. Features include: online_rename\n" + "causing problems. Features include: online_rename, version4\n" "#\n" "Example\n" - "vdo_disabled_features = \"online_rename\" \n" + "vdo_disabled_features = \"online_rename\", \"version4\" \n" "#\n") cfg(global_fsadm_executable_CFG, "fsadm_executable", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_FSADM_PATH, vsn(2, 2, 170), "@FSADM_PATH@", 0, NULL, @@ -1678,7 +1696,7 @@ cfg(activation_polling_interval_CFG, "polling_interval", activation_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_INTERVAL, vsn(2, 2, 63), NULL, 0, NULL, "Check pvmove or lvconvert progress at this interval (seconds).\n" "When pvmove or lvconvert must wait for the kernel to finish\n" - "synchronising or merging data, they check and report progress at\n" + "synchronizing or merging data, they check and report progress at\n" "intervals of this number of seconds. If this is set to 0 and there\n" "is only one thing to wait for, there are no progress reports, but\n" "the process is awoken immediately once the operation is complete.\n")
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/config/defaults.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/config/defaults.h
Changed
@@ -105,6 +105,8 @@ # define DEFAULT_DMEVENTD_PATH DMEVENTD_PATH #endif +#define DEFAULT_MAX_EXEC_ARGS 15 /* Max number of accepted options args */ + #ifdef THIN_CHECK_NEEDS_CHECK # define DEFAULT_THIN_CHECK_OPTION1 "-q" # define DEFAULT_THIN_CHECK_OPTION2 "--clear-needs-check-flag" @@ -117,6 +119,8 @@ #define DEFAULT_THIN_REPAIR_OPTION1 "" #define DEFAULT_THIN_REPAIR_OPTIONS_CONFIG "#S" DEFAULT_THIN_REPAIR_OPTION1 +#define DEFAULT_THIN_RESTORE_OPTION1 "" +#define DEFAULT_THIN_RESTORE_OPTIONS_CONFIG "#S" DEFAULT_THIN_RESTORE_OPTION1 #define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0 #define DEFAULT_THIN_POOL_CROP_METADATA 0 #define DEFAULT_THIN_POOL_MAX_METADATA_SIZE_V1_KB (UINT64_C(255) * ((1 << 14) - 64) * 4) /* KB */ /* 0x3f8040 blocks */ @@ -145,6 +149,8 @@ #define DEFAULT_CACHE_REPAIR_OPTION1 "" #define DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG "#S" DEFAULT_CACHE_REPAIR_OPTION1 +#define DEFAULT_CACHE_RESTORE_OPTION1 "" +#define DEFAULT_CACHE_RESTORE_OPTIONS_CONFIG "#S" DEFAULT_CACHE_RESTORE_OPTION1 #define DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS 0 #define DEFAULT_CACHE_POOL_CHUNK_SIZE 64 /* KB */ #define DEFAULT_CACHE_POOL_MAX_CHUNKS 1000000
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/bcache-utils.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/bcache-utils.c
Changed
@@ -58,6 +58,7 @@ block_address bb, be; uint64_t block_size = bcache_block_sectors(cache) << SECTOR_SHIFT; uint64_t block_offset = start % block_size; + size_t blen; bcache_prefetch_bytes(cache, di, start, len); @@ -67,7 +68,7 @@ if (!bcache_get(cache, di, bb, 0, &b)) return false; - size_t blen = _min(block_size - block_offset, len); + blen = _min(block_size - block_offset, len); memcpy(data, ((unsigned char *) b->data) + block_offset, blen); bcache_put(b);
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/dev-cache.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/dev-cache.c
Changed
@@ -53,7 +53,7 @@ const char *dev_dir; int has_scanned; - long st_dev; + dev_t st_dev; struct dm_list dirs; struct dm_list files; @@ -2123,10 +2123,10 @@ char devnamePATH_MAX = { 0 }; char namebufNAME_LEN; char line1024; - int major = MAJOR(devno); - int minor = MINOR(devno); - int line_major; - int line_minor; + unsigned major = MAJOR(devno); + unsigned minor = MINOR(devno); + unsigned line_major; + unsigned line_minor; uint64_t line_blocks; DIR *dir; struct dirent *dirent; @@ -2231,7 +2231,6 @@ int setup_devname_in_dev_cache(struct cmd_context *cmd, const char *devname) { struct stat buf; - struct device *dev; if (stat(devname, &buf) < 0) { log_error("Cannot access device %s.", devname); @@ -2246,7 +2245,7 @@ if (!_insert_dev(devname, buf.st_rdev)) return_0; - if (!(dev = (struct device *) dm_hash_lookup(_cache.names, devname))) + if (!dm_hash_lookup(_cache.names, devname)) return_0; return 1;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/dev-io.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/dev-io.c
Changed
@@ -310,7 +310,7 @@ if (dm_list_empty(&dev->aliases)) { /* shouldn't happen */ - log_print("Cannot open device %d:%d with no valid paths.", (int)MAJOR(dev->dev), (int)MINOR(dev->dev)); + log_print_unless_silent("Cannot open device %d:%d with no valid paths.", (int)MAJOR(dev->dev), (int)MINOR(dev->dev)); return 0; } name = dev_name(dev);
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/dev-mpath.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/dev-mpath.c
Changed
@@ -50,7 +50,7 @@ FILE *fp; char lineMAX_WWID_LINE; char wwidMAX_WWID_LINE; - char *word, *p; + char *word; int section_black = 0; int section_exceptions = 0; int found_quote; @@ -100,7 +100,7 @@ * section, and skips those (should the entire mp * config filtering be disabled if non-wwids are seen? */ - if (!(p = strstr(word, "wwid"))) + if (!strstr(word, "wwid")) continue; i += 4; /* skip "wwid" */ @@ -209,7 +209,7 @@ int count = 0; if (config_wwids_file0 != '/') { - log_print("Ignoring unknown multipath_wwids_file."); + log_print_unless_silent("Ignoring unknown multipath_wwids_file."); return; } @@ -466,8 +466,8 @@ struct dirent *de; int dev_major = MAJOR(dev->dev); int dev_minor = MINOR(dev->dev); - int dm_dev_major; - int dm_dev_minor; + unsigned dm_dev_major; + unsigned dm_dev_minor; struct stat info; int is_mpath_component = 0; @@ -539,8 +539,8 @@ dev_name(dev), dm_dev_path, errno); continue; } - dm_dev_major = (int)MAJOR(info.st_rdev); - dm_dev_minor = (int)MINOR(info.st_rdev); + dm_dev_major = MAJOR(info.st_rdev); + dm_dev_minor = MINOR(info.st_rdev); if (dm_dev_major != dt->device_mapper_major) { log_debug_devs("dev_is_mpath_component %s holder %s %d:%d does not have dm major", @@ -688,7 +688,8 @@ * primary_result 2: dev is a partition, primary_dev is the whole device * primary_result 1: dev is a whole device */ - primary_result = dev_get_primary_dev(dt, dev, &primary_dev); + if (!(primary_result = dev_get_primary_dev(dt, dev, &primary_dev))) + return_0; if (_dev_is_mpath_component_sysfs(cmd, dev, primary_result, primary_dev, holder_devno) == 1) goto found; @@ -766,7 +767,7 @@ continue; if (strstr(sysbuf, "scsi_debug")) { - int i; + unsigned i; for (i = 0; i < strlen(sysbuf); i++) { if (sysbufi == ' ') sysbufi = '_';
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/dev-type.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/dev-type.c
Changed
@@ -89,7 +89,7 @@ DIR *d; struct dirent *dirent; char *holder_name; - int dm_dev_major, dm_dev_minor; + unsigned dm_dev_major, dm_dev_minor; size_t lvm_prefix_len = sizeof(UUID_PREFIX) - 1; size_t lvm_uuid_len = sizeof(UUID_PREFIX) - 1 + 2 * ID_LEN; size_t uuid_len; @@ -827,7 +827,7 @@ { blkid_probe probe = NULL; const char *type_str = NULL, *size_str = NULL; - size_t len; + size_t len = 0; int ret = 1; int rc; @@ -887,8 +887,8 @@ int fs_get_blkid(const char *pathname, struct fs_info *fsi) { blkid_probe probe = NULL; - const char *str; - size_t len; + const char *str = ""; + size_t len = 0; uint64_t fslastblock = 0; unsigned int fsblocksize = 0; int rc; @@ -915,7 +915,7 @@ return 0; } else if (rc == 1) { /* no file system on the device */ - log_print("No file system found on %s.", pathname); + log_print_unless_silent("No file system found on %s.", pathname); fsi->nofs = 1; blkid_free_probe(probe); return 1; @@ -925,7 +925,7 @@ strncpy(fsi->fstype, str, sizeof(fsi->fstype)-1); else { /* any difference from blkid_do_safeprobe rc=1? */ - log_print("No file system type on %s.", pathname); + log_print_unless_silent("No file system type on %s.", pathname); fsi->nofs = 1; blkid_free_probe(probe); return 1;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/dev-type.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/dev-type.h
Changed
@@ -38,15 +38,15 @@ }; struct dev_types { - int md_major; - int blkext_major; - int drbd_major; - int device_mapper_major; - int emcpower_major; - int vxdmp_major; - int power2_major; - int dasd_major; - int loop_major; + unsigned md_major; + unsigned blkext_major; + unsigned drbd_major; + unsigned device_mapper_major; + unsigned emcpower_major; + unsigned vxdmp_major; + unsigned power2_major; + unsigned dasd_major; + unsigned loop_major; struct dev_type_def dev_type_arrayNUMBER_OF_MAJORS; };
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/device.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/device.h
Changed
@@ -238,8 +238,9 @@ int dev_mpath_init(const char *config_wwids_file); void dev_mpath_exit(void); int parse_vpd_ids(const unsigned char *vpd_data, int vpd_datalen, struct dm_list *ids); -int format_t10_id(const unsigned char *in, int in_bytes, unsigned char *out, int out_bytes); -int parse_vpd_serial(const unsigned char *in, char *out, int outsize); +int format_t10_id(const unsigned char *in, size_t in_bytes, unsigned char *out, size_t out_bytes); +int format_general_id(const char *in, size_t in_bytes, unsigned char *out, size_t out_bytes); +int parse_vpd_serial(const unsigned char *in, char *out, size_t outsize); /* dev_util */ int device_id_list_remove(struct dm_list *devices, struct device *dev);
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/device_id.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/device_id.c
Changed
@@ -185,6 +185,71 @@ } } +/* More than one _ in a row is replaced with one _ */ +static void _reduce_repeating_underscores(char *buf, size_t bufsize) +{ + char *tmpbuf; + unsigned us = 0, i, j = 0; + + if (!(tmpbuf = strndup(buf, bufsize-1))) + return; + + memset(buf, 0, bufsize); + + for (i = 0; i < strlen(tmpbuf); i++) { + if (tmpbufi == '_') + us++; + else + us = 0; + + if (us == 1) + bufj++ = '_'; + else if (us > 1) + continue; + else + bufj++ = tmpbufi; + + if (j == bufsize) + break; + } + bufbufsize-1 = '\0'; + free(tmpbuf); +} + +static void _remove_leading_underscores(char *buf, size_t bufsize) +{ + char *tmpbuf; + unsigned i, j = 0; + + if (buf0 != '_') + return; + + if (!(tmpbuf = strndup(buf, bufsize-1))) + return; + + memset(buf, 0, bufsize); + + for (i = 0; i < strlen(tmpbuf); i++) { + if (!j && tmpbufi == '_') + continue; + bufj++ = tmpbufi; + + if (j == bufsize) + break; + } + free(tmpbuf); +} + +static void _remove_trailing_underscores(char *buf, int bufsize) +{ + char *end; + + end = buf + strlen(buf) - 1; + while ((end > buf) && (*end == '_')) + end--; + end1 = '\0'; +} + static int _read_sys_block(struct cmd_context *cmd, struct device *dev, const char *suffix, char *sysbuf, int sysbufsize, int binary, int *retlen) @@ -406,7 +471,7 @@ int dev_read_vpd_wwids(struct cmd_context *cmd, struct device *dev) { - unsigned char vpd_dataVPD_SIZE = { 0 }; + char vpd_dataVPD_SIZE = { 0 }; int vpd_datalen = 0; dev->flags |= DEV_ADDED_VPD_WWIDS; @@ -417,36 +482,48 @@ return 0; /* adds dev_wwid entry to dev->wwids for each id in vpd data */ - parse_vpd_ids(vpd_data, vpd_datalen, &dev->wwids); + parse_vpd_ids((const unsigned char *)vpd_data, vpd_datalen, &dev->wwids); return 1; } int dev_read_sys_wwid(struct cmd_context *cmd, struct device *dev, - char *buf, int bufsize, struct dev_wwid **dw_out) + char *outbuf, int outbufsize, struct dev_wwid **dw_out) { - char tmpbufDEV_WWID_SIZE; + char bufDEV_WWID_SIZE = { 0 }; struct dev_wwid *dw; + int is_t10 = 0; int ret; + unsigned i; dev->flags |= DEV_ADDED_SYS_WWID; - ret = read_sys_block(cmd, dev, "device/wwid", buf, bufsize); + ret = read_sys_block(cmd, dev, "device/wwid", buf, sizeof(buf)); if (!ret || !buf0) { /* the wwid file is not under device for nvme devs */ - ret = read_sys_block(cmd, dev, "wwid", buf, bufsize); + ret = read_sys_block(cmd, dev, "wwid", buf, sizeof(buf)); } if (!ret || !buf0) return 0; - /* in t10 id, replace characters like space and quote */ - if (!strncmp(buf, "t10.", 4)) { - if (bufsize < DEV_WWID_SIZE) - return 0; - memcpy(tmpbuf, buf, DEV_WWID_SIZE); - memset(buf, 0, bufsize); - format_t10_id((const unsigned char *)tmpbuf, DEV_WWID_SIZE, (unsigned char *)buf, bufsize); + for (i = 0; i < sizeof(buf) - 4; i++) { + if (bufi == ' ') + continue; + if (!strncmp(&bufi, "t10", 3)) + is_t10 = 1; + break; } + /* + * Remove leading and trailing spaces. + * Replace internal spaces with underscores. + * t10 wwids have multiple sequential spaces + * replaced by a single underscore. + */ + if (is_t10) + format_t10_id((const unsigned char *)buf, sizeof(buf), (unsigned char *)outbuf, outbufsize); + else + format_general_id((const char *)buf, sizeof(buf), (unsigned char *)outbuf, outbufsize); + /* Note, if wwids are also read from vpd, this same wwid will be added again. */ if (!(dw = dev_add_wwid(buf, 0, &dev->wwids))) @@ -457,9 +534,9 @@ } static int _dev_read_sys_serial(struct cmd_context *cmd, struct device *dev, - char *buf, int bufsize) + char *outbuf, int outbufsize) { - unsigned char vpd_dataVPD_SIZE = { 0 }; + char bufVPD_SIZE = { 0 }; const char *devname; int vpd_datalen = 0; @@ -471,13 +548,16 @@ * (Only virtio disks /dev/vdx are known to use /sys/class/block/vdx/serial.) */ - read_sys_block(cmd, dev, "device/serial", buf, bufsize); - if (buf0) - return 1; + read_sys_block(cmd, dev, "device/serial", buf, sizeof(buf)); + if (buf0) { + format_general_id((const char *)buf, sizeof(buf), (unsigned char *)outbuf, outbufsize); + if (outbuf0) + return 1; + } - if (read_sys_block_binary(cmd, dev, "device/vpd_pg80", (char *)vpd_data, VPD_SIZE, &vpd_datalen) && vpd_datalen) { - parse_vpd_serial(vpd_data, buf, bufsize); - if (buf0) + if (read_sys_block_binary(cmd, dev, "device/vpd_pg80", buf, VPD_SIZE, &vpd_datalen) && vpd_datalen) { + parse_vpd_serial((const unsigned char *)buf, outbuf, outbufsize); + if (outbuf0) return 1; } @@ -487,7 +567,8 @@ char vdx8 = { 0 }; const char *sysfs_dir; const char *base; - int i, j = 0, ret; + unsigned i, j = 0; + int ret; /* /dev/vda to vda */ base = basename(devname); @@ -505,12 +586,13 @@ if (dm_snprintf(path, sizeof(path), "%s/class/block/%s/serial", sysfs_dir, vdx) < 0) return 0; - ret = get_sysfs_value(path, buf, bufsize, 0); + ret = get_sysfs_value(path, buf, sizeof(buf), 0); if (ret && !buf0) ret = 0; if (ret) { - bufbufsize - 1 = '\0'; - return 1; + format_general_id((const char *)buf, sizeof(buf), (unsigned char *)outbuf, outbufsize); + if (buf0)
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/filesystem.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/filesystem.c
Changed
@@ -96,7 +96,7 @@ int lv_crypt_is_active(struct cmd_context *cmd, char *lv_path) { - char crypt_pathPATH_MAX; + char crypt_pathPATH_MAX = { 0 }; struct stat st_lv; if (stat(lv_path, &st_lv) < 0) { @@ -111,7 +111,7 @@ struct fs_info *fsi, int include_mount) { char lv_pathPATH_MAX; - char crypt_pathPATH_MAX; + char crypt_pathPATH_MAX = { 0 }; struct stat st_lv; struct stat st_crypt; struct stat st_top; @@ -162,8 +162,8 @@ memset(&info, 0, sizeof(info)); - log_print("Checking crypt device %s on LV %s.", - crypt_path, display_lvname(lv)); + log_print_unless_silent("Checking crypt device %s on LV %s.", + crypt_path, display_lvname(lv)); if ((fd = open(crypt_path, O_RDONLY)) < 0) { log_error("Failed to open crypt path %s", crypt_path); @@ -234,7 +234,7 @@ char proc_fstypeFSTYPE_MAX; char proc_devpathPATH_MAX; char proc_mntpathPATH_MAX; - char mtab_mntpathPATH_MAX; + char mtab_mntpathPATH_MAX = { 0 }; char dm_devpathPATH_MAX; char tmp_pathPATH_MAX; char *dm_name; @@ -243,8 +243,6 @@ FILE *fme = NULL; struct mntent *me; int renamed = 0; - int found_dir = 0; - int found_dev = 0; int dev_match, dir_match; if (stat(lv_path, &st_lv) < 0) { @@ -281,13 +279,16 @@ } endmntent(fme); + if (mtab_mntpath0) + log_debug("%s mtab mntpath %s", display_lvname(lv), mtab_mntpath); + /* * In mtab dir path, replace each ascii space character with the * four characters \040 which is how /proc/mounts represents spaces. * The mnt dir from /etc/mtab and /proc/mounts are compared below. */ if (strchr(mtab_mntpath, ' ')) { - int i, j = 0; + unsigned i, j = 0; memcpy(tmp_path, mtab_mntpath, sizeof(tmp_path)); memset(mtab_mntpath, 0, sizeof(mtab_mntpath)); for (i = 0; i < sizeof(tmp_path); i++) { @@ -319,15 +320,31 @@ if (strcmp(fstype, proc_fstype)) continue; + /* + * When an LV is mounted on two dirs, it appears in /proc/mounts twice as + * /dev/mapper/vg-lvol0 on /foo type xfs ... + * /dev/mapper/vg-lvol0 on /bar type xfs ... + * All entries match dm_devpath, one entry matches mntpath, + * and other entries don't match mntpath. + * + * When an LV is mounted on one dir, and is renamed from lvol0 to lvol1, + * it appears in /proc/mounts once as + * /dev/mapper/vg-lvol0 on /foo type xfs ... + */ + dir_match = !strcmp(mtab_mntpath, proc_mntpath); dev_match = !strcmp(dm_devpath, proc_devpath); - if (dir_match) - found_dir++; - if (dev_match) - found_dev++; + if (!dir_match && !dev_match) + continue; + + if (dev_match && !dir_match) { + log_debug("LV %s mounted at %s also mounted at %s.", + dm_devpath, mtab_mntpath, proc_mntpath); + continue; + } - if (dir_match != dev_match) { + if (!dev_match && dir_match) { log_error("LV %s mounted at %s may have been renamed (from %s).", dm_devpath, proc_mntpath, proc_devpath); renamed = 1; @@ -337,26 +354,10 @@ if (fclose(fp)) stack; - /* - * Don't try resizing if: - * - different device names apppear for the mount point - * (LVs probably renamed while mounted), or - * - the mount point for the LV appears multiple times, or - * - the LV device is listed for multiple mounts. - */ if (renamed) { log_error("File system resizing not supported: fs utilities do not support renamed devices."); return 1; } - /* These two are likely detected as renamed, but include checks in case. */ - if (found_dir > 1) { - log_error("File system resizing not supported: %s appears more than once in /proc/mounts.", mtab_mntpath); - return 1; - } - if (found_dev > 1) { - log_error("File system resizing not supported: %s appears more than once in /proc/mounts.", dm_devpath); - return 1; - } return 0; } @@ -470,16 +471,16 @@ devpath = fsi->needs_crypt ? crypt_path : (char *)display_lvname(lv); - log_print("Reducing file system %s to %s (%llu bytes) on %s...", - fsi->fstype, display_size(cmd, newsize_bytes_fs/512), - (unsigned long long)newsize_bytes_fs, devpath); + log_print_unless_silent("Reducing file system %s to %s (%llu bytes) on %s...", + fsi->fstype, display_size(cmd, newsize_bytes_fs/512), + (unsigned long long)newsize_bytes_fs, devpath); if (!exec_cmd(cmd, argv, &status, 1)) { log_error("Failed to reduce file system with lvresize_fs_helper."); return 0; } - log_print("Reduced file system %s on %s.", fsi->fstype, devpath); + log_print_unless_silent("Reduced file system %s on %s.", fsi->fstype, devpath); return 1; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/online.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/online.c
Changed
@@ -276,7 +276,7 @@ if (vgname) { if ((len2 = dm_snprintf(buf + len1, sizeof(buf) - len1, "vg:%s\n", vgname)) < 0) { - log_print("Incomplete online file for %s %d:%d vg %s.", dev_name(dev), major, minor, vgname); + log_print_unless_silent("Incomplete online file for %s %d:%d vg %s.", dev_name(dev), major, minor, vgname); /* can still continue without vgname */ len2 = 0; } @@ -285,7 +285,7 @@ devnamelen = dm_snprintf(devname, sizeof(devname), "%s", dev_name(dev)); if ((devnamelen > 5) && (devnamelen < NAME_LEN-1)) { if ((len3 = dm_snprintf(buf + len1 + len2, sizeof(buf) - len1 - len2, "dev:%s\n", devname)) < 0) { - log_print("Incomplete devname in online file for %s.", dev_name(dev)); + log_print_unless_silent("Incomplete devname in online file for %s.", dev_name(dev)); /* can continue without devname */ len3 = 0; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/online.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/online.h
Changed
@@ -32,9 +32,9 @@ #define log_print_pvscan(cmd, fmt, args...) \ do \ if (cmd->udevoutput) \ - log_print(fmt, ##args); \ + log_print_unless_silent(fmt, ##args); \ else \ - log_print("pvscan%d " fmt, getpid(), ##args); \ + log_print_unless_silent("pvscan%d " fmt, getpid(), ##args); \ while (0) #define log_error_pvscan(cmd, fmt, args...) \
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/device/parse_vpd.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/device/parse_vpd.c
Changed
@@ -36,14 +36,64 @@ #include <assert.h> /* + * Remove leading spaces. + * Remove trailing spaces. + * Replace each space with underscore. + * Skip quotes, non-ascii, non-printable. + */ +int format_general_id(const char *in, size_t in_bytes, unsigned char *out, size_t out_bytes) +{ + const char *end; + size_t end_bytes = strlen(in); + int retlen = 0; + unsigned j = 0; + unsigned i; + + if (!end_bytes) + return 0; + + end = in + end_bytes - 1; + while ((end > in) && (*end == ' ')) { + end--; + end_bytes--; + } + + for (i = 0; i < end_bytes; i++) { + if (!ini) + break; + if (j >= (out_bytes - 2)) + break; + /* skip leading spaces */ + if (!retlen && (ini == ' ')) + continue; + /* skip non-ascii non-printable characters */ + if (!isascii(ini) || !isprint(ini)) + continue; + /* skip quote */ + if (ini == '"') + continue; + /* replace each space with _ */ + if (ini == ' ') + outj++ = '_'; + else + outj++ = ini; + retlen++; + } + return retlen; +} + +/* + * Remove leading spaces. + * Remove trailing spaces. * Replace series of spaces with a single _. + * Skip quotes, non-ascii, non-printable. */ -int format_t10_id(const unsigned char *in, int in_bytes, unsigned char *out, int out_bytes) +int format_t10_id(const unsigned char *in, size_t in_bytes, unsigned char *out, size_t out_bytes) { int in_space = 0; int retlen = 0; - int j = 0; - int i; + unsigned j = 0; + unsigned i; for (i = 0; i < in_bytes; i++) { if (!ini) @@ -118,7 +168,7 @@ case 0x1: /* T10 Vendor ID */ cur_id_size = d3; - if (cur_id_size + 4 > id_len) + if ((size_t)(cur_id_size + 4) > id_len) cur_id_size = id_len - 4; cur_id_str = d + 4; format_t10_id(cur_id_str, cur_id_size, tmp_str, sizeof(tmp_str)); @@ -203,7 +253,7 @@ * and if so does tolower() on the chars. */ if ((type == 2) || (type == 3)) { - int i; + unsigned i; for (i = 0; i < strlen(id); i++) idi = tolower(idi); } @@ -217,9 +267,9 @@ return id_size; } -int parse_vpd_serial(const unsigned char *in, char *out, int outsize) +int parse_vpd_serial(const unsigned char *in, char *out, size_t outsize) { - uint8_t len_buf2 __attribute__((aligned(8))) = { 0 };; + uint8_t len_buf2 __attribute__((aligned(8))) = { 0 }; size_t len; /* parsing code from multipath tools */
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/display/display.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/display/display.c
Changed
@@ -936,7 +936,8 @@ static const char _no = "no"; const char *answer = NULL; int c = silent_mode() ? EOF : 0; - int i = 0, ret = 0, sig = 0; + int ret = 0, sig = 0; + unsigned i = 0; char buf12; va_list ap;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/format_text/text_label.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/format_text/text_label.c
Changed
@@ -383,7 +383,7 @@ * somehow between the two reads.) */ if (!retries) { - log_print("Retrying metadata scan."); + log_print_unless_silent("Retrying metadata scan."); retries++; dev_invalidate(mdac->area.dev); goto retry;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/label/label.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/label/label.c
Changed
@@ -27,7 +27,6 @@ #include "lib/format_text/layout.h" #include "lib/device/device_id.h" #include "lib/device/online.h" -#include "lib/filters/filter.h" #include <sys/stat.h> #include <fcntl.h> @@ -267,7 +266,7 @@ static struct labeller *_find_lvm_header(struct device *dev, char *headers_buf, - int headers_buf_size, + size_t headers_buf_size, uint64_t *label_sector, uint64_t block_sector, uint64_t start_sector) @@ -342,7 +341,7 @@ * are performed in the processing functions to get that data. */ static int _process_block(struct cmd_context *cmd, struct dev_filter *f, - struct device *dev, char *headers_buf, int headers_buf_size, + struct device *dev, char *headers_buf, size_t headers_buf_size, uint64_t block_sector, uint64_t start_sector, int *is_lvm_device) { @@ -373,7 +372,7 @@ * that now. It's unlikely this is actually needed. */ if (dev->pvid0) { - log_print("Clear pvid and info for filtered dev %s", dev_name(dev)); + log_print_unless_silent("Clear pvid and info for filtered dev %s.", dev_name(dev)); lvmcache_del_dev(dev); memset(dev->pvid, 0, sizeof(dev->pvid)); } @@ -400,7 +399,7 @@ /* See comment above */ if (dev->pvid0) { - log_print("Clear pvid and info for no lvm header %s", dev_name(dev)); + log_print_unless_silent("Clear pvid and info for no lvm header %s", dev_name(dev)); lvmcache_del_dev(dev); memset(dev->pvid, 0, sizeof(dev->pvid)); } @@ -994,7 +993,7 @@ struct pv_online *po; struct device_list *devl, *devl2; int relax_deviceid_filter = 0; - int metadata_pv_count; + unsigned metadata_pv_count; int try_dev_scan = 0; dm_list_init(&pvs_online); @@ -1115,8 +1114,8 @@ dm_list_iterate_items_safe(devl, devl2, &devs) { if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, NULL)) { - log_print("%s excluded: %s.", - dev_name(devl->dev), dev_filtered_reason(devl->dev)); + log_print_unless_silent("%s excluded: %s.", + dev_name(devl->dev), dev_filtered_reason(devl->dev)); dm_list_del(&devl->list); dm_list_add(&devs_drop, &devl->list); } @@ -1147,7 +1146,7 @@ int has_pvid; if (!label_read_pvid(devl->dev, &has_pvid)) { - log_print("%s cannot read label.", dev_name(devl->dev)); + log_print_unless_silent("%s cannot read label.", dev_name(devl->dev)); dm_list_del(&devl->list); dm_list_add(&devs_drop, &devl->list); continue; @@ -1155,7 +1154,7 @@ if (!has_pvid) { /* Not an lvm device */ - log_print("%s not an lvm device.", dev_name(devl->dev)); + log_print_unless_silent("%s not an lvm device.", dev_name(devl->dev)); dm_list_del(&devl->list); dm_list_add(&devs_drop, &devl->list); continue; @@ -1167,8 +1166,8 @@ */ if (relax_deviceid_filter) { if (!(du = get_du_for_pvid(cmd, devl->dev->pvid))) { - log_print("%s excluded by devices file (checking PVID).", - dev_name(devl->dev)); + log_print_unless_silent("%s excluded by devices file (checking PVID).", + dev_name(devl->dev)); dm_list_del(&devl->list); dm_list_add(&devs_drop, &devl->list); continue; @@ -1181,8 +1180,8 @@ /* Applies all filters, including those that need data from dev. */ if (!cmd->filter->passes_filter(cmd, cmd->filter, devl->dev, NULL)) { - log_print("%s excluded: %s.", - dev_name(devl->dev), dev_filtered_reason(devl->dev)); + log_print_unless_silent("%s excluded: %s.", + dev_name(devl->dev), dev_filtered_reason(devl->dev)); dm_list_del(&devl->list); dm_list_add(&devs_drop, &devl->list); } @@ -1346,7 +1345,8 @@ dm_list_add(&filtered_devs, &devl->list); if (dev->pvid0) { - log_print("Clear pvid and info for filtered dev %s", dev_name(dev)); + log_print_unless_silent("Clear pvid and info for filtered dev %s.", + dev_name(dev)); lvmcache_del_dev(dev); memset(dev->pvid, 0, sizeof(dev->pvid)); }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/locking/lvmlockd.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/locking/lvmlockd.c
Changed
@@ -547,7 +547,7 @@ return 1; } -static int _extend_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg, int extend_mb) +static int _extend_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg, unsigned extend_mb) { struct device *dev; char pathPATH_MAX; @@ -608,7 +608,7 @@ (unsigned long long)old_size_bytes, (unsigned long long)new_size_bytes); - log_print("Zeroing %u MiB on extended internal lvmlock LV...", extend_mb); + log_print_unless_silent("Zeroing %u MiB on extended internal lvmlock LV...", extend_mb); if (!(dev = dev_cache_get(cmd, path, NULL))) { log_error("Extend sanlock LV %s cannot find device.", display_lvname(lv)); @@ -654,7 +654,7 @@ int handle_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg) { daemon_reply reply; - int extend_mb; + unsigned extend_mb; int result; int ret; @@ -663,7 +663,7 @@ if (!_lvmlockd_connected) return 0; - extend_mb = find_config_tree_int(cmd, global_sanlock_lv_extend_CFG, NULL); + extend_mb = (unsigned) find_config_tree_int(cmd, global_sanlock_lv_extend_CFG, NULL); /* * User can choose to not automatically extend the lvmlock LV @@ -3315,6 +3315,9 @@ int lockd_lv_uses_lock(struct logical_volume *lv) { + if (!lv_is_visible(lv)) + return 0; + if (lv_is_thin_volume(lv)) return 0; @@ -3368,9 +3371,6 @@ if (lv_is_raid_metadata(lv)) return 0; - if (!lv_is_visible(lv)) - return 0; - return 1; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/log/log.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/log/log.c
Changed
@@ -217,6 +217,45 @@ _lvm2_log_fn = log_fn; } +/* Read /proc/self/stat to extract pid and starttime */ +static int _get_pid_starttime(int *pid, unsigned long long *starttime) +{ + static const char statfile = "/proc/self/stat"; + char buf1024; + char *p; + int fd; + int e; + + if ((fd = open(statfile, O_RDONLY)) == -1) { + log_sys_debug("open", statfile); + return 0; + } + + if ((e = read(fd, buf, sizeof(buf) - 1)) <= 0) + log_sys_debug("read", statfile); + + if (!close(fd)) + log_sys_debug("close", statfile); + + if (e <= 0) + return 0; + + bufe = '\0'; + if ((sscanf(buf, "%d ", pid) == 1) && + /* Jump past COMM, don't use scanf with '%s' since COMM may contain a space. */ + (p = strrchr(buf, ')')) && + (sscanf(++p, " %*c %*d %*d %*d %*d " /* tty_nr */ + "%*d %*u %*u %*u %*u " /* mjflt */ + "%*u %*u %*u %*d %*d " /* cstim */ + "%*d %*d %*d %*d " /* itrealvalue */ + "%llu", starttime) == 1)) + return 1; + + log_debug("Cannot parse content of %s.", statfile); + + return 0; +} + /* * Support envvar LVM_LOG_FILE_EPOCH and allow to attach * extra keyword (consist of upto 32 alpha chars) to @@ -228,11 +267,9 @@ */ void init_log_file(const char *log_file, int append) { - static const char statfile = "/proc/self/stat"; const char *env; - int pid; - unsigned long long starttime; - FILE *st; + int pid = 0; + unsigned long long starttime = 0; int i = 0; _log_file_path0 = '\0'; @@ -245,28 +282,18 @@ goto no_epoch; } - if (!(st = fopen(statfile, "r"))) - log_sys_error("fopen", statfile); - else if (fscanf(st, "%d %*s %*c %*d %*d %*d %*d " /* tty_nr */ - "%*d %*u %*u %*u %*u " /* mjflt */ - "%*u %*u %*u %*d %*d " /* cstim */ - "%*d %*d %*d %*d " /* itrealvalue */ - "%llu", &pid, &starttime) != 2) { - log_warn("WARNING: Cannot parse content of %s.", statfile); + if (!_get_pid_starttime(&pid, &starttime)) + log_debug("Failed to obtain pid and starttime."); + + if (dm_snprintf(_log_file_path, sizeof(_log_file_path), + "%s_%s_%d_%llu", log_file, env, pid, starttime) < 0) { + log_warn("WARNING: Debug log file path is too long for epoch."); + _log_file_path0 = '\0'; } else { - if (dm_snprintf(_log_file_path, sizeof(_log_file_path), - "%s_%s_%d_%llu", log_file, env, pid, starttime) < 0) { - log_warn("WARNING: Debug log file path is too long for epoch."); - _log_file_path0 = '\0'; - } else { - log_file = _log_file_path; - append = 1; /* force */ - } + log_file = _log_file_path; + append = 1; /* force */ } - if (st && fclose(st)) - log_sys_debug("fclose", statfile); - if ((env = getenv("LVM_LOG_FILE_MAX_LINES"))) { if (sscanf(env, FMTu64, &_log_file_max_lines) != 1) { log_warn("WARNING: Ignoring invalid LVM_LOG_MAX_LINES envvar \"%s\".", env); @@ -893,7 +920,6 @@ return LOG_JOURNAL_OUTPUT; if (!strcasecmp(str, "debug")) return LOG_JOURNAL_DEBUG; - log_warn("Ignoring unrecognized journal value."); + log_warn("WARNING: Ignoring unrecognized journal value."); return 0; } -
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/cache_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/cache_manip.c
Changed
@@ -356,17 +356,10 @@ return 0; } - /* - * Only linear, striped or raid supported. - * FIXME Tidy up all these type restrictions. - */ if (lv_is_cache_type(origin_lv) || lv_is_mirror_type(origin_lv) || - lv_is_thin_volume(origin_lv) || lv_is_thin_pool_metadata(origin_lv) || lv_is_merging_origin(origin_lv) || - lv_is_cow(origin_lv) || lv_is_merging_cow(origin_lv) || - /* TODO: think about enabling caching of a single thin volume */ - (lv_is_virtual(origin_lv) && !lv_is_vdo(origin_lv))) { + lv_is_cow(origin_lv) || lv_is_merging_cow(origin_lv)) { log_error("Cache is not supported with %s segment type of the original logical volume %s.", lvseg_name(first_seg(origin_lv)), display_lvname(origin_lv)); return 0; @@ -428,7 +421,7 @@ if (!(segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_CACHE))) return_NULL; - if (!insert_layer_for_lv(cmd, cache_lv, CACHE, "_corig")) + if (!insert_layer_for_lv(cmd, cache_lv, 0, "_corig")) return_NULL; seg = first_seg(cache_lv); @@ -1229,6 +1222,7 @@ if (!pool_seg->chunk_size && /* TODO: some calc_policy solution for cache ? */ !recalculate_pool_chunk_size_with_dev_hints(pool_seg->lv, + seg_lv(pool_seg, 0), THIN_CHUNK_SIZE_CALC_METHOD_GENERIC)) return_0; } @@ -1248,6 +1242,7 @@ int wipe_cache_pool(struct logical_volume *cache_pool_lv) { int r; + struct logical_volume *cache_data_lv; /* Only unused cache-pool could be activated and wiped */ if (lv_is_used_cache_pool(cache_pool_lv) || lv_is_cache_vol(cache_pool_lv)) { @@ -1256,6 +1251,16 @@ return 0; } + cache_data_lv = (lv_is_cache_pool(cache_pool_lv)) ? + seg_lv(first_seg(cache_pool_lv), 0) : cache_pool_lv; + + if (cache_data_lv && seg_cannot_be_zeroed(first_seg(cache_data_lv))) { + log_debug("Skipping wipe of %s volume with %s segtype.", + display_lvname(cache_data_lv), + first_seg(cache_data_lv)->segtype->name); + return 1; + } + cache_pool_lv->status |= LV_TEMPORARY; if (!activate_lv(cache_pool_lv->vg->cmd, cache_pool_lv)) { log_error("Aborting. Failed to activate cache pool %s.",
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/integrity_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/integrity_manip.c
Changed
@@ -359,8 +359,8 @@ } else if (!lbs_4k && !lbs_512) { if (!settings->block_size) settings->block_size = 512; - log_print("Using integrity block size %u with unknown device logical block size.", - settings->block_size); + log_print_unless_silent("Using integrity block size %u with unknown device logical block size.", + settings->block_size); } else { goto_bad; } @@ -385,7 +385,7 @@ */ rv = fs_block_size_and_type(pathname, &fs_block_size, NULL, NULL); if (!rv || !fs_block_size) { - int use_bs; + unsigned use_bs; if (lbs_4k && pbs_4k) { use_bs = 4096; @@ -408,8 +408,8 @@ settings->block_size = use_bs; - log_print("Using integrity block size %u for unknown file system block size, logical block size %u, physical block size %u.", - settings->block_size, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512); + log_print_unless_silent("Using integrity block size %u for unknown file system block size, logical block size %u, physical block size %u.", + settings->block_size, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512); goto out; } @@ -419,13 +419,13 @@ for an application that expects a given io size/alignment is possible. */ settings->block_size = 512; if (fs_block_size > 512) - log_print("Limiting integrity block size to 512 because the LV is active."); + log_print_unless_silent("Limiting integrity block size to 512 because the LV is active."); } else if (fs_block_size <= 4096) settings->block_size = fs_block_size; else settings->block_size = 4096; /* dm-integrity max is 4096 */ - log_print("Using integrity block size %u for file system block size %u.", - settings->block_size, fs_block_size); + log_print_unless_silent("Using integrity block size %u for file system block size %u.", + settings->block_size, fs_block_size); } else { /* let user specify integrity block size that is less than fs block size */ if (settings->block_size > fs_block_size) { @@ -433,8 +433,8 @@ settings->block_size, fs_block_size); goto bad; } - log_print("Using integrity block size %u for file system block size %u.", - settings->block_size, fs_block_size); + log_print_unless_silent("Using integrity block size %u for file system block size %u.", + settings->block_size, fs_block_size); } } out: @@ -484,7 +484,7 @@ struct logical_volume *imeta_lvsDEFAULT_RAID_MAX_IMAGES; struct cmd_context *cmd = lv->vg->cmd; struct volume_group *vg = lv->vg; - struct logical_volume *lv_image, *lv_imeta, *lv_iorig; + struct logical_volume *lv_image, *lv_imeta; struct lv_segment *seg_top, *seg_image; struct pv_list *pvl; const struct segment_type *segtype; @@ -508,11 +508,6 @@ return 0; } - if (lv_is_origin(lv)) { - log_error("Integrity cannot be added to snapshot origins."); - return 0; - } - seg_top = first_seg(lv); area_count = seg_top->area_count; @@ -682,7 +677,7 @@ * but gets a new integrity segment, in place of the segments * that were moved to lv_iorig. */ - if (!(lv_iorig = insert_layer_for_lv(cmd, lv_image, INTEGRITY, "_iorig"))) + if (!insert_layer_for_lv(cmd, lv_image, 0, "_iorig")) goto_bad; lv_image->status |= INTEGRITY;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/lv.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/lv.c
Changed
@@ -311,10 +311,11 @@ segm = first_seg(seg->lv->snapshot->lv); // log_debug("Query LV:%s mon:%s segm:%s tgtm:%p segmon:%d statusm:%d", seg->lv->name, segm->lv->name, segm->segtype->name, segm->segtype->ops->target_monitored, seg_monitored(segm), (int)(segm->status & PVMOVE)); - if ((dmeventd_monitor_mode() != 1) || - !segm->segtype->ops || + if (!segm->segtype->ops || !segm->segtype->ops->target_monitored) /* Nothing to do, monitoring not supported */; + else if (dmeventd_monitor_mode() != 1) + s = "not enabled"; else if (lv_is_cow_covering_origin(seg->lv)) /* Nothing to do, snapshot already covers origin */; else if (!seg_monitored(segm) || (segm->status & PVMOVE))
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/lv_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/lv_manip.c
Changed
@@ -4370,13 +4370,12 @@ for (s = 0; s < seg->area_count; s++) { struct logical_volume *lv_image; struct logical_volume *lv_iorig; - struct logical_volume *lv_imeta; struct lv_segment *seg_image; lv_image = seg_lv(seg, s); seg_image = first_seg(lv_image); - if (!(lv_imeta = seg_image->integrity_meta_dev)) { + if (!seg_image->integrity_meta_dev) { log_error("1"); return 0; } @@ -4455,6 +4454,41 @@ return 1; } +/* Check either RAID images and metas are being allocated redundantly. */ +static int _lv_raid_redundant(struct logical_volume *lv, + struct dm_list *allocatable_pvs, int meta) +{ + uint32_t nlvs, s; + struct lv_segment *seg = first_seg(lv); + struct pv_list *pvl; + + if (meta && !seg->meta_areas) + return 1; + + dm_list_iterate_items(pvl, allocatable_pvs) { + nlvs = 0; + + for (s = 0; s < seg->area_count; s++) { + struct logical_volume *slv = meta ? seg_metalv(seg, s) : seg_lv(seg, s); + + if (slv && lv_is_on_pv(slv, pvl->pv) && nlvs++) { + log_error("LV %s using PV %s is not redundant.", + display_lvname(slv), dev_name(pvl->pv->dev)); + return 0; + } + } + } + + return 1; +} + +/* Check both RAID images and metas are being allocated redundantly. */ +static int _lv_raid_redundant_allocation(struct logical_volume *lv, struct dm_list *allocatable_pvs) +{ + return _lv_raid_redundant(lv, allocatable_pvs, 0) && + _lv_raid_redundant(lv, allocatable_pvs, 1); +} + /* * Entry point for single-step LV allocation + extension. * Extents is the number of logical extents to append to the LV unless @@ -4557,6 +4591,15 @@ mirrors, stripes, stripe_size))) goto_out; + if (segtype_is_raid(segtype) && + alloc != ALLOC_ANYWHERE && + !(r = _lv_raid_redundant_allocation(lv, allocatable_pvs))) { + log_error("Insufficient suitable allocatable extents for logical volume %s", display_lvname(lv)); + if (!lv_remove(lv) || !vg_write(lv->vg) || !vg_commit(lv->vg)) + return_0; + goto out; + } + if (lv_raid_has_integrity(lv)) { if (!lv_extend_integrity_in_raid(lv, allocatable_pvs)) { r = 0; @@ -4970,7 +5013,7 @@ enum fsadm_cmd_e { FSADM_CMD_CHECK, FSADM_CMD_RESIZE }; -#define FSADM_CMD_MAX_ARGS 6 +#define FSADM_CMD_MAX_ARGS 10 #define FSADM_CHECK_FAILS_FOR_MOUNTED 3 /* shell exist status code */ /* @@ -4988,10 +5031,15 @@ struct cmd_context *cmd = vg->cmd; char lv_pathPATH_MAX; char size_bufSIZE_BUF; - const char *argvFSADM_CMD_MAX_ARGS + 4; - unsigned i = 0; + unsigned i = 1; + const char *argvFSADM_CMD_MAX_ARGS = { + find_config_tree_str(cmd, global_fsadm_executable_CFG, NULL) + }; - argvi++ = find_config_tree_str(cmd, global_fsadm_executable_CFG, NULL); + if (!argv0 || !*argv0) { + log_error("Cannot use misconfigured fsadm executable to resize %s.", display_lvname(lv)); + return 0; + } if (test_mode()) argvi++ = "--dry-run"; @@ -5028,8 +5076,6 @@ argvi++ = size_buf; } - argvi = NULL; - return exec_cmd(cmd, argv, status, 1); } @@ -5145,21 +5191,35 @@ static uint32_t _lvseg_get_stripes(struct lv_segment *seg, uint32_t *stripesize) { uint32_t s; - struct lv_segment *seg_mirr; + struct lv_segment *seg_get, *seg_image, *seg_iorig; + struct logical_volume *lv_image, *lv_iorig; /* If segment mirrored, check if images are striped */ - if (seg_is_mirrored(seg)) + if (seg_is_mirrored(seg)) { for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV) continue; - seg_mirr = first_seg(seg_lv(seg, s)); - if (seg_is_striped(seg_mirr)) { - seg = seg_mirr; + lv_image = seg_lv(seg, s); + seg_image = first_seg(lv_image); + seg_get = NULL; + + if (seg_is_integrity(seg_image)) { + /* Get stripe values from the iorig layer. */ + lv_iorig = seg_lv(seg_image, 0); + seg_iorig = first_seg(lv_iorig); + seg_get = seg_iorig; + } else { + /* Get stripe values from the image layer. */ + seg_get = seg_image; + } + + if (seg_get && seg_is_striped(seg_get)) { + seg = seg_get; break; } } - + } if (seg_is_striped(seg)) { *stripesize = seg->stripe_size; @@ -5168,7 +5228,7 @@ if (seg_is_raid(seg)) { *stripesize = seg->stripe_size; - return _raid_stripes_count(seg); + return _raid_stripes_count(seg); } *stripesize = 0; @@ -5529,6 +5589,7 @@ seg_size = lp->extents - existing_logical_extents; // Recalculate if (lp->extents == existing_logical_extents) { /* Signal that normal resizing is not required */ + lp->size_changed = 1; return 1; } } @@ -5593,7 +5654,7 @@ seg_size /= seg_mirrors; lp->extents = logical_extents_used + seg_size; break; - } + } } else if (new_extents <= logical_extents_used + seg_logical_extents) { seg_size = new_extents - logical_extents_used; lp->extents = new_extents; @@ -5617,8 +5678,8 @@ } if ((lp->extents == existing_logical_extents) && !lp->use_policies) { - log_print("New size (%d extents) matches existing size (%d extents).", - lp->extents, existing_logical_extents); + log_print_unless_silent("New size (%d extents) matches existing size (%d extents).", + lp->extents, existing_logical_extents); if (lp->resize == LV_ANY) lp->resize = LV_EXTEND; /* lets pretend zero size extension */ *matches_existing = 1; @@ -5677,8 +5738,8 @@ } lp->resize = LV_EXTEND; } else if ((lp->extents == existing_logical_extents) && !lp->use_policies) { - log_print("New size (%d extents) matches existing size (%d extents)", - lp->extents, existing_logical_extents); + log_print_unless_silent("New size (%d extents) matches existing size (%d extents)", + lp->extents, existing_logical_extents); if (lp->resize == LV_ANY) lp->resize = LV_EXTEND; *matches_existing = 1;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/merge.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/merge.c
Changed
@@ -555,7 +555,6 @@ if (seg->vdo_params.minimum_io_size | seg->vdo_params.block_map_cache_size_mb | seg->vdo_params.block_map_era_length | - seg->vdo_params.check_point_frequency | seg->vdo_params.index_memory_size_mb | seg->vdo_params.slab_size_mb | seg->vdo_params.max_discard |
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/metadata-exported.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/metadata-exported.h
Changed
@@ -277,6 +277,9 @@ #define lv_is_removed(lv) (((lv)->status & LV_REMOVED) ? 1 : 0) +#define lv_is_zero(lv) ((dm_list_size(&lv->segments) == 1) && seg_is_zero(first_seg(lv))) +#define lv_is_error(lv) ((dm_list_size(&lv->segments) == 1) && seg_is_error(first_seg(lv))) + /* Recognize component LV (matching lib/misc/lvm-string.c _lvname_has_reserved_component_string()) */ #define lv_is_component(lv) (lv_is_cache_origin(lv) || \ lv_is_writecache_origin(lv) || \ @@ -879,9 +882,15 @@ int thin_pool_is_active(const struct logical_volume *lv); int thin_pool_supports_external_origin(const struct lv_segment *pool_seg, const struct logical_volume *external_lv); int thin_pool_feature_supported(const struct logical_volume *lv, int feature); +int thin_pool_prepare_metadata(struct logical_volume *metadata_lv, + uint32_t chunk_size, + uint64_t data_blocks, + uint64_t data_begin, + uint64_t data_length); int update_thin_pool_lv(struct logical_volume *lv, int activate); int recalculate_pool_chunk_size_with_dev_hints(struct logical_volume *pool_lv, + struct logical_volume *pool_data_lv, int chunk_size_calc_policy); int validate_cache_chunk_size(struct cmd_context *cmd, uint32_t chunk_size); int validate_thin_pool_chunk_size(struct cmd_context *cmd, uint32_t chunk_size); @@ -916,7 +925,7 @@ const char *get_pool_discards_name(thin_discards_t discards); int set_pool_discards(thin_discards_t *discards, const char *str); struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv, - const char *name, uint32_t read_ahead, + uint32_t read_ahead, uint32_t stripes, uint32_t stripe_size, uint32_t extents, alloc_policy_t alloc, struct dm_list *pvh);
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/metadata.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/metadata.c
Changed
@@ -931,7 +931,7 @@ } else { /* 12 bits for major number */ if ((major != -1) && - (major != cmd->dev_types->device_mapper_major)) { + (major != (int)cmd->dev_types->device_mapper_major)) { /* User supplied some major number */ if (major < 0 || major > 4095) { log_error("Major number %d outside range 0-4095.", major); @@ -2642,8 +2642,8 @@ if (!strcmp(vg->lock_type, "sanlock")) { if (dm_hash_lookup(vhash.lv_lock_args, lvl->lv->lock_args)) { - log_error(INTERNAL_ERROR "LV %s/%s has duplicate lock_args %s.", - vg->name, lvl->lv->name, lvl->lv->lock_args); + log_error(INTERNAL_ERROR "LV %s has duplicate lock_args %s.", + display_lvname(lvl->lv), lvl->lv->lock_args); r = 0; } @@ -2657,15 +2657,15 @@ if (lv_is_cache_vol(lvl->lv)) { log_debug("lock_args will be ignored on cache vol"); } else if (lvl->lv->lock_args) { - log_error(INTERNAL_ERROR "LV %s/%s shouldn't have lock_args", - vg->name, lvl->lv->name); + log_error(INTERNAL_ERROR "LV %s shouldn't have lock_args %s.", + display_lvname(lvl->lv), lvl->lv->lock_args); r = 0; } } } else { if (lvl->lv->lock_args) { - log_error(INTERNAL_ERROR "LV %s/%s with no lock_type has lock_args %s", - vg->name, lvl->lv->name, lvl->lv->lock_args); + log_error(INTERNAL_ERROR "LV %s with no lock_type has lock_args %s.", + display_lvname(lvl->lv), lvl->lv->lock_args); r = 0; } }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/pool_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/pool_manip.c
Changed
@@ -416,9 +416,9 @@ } int recalculate_pool_chunk_size_with_dev_hints(struct logical_volume *pool_lv, + struct logical_volume *pool_data_lv, int chunk_size_calc_policy) { - struct logical_volume *pool_data_lv; struct lv_segment *seg; struct physical_volume *pv; struct cmd_context *cmd = pool_lv->vg->cmd; @@ -439,7 +439,6 @@ return 0; } - pool_data_lv = seg_lv(first_seg(pool_lv), 0); dm_list_iterate_items(seg, &pool_data_lv->segments) { switch (seg_type(seg, 0)) { case AREA_PV: @@ -607,7 +606,7 @@ } struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv, - const char *name, uint32_t read_ahead, + uint32_t read_ahead, uint32_t stripes, uint32_t stripe_size, uint32_t extents, alloc_policy_t alloc, struct dm_list *pvh) @@ -639,9 +638,6 @@ if (!(metadata_lv = lv_create_single(pool_lv->vg, &lvc))) return_0; - if (!lv_rename_update(pool_lv->vg->cmd, metadata_lv, name, 0)) - return_0; - return metadata_lv; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/raid_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/raid_manip.c
Changed
@@ -3112,14 +3112,23 @@ { struct dm_list removed_lvs; - if (!archive(lv->vg)) - return_0; + if (new_count == 1) { + struct lv_segment *seg = first_seg(lv); + + if (seg_is_raid1(seg) && !lv_raid_image_in_sync(seg_lv(seg, 0))) { + log_error("%s is out-of-sync! Please try refreshing first.", display_lvname(lv)); + return 0; + } + } if (!removal_lvs) { dm_list_init(&removed_lvs); removal_lvs = &removed_lvs; } + if (!archive(lv->vg)) + return_0; + if (!_raid_extract_images(lv, 0, new_count, allocate_pvs, 1, removal_lvs, removal_lvs)) { log_error("Failed to extract images from %s.",
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/segtype.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/segtype.h
Changed
@@ -221,6 +221,8 @@ #define seg_is_vdo(seg) segtype_is_vdo((seg)->segtype) #define seg_is_vdo_pool(seg) segtype_is_vdo_pool((seg)->segtype) #define seg_is_virtual(seg) segtype_is_virtual((seg)->segtype) +#define seg_is_error(seg) segtype_is_error((seg)->segtype) +#define seg_is_zero(seg) segtype_is_zero((seg)->segtype) #define seg_unknown(seg) segtype_is_unknown((seg)->segtype) #define seg_can_split(seg) segtype_can_split((seg)->segtype) #define seg_cannot_be_zeroed(seg) segtype_cannot_be_zeroed((seg)->segtype)
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/snapshot_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/snapshot_manip.c
Changed
@@ -423,8 +423,6 @@ } } else if (lv_is_raid_type(origin_lv) && !lv_is_raid(origin_lv)) { err = "raid subvolumes"; - } else if (lv_is_raid(origin_lv) && lv_raid_has_integrity((struct logical_volume *)origin_lv)) { - err = "raid with integrity"; } out:
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/thin_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/thin_manip.c
Changed
@@ -20,6 +20,8 @@ #include "lib/metadata/segtype.h" #include "lib/config/defaults.h" #include "lib/display/display.h" +#include "lib/commands/toolcontext.h" +#include "lib/misc/lvm-exec.h" struct logical_volume *data_lv_from_thin_pool(struct logical_volume *pool_lv) { @@ -450,6 +452,73 @@ return 1; } +int thin_pool_prepare_metadata(struct logical_volume *metadata_lv, + uint32_t chunk_size, + uint64_t data_blocks, + uint64_t data_begin, + uint64_t data_length) +{ + struct cmd_context *cmd = metadata_lv->vg->cmd; + char lv_pathPATH_MAX, md_path64, buffer512; + const char *argvDEFAULT_MAX_EXEC_ARGS + 7 = { + find_config_tree_str_allow_empty(cmd, global_thin_restore_executable_CFG, NULL) + }; + int args = 0; + int r = 0; + int status; + FILE *f; + + if (dm_snprintf(lv_path, sizeof(lv_path), "%s%s/%s", cmd->dev_dir, + metadata_lv->vg->name, metadata_lv->name) < 0) { + log_error("Failed to create path %s%s/%s", cmd->dev_dir, + metadata_lv->vg->name, metadata_lv->name); + return 0; + } + + if (!prepare_exec_args(cmd, argv, &args, global_thin_restore_options_CFG)) + return_0; + + if (test_mode()) { + log_verbose("Test mode: Skipping creation of provisioned thin pool metadata."); + return 1; + } + + /* coveritysecure_temp until better solution */ + if (!(f = tmpfile())) { + log_error("Cannot create temporary file to prepare metadata."); + return 0; + } + + /* Build path for 'thin_restore' app with this 'hidden/deleted' tmpfile */ + (void) dm_snprintf(md_path, sizeof(md_path), "/proc/%u/fd/%u", getpid(), fileno(f)); + + argv++args = "-i"; + argv++args = md_path; + + argv++args = "-o"; + argv++args = lv_path; + + (void) dm_snprintf(buffer, sizeof(buffer), + "<superblock uuid=\"\" time=\"0\" transaction=\"1\" version=\"2\" data_block_size=\"%u\" nr_data_blocks=\"" FMTu64 "\">\n" + " <device dev_id=\"1\" mapped_blocks=\"" FMTu64 "\" transaction=\"0\" creation_time=\"0\" snap_time=\"0\">\n" + " <range_mapping origin_begin=\"0\" data_begin=\"" FMTu64 "\" length=\"" FMTu64 "\" time=\"0\"/>\n" + " </device>\n</superblock>", chunk_size, data_length, data_blocks, data_begin, data_length); + + log_debug("Preparing thin-pool metadata with thin volume mapping:\n%s", buffer); + + if (fputs(buffer, f) < 0) + log_sys_error("fputs", md_path); + else if (fflush(f)) + log_sys_error("fflush", md_path); + else if (!(r = exec_cmd(cmd, argv, &status, 1))) + stack; + + if (fclose(f)) + log_sys_debug("fclose", md_path); + + return r; +} + struct logical_volume *find_pool_lv(const struct logical_volume *lv) { struct lv_segment *seg;
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/metadata/vdo_manip.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/metadata/vdo_manip.c
Changed
@@ -243,21 +243,22 @@ uint64_t *logical_size) { char *dpath, *c; - const struct dm_config_node *cn; - const struct dm_config_value *cv; struct pipe_data pdata; uint64_t logical_size_aligned = 1; FILE *f; uint64_t lb; unsigned slabbits; - unsigned reformating = 0; - int args = 1; - char buf_args5128; + unsigned reformatting = 0; + int args = 0; char buf256; /* buffer for short disk header (64B) */ - const char *argv19 = { /* Max supported args */ + char *buf_pos = buf; + const char *argvDEFAULT_MAX_EXEC_ARGS + 9 = { /* Max supported args */ find_config_tree_str_allow_empty(data_lv->vg->cmd, global_vdo_format_executable_CFG, NULL) }; + if (!prepare_exec_args(data_lv->vg->cmd, argv, &args, global_vdo_format_options_CFG)) + return_0; + if (!(dpath = lv_path_dup(data_lv->vg->cmd->mem, data_lv))) { log_error("Failed to build device path for VDO formatting of data volume %s.", display_lvname(data_lv)); @@ -266,67 +267,31 @@ if (*logical_size) { logical_size_aligned = 0; - if (dm_snprintf(buf_argsargs, sizeof(buf_args0), "--logical-size=" FMTu64 "K", - (*logical_size / 2)) < 0) - return_0; - argvargs = buf_argsargs; - args++; + argv++args = buf_pos; + buf_pos += 1 + dm_snprintf(buf_pos, 30, "--logical-size=" FMTu64 "K", + (*logical_size / 2)); } slabbits = 31 - clz(vtp->slab_size_mb / DM_VDO_BLOCK_SIZE * 2 * 1024); /* to KiB / block_size */ log_debug("Slab size %s converted to %u bits.", display_size(data_lv->vg->cmd, vtp->slab_size_mb * UINT64_C(2 * 1024)), slabbits); - if (dm_snprintf(buf_argsargs, sizeof(buf_args0), "--slab-bits=%u", slabbits) < 0) - return_0; - argvargs = buf_argsargs; - args++; - - if (vtp->check_point_frequency) { - if (dm_snprintf(buf_argsargs, sizeof(buf_args0), "--uds-checkpoint-frequency=%u", - vtp->check_point_frequency) < 0) - return_0; - argvargs = buf_argsargs; - args++; - } + argv++args = buf_pos; + buf_pos += 1 + dm_snprintf(buf_pos, 30, "--slab-bits=%u", slabbits); /* Convert size to GiB units or one of these strings: 0.25, 0.50, 0.75 */ - if (vtp->index_memory_size_mb >= 1024) { - if (dm_snprintf(buf_argsargs, sizeof(buf_args0), "--uds-memory-size=%u", - vtp->index_memory_size_mb / 1024) < 0) - return_0; - } else if (dm_snprintf(buf_argsargs, sizeof(buf_args0), "--uds-memory-size=0.%u", - (vtp->index_memory_size_mb < 512) ? 25 : - (vtp->index_memory_size_mb < 768) ? 50 : 75) < 0) - return_0; - - argvargs = buf_argsargs; - args++; - - if (vtp->use_sparse_index) { - if (dm_snprintf(buf_argsargs, sizeof(buf_args0), "--uds-sparse") < 0) - return_0; - - argvargs = buf_argsargs; - args++; - } - - /* Any other user opts add here */ - if (!(cn = find_config_tree_array(data_lv->vg->cmd, global_vdo_format_options_CFG, NULL))) { - log_error(INTERNAL_ERROR "Unable to find configuration for vdoformat command options."); - return 0; - } - - for (cv = cn->v; cv && args < 16; cv = cv->next) { - if (cv->type != DM_CFG_STRING) { - log_error("Invalid string in config file: " - "global/vdoformat_options."); - return 0; - } - if (cv->v.str0) - argv++args = cv->v.str; - } + argv++args = buf_pos; + if (vtp->index_memory_size_mb >= 1024) + buf_pos += 1 + dm_snprintf(buf_pos, 30, "--uds-memory-size=%u", + vtp->index_memory_size_mb / 1024); + else + buf_pos += 1 + dm_snprintf(buf_pos, 30, "--uds-memory-size=0.%2u", + (vtp->index_memory_size_mb < 512) ? 25 : + (vtp->index_memory_size_mb < 768) ? 50 : 75); + + if (vtp->use_sparse_index) + argv++args = "--uds-sparse"; /* Only unused VDO data LV could be activated and wiped */ if (!dm_list_empty(&data_lv->segs_using_this_lv)) { @@ -353,7 +318,7 @@ if ((c = strchr(buf, '\n'))) *c = 0; /* cut last '\n' away */ if (buf0) { - if (reformating) + if (reformatting) log_verbose(" %s", buf); /* Print vdo_format messages */ else log_print_unless_silent(" %s", buf); /* Print vdo_format messages */ @@ -432,14 +397,14 @@ return NULL; } } else { - log_verbose("Skiping VDO formatting %s.", display_lvname(data_lv)); + log_verbose("Skipping VDO formatting %s.", display_lvname(data_lv)); /* TODO: parse existing VDO data and retrieve vdo_logical_size */ if (!*virtual_extents) vdo_logical_size = data_lv->size; } if (!deactivate_lv(data_lv->vg->cmd, data_lv)) { - log_error("Cannot deactivate formated VDO pool volume %s.", + log_error("Cannot deactivate formatted VDO pool volume %s.", display_lvname(data_lv)); return NULL; } @@ -516,8 +481,6 @@ find_config_tree_int64(cmd, allocation_vdo_block_map_cache_size_mb_CFG, profile); vtp->block_map_era_length = find_config_tree_int(cmd, allocation_vdo_block_map_era_length_CFG, profile); - vtp->check_point_frequency = - find_config_tree_int(cmd, allocation_vdo_check_point_frequency_CFG, profile); vtp->use_sparse_index = find_config_tree_int(cmd, allocation_vdo_use_sparse_index_CFG, profile); vtp->index_memory_size_mb = @@ -603,7 +566,7 @@ if (!(e = strchr(line, ':'))) break; - if ((++e - line) > sizeof(namebuf)) + if ((unsigned)(++e - line) > sizeof(namebuf)) continue; // something too long (void)dm_strncpy((char*)findme.name, line, e - line);
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/misc/lvm-exec.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/misc/lvm-exec.c
Changed
@@ -217,3 +217,34 @@ return (status == 0) ? 1 : 0; } + +int prepare_exec_args(struct cmd_context *cmd, + const char *argv, int *argc, int options_id) +{ + const struct dm_config_value *cv; + const struct dm_config_node *cn; + + if (!(cn = find_config_tree_array(cmd, options_id, NULL))) { + log_error(INTERNAL_ERROR "Unable to find configuration for %s options.", + argv0); + return 0; + } + + for (cv = cn->v; cv; cv = cv->next) { + if (*argc >= DEFAULT_MAX_EXEC_ARGS) { + log_error("Too many options for %s command.", argv0); + return 0; + } + + if (cv->type != DM_CFG_STRING) { + log_error("Invalid string in config file: " + "global/%s_options.", argv0); + return 0; + } + + if (cv->v.str0) + argv++(*argc) = cv->v.str; + } + + return 1; +}
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/misc/lvm-exec.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/misc/lvm-exec.h
Changed
@@ -67,4 +67,8 @@ int pipe_close(struct pipe_data *pdata); +/* Prepare argv options list */ +int prepare_exec_args(struct cmd_context *cmd, + const char *argv, int *argc, int options_id); + #endif
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/misc/lvm-signal.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/misc/lvm-signal.c
Changed
@@ -69,7 +69,7 @@ void sigint_allow(void) { - int i, mask = 0; + unsigned i, mask = 0; struct sigaction handler; sigset_t sigs; @@ -110,7 +110,7 @@ void sigint_restore(void) { - int i, mask = 0; + unsigned i, mask = 0; sigset_t sigs; if (memlock_count_daemon())
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/mm/memlock.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/mm/memlock.c
Changed
@@ -111,6 +111,7 @@ "/libcap.so.", /* not using during mlock (systemd) */ "/libdl-", /* not using dlopen,dlsym during mlock */ "/libdw-", /* not using during mlock (udev) */ + "/libedit.so.", /* not using editline during mlock */ "/libelf-", /* not using during mlock (udev) */ "/libgcrypt.so.", /* not using during mlock (systemd) */ "/libgpg-error.so.", /* not using gpg-error during mlock (systemd) */ @@ -121,7 +122,6 @@ "/libpcre.so.", /* not using pcre during mlock (selinux) */ "/libpcre2-", /* not using pcre during mlock (selinux) */ "/libreadline.so.", /* not using readline during mlock */ - "/libedit.so.", /* not using editline during mlock */ "/libresolv-", /* not using during mlock (udev) */ "/libselinux.so.", /* not using selinux during mlock */ "/libsepol.so.", /* not using sepol during mlock */ @@ -130,6 +130,7 @@ "/libudev.so.", /* not using udev during mlock */ "/libuuid.so.", /* not using uuid during mlock (blkid) */ "/libz.so.", /* not using during mlock (udev) */ + "/libzstd.so.", /* not using zstd during mlock (systemd) */ "/etc/selinux", /* not using selinux during mlock */ /* "/libdevmapper-event.so" */ };
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/report/columns.h -> _service:tar_scm:LVM2.2.03.22.tgz/lib/report/columns.h
Changed
@@ -92,8 +92,8 @@ FIELD(LVS, lv, STR, "Move UUID", lvid, 38, movepvuuid, move_pv_uuid, "For pvmove, the UUID of Source PV of temporary LV created by pvmove.", 0) FIELD(LVS, lv, STR, "Convert", lvid, 0, convertlv, convert_lv, "For lvconvert, Name of temporary LV created by lvconvert.", 0) FIELD(LVS, lv, STR, "Convert UUID", lvid, 38, convertlvuuid, convert_lv_uuid, "For lvconvert, UUID of temporary LV created by lvconvert.", 0) -FIELD(LVS, lv, STR, "Log", lvid, 0, loglv, mirror_log, "For mirrors, the LV holding the synchronisation log.", 0) -FIELD(LVS, lv, STR, "Log UUID", lvid, 38, loglvuuid, mirror_log_uuid, "For mirrors, the UUID of the LV holding the synchronisation log.", 0) +FIELD(LVS, lv, STR, "Log", lvid, 0, loglv, mirror_log, "For mirrors, the LV holding the synchronization log.", 0) +FIELD(LVS, lv, STR, "Log UUID", lvid, 38, loglvuuid, mirror_log_uuid, "For mirrors, the UUID of the LV holding the synchronization log.", 0) FIELD(LVS, lv, STR, "Data", lvid, 0, datalv, data_lv, "For cache/thin/vdo pools, the LV holding the associated data.", 0) FIELD(LVS, lv, STR, "Data UUID", lvid, 38, datalvuuid, data_lv_uuid, "For cache/thin/vdo pools, the UUID of the LV holding the associated data.", 0) FIELD(LVS, lv, STR, "Meta", lvid, 0, metadatalv, metadata_lv, "For cache/thin pools, the LV holding the associated metadata.", 0) @@ -179,8 +179,8 @@ FIELD(LABEL, label, STR, "PV UUID", type, 38, pvuuid, pv_uuid, "Unique identifier.", 0) FIELD(LABEL, label, SIZ, "DevSize", dev, 0, devsize, dev_size, "Size of underlying device in current units.", 0) FIELD(LABEL, label, STR, "PV", dev, 10, dev_name, pv_name, "Name.", 0) -FIELD(LABEL, label, STR, "Maj", dev, 0, devmajor, pv_major, "Device major number.", 0) -FIELD(LABEL, label, STR, "Min", dev, 0, devminor, pv_minor, "Device minor number.", 0) +FIELD(LABEL, label, SNUM, "Maj", dev, 0, devmajor, pv_major, "Device major number.", 0) +FIELD(LABEL, label, SNUM, "Min", dev, 0, devminor, pv_minor, "Device minor number.", 0) FIELD(LABEL, label, SIZ, "PMdaFree", type, 9, pvmdafree, pv_mda_free, "Free metadata area space on this device in current units.", 0) FIELD(LABEL, label, SIZ, "PMdaSize", type, 9, pvmdasize, pv_mda_size, "Size of smallest metadata area on this device in current units.", 0) FIELD(LABEL, label, NUM, "PExtVsn", type, 0, pvextvsn, pv_ext_vsn, "PV header extension version.", 0)
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/report/report.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/report/report.c
Changed
@@ -2036,7 +2036,7 @@ struct lv_segment *seg; void *orig_p = glv.live; const char *ancestor_str; - char bufNAME_LEN + strlen(HISTORICAL_LV_PREFIX) + 1; + char bufNAME_LEN + sizeof(HISTORICAL_LV_PREFIX); if (glv.is_historical) { if (full && glv.historical->indirect_origin)
View file
_service:tar_scm:LVM2.2.03.21.tgz/lib/vdo/vdo.c -> _service:tar_scm:LVM2.2.03.22.tgz/lib/vdo/vdo.c
Changed
@@ -173,7 +173,7 @@ display_size(cmd, vtp->minimum_io_size)); log_print(" Block map cache sz\t%s", display_size(cmd, vtp->block_map_cache_size_mb * UINT64_C(2 * 1024))); - log_print(" Block map era length\t%u", vtp->block_map_era_length); + log_print(" Block map era length %u", vtp->block_map_era_length); _print_yes_no("Sparse index", vtp->use_sparse_index); @@ -190,7 +190,7 @@ log_print(" # Hash zone threads\t%u", (unsigned) vtp->hash_zone_threads); log_print(" # Logical threads\t%u", (unsigned) vtp->logical_threads); log_print(" # Physical threads\t%u", (unsigned) vtp->physical_threads); - log_print(" Max discard\t%u", (unsigned) vtp->max_discard); + log_print(" Max discard\t\t%u", (unsigned) vtp->max_discard); log_print(" Write policy\t%s", get_vdo_write_policy_name(vtp->write_policy)); }
View file
_service:tar_scm:LVM2.2.03.21.tgz/libdm/dm-tools/dmsetup.c -> _service:tar_scm:LVM2.2.03.22.tgz/libdm/dm-tools/dmsetup.c
Changed
@@ -899,6 +899,7 @@ goto_out; if (_selection_cmd && selected) { device_name = (char*) dm_task_get_name(dmt); + /* coverityoverrun-buffer-val _setgeometry never called from this place */ if (!_selection_cmd->fn(_selection_cmd, NULL, 1, &device_name, NULL, 1)) goto_out; } @@ -1778,7 +1779,7 @@ * has not done its job correctly, e.g. the nodes were not created. * If using udev transactions by specifying existing cookie value, * we need to disable node creation by libdevmapper completely, - * disabling any fallback actions, since any synchronisation happens + * disabling any fallback actions, since any synchronization happens * at the end of the transaction only. We need to do this to prevent * races between udev and libdevmapper but only in case udev "dev path" * is the same as "dev path" used by libdevmapper.
View file
_service:tar_scm:LVM2.2.03.21.tgz/libdm/ioctl/libdm-iface.c -> _service:tar_scm:LVM2.2.03.22.tgz/libdm/ioctl/libdm-iface.c
Changed
@@ -1904,7 +1904,7 @@ /* * Prevent udev vs. libdevmapper race when processing nodes * and symlinks. This can happen when the udev rules are - * installed and udev synchronisation code is enabled in + * installed and udev synchronization code is enabled in * libdevmapper but the software using libdevmapper does not * make use of it (by not calling dm_task_set_cookie before). * We need to instruct the udev rules not to be applied at @@ -1914,7 +1914,7 @@ if (!dmt->cookie_set && dm_udev_get_sync_support()) { log_debug_activation("Cookie value is not set while trying to call %s " "ioctl. Please, consider using libdevmapper's udev " - "synchronisation interface or disable it explicitly " + "synchronization interface or disable it explicitly " "by calling dm_udev_set_sync_support(0).", dmt->type == DM_DEVICE_RESUME ? "DM_DEVICE_RESUME" : dmt->type == DM_DEVICE_REMOVE ? "DM_DEVICE_REMOVE" :
View file
_service:tar_scm:LVM2.2.03.21.tgz/libdm/libdevmapper.h -> _service:tar_scm:LVM2.2.03.22.tgz/libdm/libdevmapper.h
Changed
@@ -3740,7 +3740,7 @@ int dm_cookie_supported(void); /* - * Udev synchronisation functions. + * Udev synchronization functions. */ void dm_udev_set_sync_support(int sync_with_udev); int dm_udev_get_sync_support(void);
View file
_service:tar_scm:LVM2.2.03.21.tgz/libdm/libdm-common.c -> _service:tar_scm:LVM2.2.03.22.tgz/libdm/libdm-common.c
Changed
@@ -2310,7 +2310,7 @@ if (maxid < 0) { log_warn("Kernel not configured for semaphores (System V IPC). " - "Not using udev synchronisation code."); + "Not using udev synchronization code."); return 0; } @@ -2333,7 +2333,7 @@ if (!(r = udev_queue_get_udev_is_active(udev_queue))) log_debug_activation("Udev is not running. " - "Not using udev synchronisation code."); + "Not using udev synchronization code."); udev_queue_unref(udev_queue); udev_unref(udev);
View file
_service:tar_scm:LVM2.2.03.21.tgz/libdm/libdm-file.c -> _service:tar_scm:LVM2.2.03.22.tgz/libdm/libdm-file.c
Changed
@@ -222,7 +222,6 @@ } /* coverityleaked_handle intentional leak of fd handle here */ - return 1; fail_close_unlink:
View file
_service:tar_scm:LVM2.2.03.21.tgz/make.tmpl.in -> _service:tar_scm:LVM2.2.03.22.tgz/make.tmpl.in
Changed
@@ -203,7 +203,7 @@ # Handle installation of files ifeq ("@WRITE_INSTALL@", "yes") # leaving defaults -M_INSTALL_SCRIPT = +M_INSTALL_SCRIPT = -m 755 M_INSTALL_DATA = -m 644 else M_INSTALL_PROGRAM = -m 555
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/dmfilemapd.8_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/dmfilemapd.8_main
Changed
@@ -138,7 +138,7 @@ . .SH LIMITATIONS . -The daemon attempts to maintain good synchronisation between the file +The daemon attempts to maintain good synchronization between the file extents and the regions contained in the group, however, since the daemon can only react to new allocations once they have been written, there are inevitably some IO events that cannot be counted when a
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/dmsetup.8_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/dmsetup.8_main
Changed
@@ -533,7 +533,7 @@ . .TP .B --noudevsync -Do not synchronise with udev when creating, renaming or removing devices. +Do not synchronize with udev when creating, renaming or removing devices. . .TP .BR -o | --options " " \fIoptions @@ -570,7 +570,7 @@ . .TP .B --udevcookie \fIcookie -Use cookie for udev synchronisation. +Use cookie for udev synchronization. Note: Same cookie should be used for same type of operations i.e. creation of multiple different devices. It's not advised to combine different operations on the single device. @@ -589,7 +589,7 @@ . .TP .B --verifyudev -If udev synchronisation is enabled, verify that udev operations get performed +If udev synchronization is enabled, verify that udev operations get performed correctly and try to fix up the device nodes afterwards if not. . .TP
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/dmstats.8_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/dmstats.8_main
Changed
@@ -851,7 +851,7 @@ . .SS Limitations . -The daemon attempts to maintain good synchronisation between the file +The daemon attempts to maintain good synchronization between the file extents and the regions contained in the group, however, since it can only react to new allocations once they have been written, there are inevitably some IO events that cannot be counted when a file is
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvchange.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvchange.8_pregen
Changed
@@ -764,7 +764,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvconvert.8_end -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvconvert.8_end
Changed
@@ -84,6 +84,11 @@ .br .B lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lvol1 /dev/sdgh1 .P +Convert a thick LV into a thin-pool data volume and continue using this LV +through thinLV and for the conversion set the pool metadata size to 1GiB. +.br +.B lvconvert --type thin --poolmetadatasize 1G vg/lvol1 +.P Convert an LV into a thin LV in the specified thin pool. The existing LV is used as an external read-only origin for the new thin LV. .br
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvconvert.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvconvert.8_pregen
Changed
@@ -121,6 +121,8 @@ .br \fB--replace\fP \fIPV\fP .br + \fB-k\fP|\fB--setactivationskip\fP \fBy\fP|\fBn\fP +.br \fB-s\fP|\fB--snapshot\fP .br \fB--splitcache\fP @@ -502,6 +504,39 @@ .P \(em .P +Convert LV to a thin LV, using LV as thin-pool data volume. +.br +.P +\fBlvconvert\fP \fB--type\fP \fBthin\fP \fILV1\fP +.br +.RS 4 +.ad l + \fB-T\fP|\fB--thin\fP +.br + \fB-r\fP|\fB--readahead\fP \fBauto\fP|\fBnone\fP|\fINumber\fP +.br + \fB-c\fP|\fB--chunksize\fP \fISize\fPk|UNIT +.br + \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP +.br + \fB--poolmetadata\fP \fILV\fP +.br + \fB--poolmetadatasize\fP \fISize\fPm|UNIT +.br + \fB--poolmetadataspare\fP \fBy\fP|\fBn\fP +.br + \fB--metadataprofile\fP \fIString\fP +.br + COMMON_OPTIONS +.ad b +.RE +.P +.RS 4 +LV1 types: linear striped cache vdo raid error zero writecache +.RE +.P +\(em +.P Attach a cache pool to an LV, converts the LV to type cache. .br .P @@ -538,7 +573,7 @@ .RE .P .RS 4 -LV1 types: linear striped thinpool vdo vdopool vdopooldata raid +LV1 types: linear striped thin thinpool vdo vdopool vdopooldata raid error zero .RE .P \(em @@ -718,7 +753,7 @@ .RE .P .RS 4 -LV1 types: linear striped raid +LV1 types: linear striped raid error zero .RE .P \(em @@ -849,6 +884,8 @@ .ad l \fB-i\fP|\fB--interval\fP \fINumber\fP .br + \fB-k\fP|\fB--setactivationskip\fP \fBy\fP|\fBn\fP +.br \fB--usepolicies\fP .br \fB--poolmetadataspare\fP \fBy\fP|\fBn\fP @@ -1315,7 +1352,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates. @@ -1413,6 +1450,16 @@ See \fBlvmraid\fP(7) for more information. . .HP +\fB-k\fP|\fB--setactivationskip\fP \fBy\fP|\fBn\fP +.br +Persistently sets (yes) or clears (no) the "activation skip" flag on an LV. +An LV with this flag set is not activated unless the +--ignoreactivationskip option is used by the activation command. +This flag is set by default on new thin snapshot LVs. +The flag is not applied to deactivation. +The current value of the flag is indicated in the lvs lv_attr bits. +. +.HP \fB-s\fP|\fB--snapshot\fP .br Combine a former COW snapshot LV with a former origin LV to reverse @@ -1729,6 +1776,40 @@ .P \(em .P +Convert LV to a thin LV, using LV as thin-pool data volume. +.br +.P +\fBlvconvert\fP \fB-T\fP|\fB--thin\fP \fILV1\fP +.br +.RS 4 +.ad l + \fB--type thin\fP (implied) +.br +.br + \fB-r\fP|\fB--readahead\fP \fBauto\fP|\fBnone\fP|\fINumber\fP +.br + \fB-c\fP|\fB--chunksize\fP \fISize\fPk|UNIT +.br + \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP +.br + \fB--poolmetadata\fP \fILV\fP +.br + \fB--poolmetadatasize\fP \fISize\fPm|UNIT +.br + \fB--poolmetadataspare\fP \fBy\fP|\fBn\fP +.br + \fB--metadataprofile\fP \fIString\fP +.br + COMMON_OPTIONS +.ad b +.RE +.P +.RS 4 +LV1 types: linear striped cache vdo raid error zero writecache +.RE +.P +\(em +.P Attach a cache pool to an LV. .br .P @@ -1766,7 +1847,7 @@ .RE .P .RS 4 -LV1 types: linear striped thinpool vdo vdopool vdopooldata raid +LV1 types: linear striped thin thinpool vdo vdopool vdopooldata raid error zero .RE .P \(em
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvcreate.8_end -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvcreate.8_end
Changed
@@ -7,19 +7,19 @@ .br .B lvcreate -i 3 -I 8 -L 100m vg00 .P -Create a raid1 LV with two images, and a useable size of 500 MiB. This +Create a raid1 LV with two images, and a usable size of 500 MiB. This operation requires two devices, one for each mirror image. RAID metadata (superblock and bitmap) is also included on the two devices. .br .B lvcreate --type raid1 -m1 -L 500m -n mylv vg00 .P -Create a mirror LV with two images, and a useable size of 500 MiB. +Create a mirror LV with two images, and a usable size of 500 MiB. This operation requires three devices: two for mirror images and one for a disk log. .br .B lvcreate --type mirror -m1 -L 500m -n mylv vg00 .P -Create a mirror LV with 2 images, and a useable size of 500 MiB. +Create a mirror LV with 2 images, and a usable size of 500 MiB. This operation requires 2 devices because the log is in memory. .br .B lvcreate --type mirror -m1 --mirrorlog core -L 500m -n mylv vg00
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvcreate.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvcreate.8_pregen
Changed
@@ -491,6 +491,8 @@ \fB--type thin\fP (implied) .br .br + \fB-T\fP|\fB--thin\fP +.br COMMON_OPTIONS .ad b .RE @@ -1218,7 +1220,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates. @@ -1917,6 +1919,8 @@ .ad l \fB-T\fP|\fB--thin\fP .br + \fB-s\fP|\fB--snapshot\fP +.br COMMON_OPTIONS .ad b .RE @@ -1937,6 +1941,8 @@ \fB--type thin\fP (implied) .br .br + \fB-s\fP|\fB--snapshot\fP +.br COMMON_OPTIONS .ad b .RE
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvextend.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvextend.8_pregen
Changed
@@ -490,7 +490,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvm.8_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvm.8_main
Changed
@@ -518,6 +518,7 @@ .BR lvm (8), .BR lvm.conf (5), .BR lvmconfig (8), +.BR lvmdevices (8), .P .BR pvchange (8), .BR pvck (8), @@ -540,6 +541,7 @@ .BR vgextend (8), .BR vgimport (8), .BR vgimportclone (8), +.BR vgimportdevices (8), .BR vgmerge (8), .BR vgmknodes (8), .BR vgreduce (8), @@ -572,12 +574,14 @@ .BR lvmlockctl (8), .BR cmirrord (8), .BR lvmdbusd (8), +.BR fsadm (8), .P .BR lvmsystemid (7), .BR lvmreport (7), +.BR lvmcache (7), .BR lvmraid (7), .BR lvmthin (7), -.BR lvmcache (7), +.BR lvmvdo (7), .BR lvmautoactivation (7), .P .BR dmsetup (8),
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvm_import_vdo.8_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvm_import_vdo.8_main
Changed
@@ -61,6 +61,20 @@ .BR --dry-run Print verbosely commands without running them. . +.TP +.BR --no-snapshot +With this option conversion tool will not use snapshot (COW storage) for conversion +in your $TMPDIR filesystem and it will directly manipulate with VDO device in-place. +Warning: the snapshot usage makes the whole conversion transactional and +the snapshot can be just simply merged once the whole conversion +has successfully proceeded. In the case of error the snapshot is just removed. +Without the use of snapshot there is higher risk of problems with recoverability in +case some unexpected error occurs. +. +.TP +.BR --vdo-config +Configuration file for VDO manager. Can be used to specify configuration for vdo manager. +. . .SH DIAGNOSTICS . @@ -83,6 +97,15 @@ .B DM_DEV_DIR The device directory name. Defaults to "\fI/dev\fP" and must be an absolute path. +.TP +.B DM_UUID_PREFIX +Specify uuid prefix for snapshot volume used during vdo conversion. +.TP +.B LVM_BINARY +Allow to overide command called from lvm. Defaults to "\fIlvm\fP". +.TP +.B VDO_BINARY +Allow to overide command called from vdo. Defaults to "\fIvdo\fP". . .SH SEE ALSO .
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvmdevices.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvmdevices.8_pregen
Changed
@@ -26,6 +26,8 @@ .br \fB--deldev\fP \fIString\fP .br + \fB--delnotfound\fP +.br \fB--delpvid\fP \fIString\fP .br \fB--deviceidtype\fP \fIString\fP @@ -203,6 +205,8 @@ .br .RS 4 .ad l + \fB--delnotfound\fP +.br COMMON_OPTIONS .ad b .RE @@ -356,6 +360,11 @@ When used with --deviceidtype, --deldev specifies a device id. . .HP +\fB--delnotfound\fP +.br +Remove devices file entries with no matching device. +. +.HP \fB--delpvid\fP \fIString\fP .br Remove a device with the PVID from the devices file.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvmraid.7_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvmraid.7_main
Changed
@@ -839,7 +839,7 @@ RAID LVs with integrity cannot yet be used as sub LVs with other LV types. .P The following are not yet permitted on RAID LVs with integrity: lvreduce, -pvmove, snapshots, splitmirror, raid syncaction commands, raid rebuild. +pvmove, lvconvert --splitmirrors, lvchange --syncaction, lvchange --rebuild. . .SH RAID1 TUNING .
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvmthin.7_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvmthin.7_main
Changed
@@ -207,11 +207,35 @@ thin1s2 vg Vwi---tz-k 1.00t pool0 thin1 thin1s1s1 vg Vwi---tz-k 1.00t pool0 thin1s1 . +.SS \n+step. Create ThinLV with ThinPoolLV +. +Create a new thin LV together with thin pool LV and let lvm2 +to allocate data and metadata volume. +.P +.B lvcreate -T -n ThinLV -V VirtualSize -L PoolSize VG/ThinPoolLV +.P +.I Example +.br +Create a 50MiB thin LV and 10MiB thin pool: +.br +# lvcreate -T -n thin -V 52M -L 12M vg/pool +.P +# lvs -a vg + LV VG Attr LSize Pool Origin Data% Meta% + lvol0_pmspare vg ewi------- 4,00m + pool vg twi-aotz-- 12,00m 0,00 10,94 + pool_tdata vg Twi-ao---- 12,00m + pool_tmeta vg ewi-ao---- 4,00m + thin vg Vwi-a-tz-- 52,00m pool 0,00 +. .SS \n+step. Activate SnapLV . Thin snapshots are created with the persistent "activation skip" flag, indicated by the "k" attribute. Use -K with lvchange or vgchange to activate thin snapshots with the "k" attribute. +User can preset default behavior with +.BR lvm.conf (5) +.BR auto_set_activation_skip . .P .B lvchange -ay -K VG/SnapLV .P @@ -223,6 +247,31 @@ LV VG Attr LSize Pool Origin thin1s1 vg Vwi-a-tz-k 1.00t pool0 thin1 . +.SS \n+step. Convert thick LV to thin LV +. +Convert existing thick LV (linear, stripe,...) to thin LV with move of +existing data to thin pool and using thin LV from such thin pool. +Once the volume is converted, user is using it like ordinary thin-pool. +Note: Conversion cannot be reverted and thin volume cannot be reverted +back to thick LV type. +.P +.B lvconvert --type thin VG/ThickLV +.P +.I Example +.br +Create thick 12MiB LV. +.br +# lvcreate -L 12M -n thick vg +.P +Convert LV to a thin pool with chunk size 256KiB. +.br +# lvconvert --thin --chunksize 256K vg/thick +.P +# lvs -o+chunksize vg + LV VG Attr LSize Pool Origin Data% Meta% Chunk + thick vg Vwi-a-tz-- 12,00m thick_tpool0 100,00 0 + thick_tpool0 vg twi---tz-- 12,00m 100,00 10,94 256,00k +. .SH THIN TOPICS . .B Automatic pool metadata LV @@ -304,7 +353,7 @@ .P .B lvcreate -n ThinDataLV -L LargeSize VG LargePV .br -.B lvcreate -n ThinMetaLV -L SmallSize VG SmallPV +.B lvcreate -n ThinMetaLV -L SmallSize VG FastPV .br .B lvconvert --type thin-pool --poolmetadata VG/ThinMetaLV VG/ThinDataLV .P @@ -376,21 +425,27 @@ Checking and repairing thin pool metadata is analogous to running fsck/repair on a file system. .P -When a thin pool LV is activated, lvm runs the thin_check command -to check the correctness of the metadata on the pool metadata LV. +When a thin pool LV is activated, lvm runs the +.BR thin_check (8) +command to check the correctness of the metadata on the pool metadata LV. .P .BR lvm.conf (5) .B thin_check_executable .br -can be set to an empty string ("") to disable the thin_check step. -This is not recommended. +can be set to an empty string ("") to disable the +.BR thin_check (8) +step. This is not recommended. .P .BR lvm.conf (5) .B thin_check_options .br -controls the command options used for the thin_check command. +controls the command options used for the +.BR thin_check (8) +command. .P -If the thin_check command finds a problem with the metadata, +If the +.BR thin_check (8) +command finds a problem with the metadata, the thin pool LV is not activated, and the thin pool metadata needs to be repaired. .P @@ -409,7 +464,9 @@ .IP \nstep 3 Creates a new, repaired copy of the metadata. .br -lvconvert runs the thin_repair command to read damaged metadata +lvconvert runs the +.BR thin_repair (8) +command to read damaged metadata from the existing pool metadata LV, and writes a new repaired copy to the VG's pmspare LV. .IP \n+step 3 @@ -437,8 +494,9 @@ ThinPoolLV_metaN volume can be used by your support for more advanced recovery methods. .P -If metadata is manually restored with thin_repair directly, -the pool metadata LV can be manually swapped with another LV +If metadata is manually restored with +.BR thin_repair (8) +directly, the pool metadata LV can be manually swapped with another LV containing new metadata: .P .B lvconvert --thinpool VG/ThinPoolLV --poolmetadata VG/NewThinMetaLV @@ -1069,7 +1127,8 @@ .BR allocation / thin_pool_crop_metadata gives control over cropping to 15.81GiB to stay backward compatible with older versions of lvm2. With enabled cropping there can be observed some problems when -using volumes above this size with thin tools (i.e. thin_repair). +using volumes above this size with thin tools (i.e. +.BR thin_repair (8)). Cropping should be enabled only when compatibility is required. . .SS Create a thin snapshot of an external, read only LV @@ -1275,12 +1334,12 @@ changed using: .P # xfs_admin -U generate /dev/VG/SnapLV -.P +.br # mount /dev/VG/SnapLV /mnt .P Once the UUID has been changed, the mount command will no longer require the nouuid option. -.P +.br If the snapshot LV is readonly, the log recovery and uuid check need to be skipped while mounting readonly: .P @@ -1300,6 +1359,7 @@ .BR lvremove (8), .BR lvs (8), .P +.BR thin_check (8), .BR thin_dump (8), .BR thin_repair (8), .BR thin_restore (8)
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvmvdo.7_main -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvmvdo.7_main
Changed
@@ -165,7 +165,6 @@ vdo_minimum_io_size=4096 vdo_block_map_cache_size_mb=128 vdo_block_map_period=16380 -vdo_check_point_frequency=0 vdo_use_sparse_index=0 vdo_index_memory_size_mb=256 vdo_slab_size_mb=2048 @@ -301,7 +300,20 @@ .SS \nstep. Stacking VDO . You can convert or stack a VDOPooLV with these currently supported -volume types: linear, stripe, raid, and cache with cachepool. +volume types: linear, stripe, raid and cache with cachepool. +. +.SS \nstep. Using multiple volumes using same VDOPoolLV +. +You can convert existing VDO LV into a thin volume. After this conversion +you can create a thin snapshot or you can add more thin volumes +with thin-pool named after orignal LV name LV_tpool0. +.P +.I Example +.nf +# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool +# lvconvert --type thin vg/vdo1 +# lvcreate -V20 vg/vdo1_tpool0 +.fi . .SS \n+step. VDOPoolLV on top of raid .
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvreduce.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvreduce.8_pregen
Changed
@@ -259,7 +259,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvremove.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvremove.8_pregen
Changed
@@ -211,7 +211,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvrename.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvrename.8_pregen
Changed
@@ -182,7 +182,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/lvresize.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/lvresize.8_pregen
Changed
@@ -439,7 +439,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/pvmove.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/pvmove.8_pregen
Changed
@@ -278,7 +278,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/pvscan.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/pvscan.8_pregen
Changed
@@ -476,7 +476,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/see_also.end -> _service:tar_scm:LVM2.2.03.22.tgz/man/see_also.end
Changed
@@ -66,6 +66,9 @@ .P .BR lvmsystemid (7), .BR lvmreport (7), +.BR lvmcache (7), .BR lvmraid (7), .BR lvmthin (7), -.BR lvmcache (7) +.BR lvmvdo (7), +.BR lvmautoactivation (7) +
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/vgchange.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/vgchange.8_pregen
Changed
@@ -713,7 +713,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/man/vgremove.8_pregen -> _service:tar_scm:LVM2.2.03.22.tgz/man/vgremove.8_pregen
Changed
@@ -177,7 +177,7 @@ .HP \fB--noudevsync\fP .br -Disables udev synchronisation. The process will not wait for notification +Disables udev synchronization. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates.
View file
_service:tar_scm:LVM2.2.03.21.tgz/scripts/lvm_import_vdo.sh -> _service:tar_scm:LVM2.2.03.22.tgz/scripts/lvm_import_vdo.sh
Changed
@@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (C) 2021 Red Hat, Inc. All rights reserved. +# Copyright (C) 2021-2023 Red Hat, Inc. All rights reserved. # # This file is part of LVM2. # @@ -19,7 +19,7 @@ # Needed utilities: # lvm, dmsetup, # vdo, -# grep, awk, sed, blockdev, readlink, stat, mkdir +# grep, awk, sed, blockdev, readlink, stat, mkdir, truncate # # Conversion is using 'vdo convert' support from VDO manager to move # existing VDO header by 2M which makes space to place in PV header @@ -29,6 +29,9 @@ set -euE -o pipefail TOOL=lvm_import_vdo +IMPORT_NAME="VDO_${TOOL}_${RANDOM}$$" +test ${#IMPORT_NAME} -lt 100 || error "Random name \"$IMPORT_NAME\" is too long!" +TEMPDIR="${TMPDIR:-/tmp}/$IMPORT_NAME" _SAVEPATH=$PATH PATH="/sbin:/usr/sbin:/bin:/usr/sbin:$PATH" @@ -36,26 +39,40 @@ # user may override lvm location by setting LVM_BINARY LVM=${LVM_BINARY:-lvm} VDO=${VDO_BINARY:-vdo} -VDOCONF=${VDOCONF:-} BLOCKDEV="blockdev" +LOSETUP="losetup" READLINK="readlink" READLINK_E="-e" STAT="stat" MKDIR="mkdir" +TRUNCATE="truncate" DMSETUP="dmsetup" -TEMPDIR="${TMPDIR:-/tmp}/${TOOL}_${RANDOM}$$" DM_DEV_DIR="${DM_DEV_DIR:-/dev}" - -DEVICENAME="" +DM_UUID_PREFIX="${DM_UUID_PREFIX:-}" +DM_VG_NAME= +DM_LV_NAME= +VDO_CONFIG=${VDO_CONFIG:-} # can be overridden with --vdo-config +VDOCONF= +test -n "$VDO_CONFIG" && VDOCONF="-f $VDO_CONFIG" + +DEVICE= +VGNAME= +LVNAME= DEVMAJOR=0 DEVMINOR=0 PROMPTING="" +USE_VDO_DM_SNAPSHOT=1 +VDO_DM_SNAPSHOT_NAME= +VDO_DM_SNAPSHOT_DEVICE= +VDO_SNAPSHOT_LOOP= DRY=0 VERB="" FORCE="" YES="" +ABORT_AFTER_VDO_CONVERT=0 +VDO_ALLOCATION_PARAMS= # default name for converted VG and its VDO LV DEFAULT_NAME="vdovg/vdolvol" @@ -74,6 +91,9 @@ echo " -v | --verbose Be verbose" echo " -y | --yes Answer \"yes\" at any prompts" echo " --dry-run Print verbosely commands without running them" + echo " --no-snapshot Do not use snapshot for converted VDO device" + echo " --uuid-prefix Prefix for DM snapshot uuid" + echo " --vdo-config Configuration file for VDO manager" exit } @@ -102,12 +122,79 @@ cleanup() { trap '' 2 + test -n "$VDO_DM_SNAPSHOT_NAME" && { "$DMSETUP" remove "$VDO_DM_SNAPSHOT_NAME" || true ; } + test -n "$VDO_SNAPSHOT_LOOP" && { "$LOSETUP" -d "$VDO_SNAPSHOT_LOOP" || true ; } + test -z "$PROMPTING" || echo "No" - rm -rf "$TEMPDIR" + rm -rf "$TEMPDIR" || true # error exit status for break exit "${1:-1}" } +# Create snapshot target like for persistent snapshot with 16KiB chunksize +snapshot_target_line_() { + echo "0 $("$BLOCKDEV" --getsize "$1") snapshot${3:-} $1 $2 P 32" +} + +snapshot_create_() { + VDO_DM_SNAPSHOT_NAME="${IMPORT_NAME}_snap" + local file="$TEMPDIR/$VDO_DM_SNAPSHOT_NAME" + + # TODO: maybe use ramdisk via 'brd' device ?) + "$TRUNCATE" -s 20M "$file" + VDO_SNAPSHOT_LOOP=$("$LOSETUP" -f --show "$file") + "$DMSETUP" create "$VDO_DM_SNAPSHOT_NAME" -u "${DM_UUID_PREFIX}-${VDO_DM_SNAPSHOT_NAME}-priv" --table "$(snapshot_target_line_ "$1" "$VDO_SNAPSHOT_LOOP")" + VDO_DM_SNAPSHOT_DEVICE="$DM_DEV_DIR/mapper/$VDO_DM_SNAPSHOT_NAME" + verbose "Snapshot of VDO device $1 created: $VDO_DM_SNAPSHOT_DEVICE." +} + +snapshot_merge_() { + local status + local initial_status + + initial_status=( $("$DMSETUP" status "$VDO_DM_SNAPSHOT_NAME") ) + "$DMSETUP" reload "$VDO_DM_SNAPSHOT_NAME" --table "$(snapshot_target_line_ "$1" "$VDO_SNAPSHOT_LOOP" -merge)" + "$DMSETUP" suspend "$VDO_DM_SNAPSHOT_NAME" || { + error "ABORTING: Failed to initialize snapshot merge! Origin volume is unchanged." + } + + verbose "Merging converted VDO volume..." + # Running merging + "$DMSETUP" resume "$VDO_DM_SNAPSHOT_NAME" + + #du -h "$TEMPDIR/$VDO_DM_SNAPSHOT_NAME" + + # Loop for a while, till the snapshot is merged. + # Should be nearly instantaneous. + # FIXME: Recovery when something prevents merging is hard + for i in $(seq 1 20) ; do + status=( $("$DMSETUP" status "$VDO_DM_SNAPSHOT_NAME") ) + # Check if merging is finished + test "${status3%/*}" = "${status4}" && break + # Wait a bit and retry + sleep .2 + done + test "${status3%/*}" = "${status4}" || { + # FIXME: Now what shall we do ??? Help.... + # Keep snapshot in table for possible analysis... + VDO_DM_SNAPSHOT_NAME= + VDO_SNAPSHOT_LOOP= + echo "Initial snapshot status ${initial_status*}" + echo "Failing merge snapshot status ${status*}" + error "ABORTING: Snapshot failed to merge! (Administrator required...)" + } + sync + "$DMSETUP" remove "$VDO_DM_SNAPSHOT_NAME" || { + sleep 1 # sleep and retry once more + "$DMSETUP" remove "$VDO_DM_SNAPSHOT_NAME" || { + error "ABORTING: Cannot remove snapshot $VDO_DM_SNAPSHOT_NAME! (check volume autoactivation...)" + } + } + VDO_DM_SNAPSHOT_NAME= + "$LOSETUP" -d "$VDO_SNAPSHOT_LOOP" + VDO_SNAPSHOT_LOOP= +} + get_enabled_value_() { case "$1" in enabled) echo "1" ;; @@ -144,7 +231,7 @@ } # detect LV on the given device -# dereference device name if it is symbolic link +# deference device name if it is symbolic link detect_lv_() { local DEVICE=$1 local SYSVOLUME @@ -221,46 +308,198 @@ ) < "$yaml_file" } -# convert existing VDO volume into lvm2 volume +# +# Convert VDO volume on LV to VDOPool within this VG +# +# This conversion requires the size of VDO virtual volume has to be expressed in the VG's extent size. +# Currently this enforces a user to reduce the VG extent size to the smaller size (up to 4KiB). +# +# TODO: We may eventually relax this condition just like we are doing rounding for convert_non_lv_() +# Let's if there would be any singly user requiring this feature. +# It may allow to better use larger VDO volume size (in TiB ranges). +# +convert_lv_() { + local vdo_logicalSize=$1 + local extent_size + local pvfree + + pvfree=$("$LVM" lvs -o size --units b --nosuffix --noheadings "$DM_VG_NAME/$DM_LV_NAME") + pvfree=$(( pvfree / 1024 )) # to KiB + # select largest possible extent size that can exactly express both sizes + extent_size=$(get_largest_extent_size_ "$pvfree" "$vdo_logicalSize") + + # validate existing VG extent_size can express virtual VDO size + vg_extent_size=$("$LVM" vgs -o vg_extent_size --units b --nosuffix --noheadings "$VGNAME") + vg_extent_size=$(( vg_extent_size / 1024 ))
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/Makefile.in -> _service:tar_scm:LVM2.2.03.22.tgz/test/Makefile.in
Changed
@@ -53,22 +53,32 @@ RUN := $(shell find -L $(srcdir) -regextype posix-egrep \( -path \*/shell/\*.sh -or -path \*/api/\*.sh -or -path \*/unit/\*.sh \) -and -regex "$(srcdir)/.*($(subst $(comma),|,$(T))).*" -and -not -regex "$(srcdir)/.*($(subst $(comma),|,$(S))).*" | $(SORT)) RUN_BASE = $(subst $(srcdir)/,,$(RUN)) +ifeq ("@BUILD_DMEVENTD@", "yes") +DMEVENTD_TOOLS :=\ + daemons/dmeventd/dmeventd +endif + ifeq ("@BUILD_LVMPOLLD@", "yes") LVMPOLLD_RUN_BASE = $(RUN_BASE) LVMPOLLD_NDEV_FLAVOUR = ,ndev-lvmpolld LVMPOLLD_UDEV_FLAVOUR = ,udev-lvmpolld +LVMPOLLD_TOOLS :=\ + daemons/lvmpolld/lvmpolld endif ifeq ("@BUILD_LVMLOCKD@", "yes") LVMLOCKD_RUN_BASE = $(RUN_BASE) LVMLOCKD_UDEV_FLAVOUR = ,udev-lvmlockd-test +LVMLOCKD_TOOLS :=\ + daemons/lvmlockd/lvmlockd\ + daemons/lvmlockd/lvmlockctl endif # Shell quote; SHELL_PATH_SQ := $(subst ','\'',$(SHELL_PATH)) ifeq ("@UDEV_SYNC@", "yes") -dm_udev_synchronisation = 1 +dm_udev_synchronization = 1 endif all: .tests-stamp @@ -204,9 +214,10 @@ LIB_MKE2FS_CONF := mke2fs.conf -LVM_TOOLS :=\ - daemons/dmeventd/dmeventd\ - daemons/lvmpolld/lvmpolld\ +LVM_TOOLS := \ + $(LVMPOLLD_TOOLS)\ + $(LVMLOCKD_TOOLS)\ + $(DMEVENTD_TOOLS)\ libdm/dm-tools/dmsetup LVM_PROFILES := $(addsuffix .profile,\ @@ -234,7 +245,7 @@ $(Q)- $(INSTALL_PROGRAM) dbus/*.py $(DATADIR)/dbus/ $(Q) $(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths $(Q) cd lib &&\ - $(INSTALL_DATA) $(LIB_DATA) $(DATADIR)/lib + $(INSTALL_DATA) $(LIB_DATA) $(LIB_CONF) $(DATADIR)/lib $(Q) cd lib &&\ $(INSTALL_SCRIPT) $(LIB_SHARED) $(DATADIR)/lib $(Q) cd lib &&\ @@ -287,7 +298,7 @@ lib/paths-common: $(srcdir)/Makefile.in Makefile .lib-dir-stamp $(SHOW) " PATHS $@" - $(Q) echo 'DM_UDEV_SYNCHRONISATION=$(dm_udev_synchronisation)' >> $@-t + $(Q) echo 'DM_UDEV_SYNCHRONIZATION=$(dm_udev_synchronization)' >> $@-t $(Q) echo 'LVMPOLLD_PIDFILE="@LVMPOLLD_PIDFILE@"' >> $@-t $(Q) echo 'DMEVENTD_PIDFILE="@DMEVENTD_PIDFILE@"' >> $@-t $(Q) echo 'LVM_TEST_THIN_CHECK_CMD=$${LVM_TEST_THIN_CHECK_CMD-@THIN_CHECK_CMD@}' >> $@-t @@ -298,7 +309,7 @@ $(Q) echo 'LVM_TEST_CACHE_DUMP_CMD=$${LVM_TEST_CACHE_DUMP_CMD-@CACHE_DUMP_CMD@}' >> $@-t $(Q) echo 'LVM_TEST_CACHE_REPAIR_CMD=$${LVM_TEST_CACHE_REPAIR_CMD-@CACHE_REPAIR_CMD@}' >> $@-t $(Q) echo 'LVM_TEST_CACHE_RESTORE_CMD=$${LVM_TEST_CACHE_RESTORE_CMD-@CACHE_RESTORE_CMD@}' >> $@-t - $(Q) echo 'export DM_UDEV_SYNCHRONISATION THIN RAID CACHE\' >> $@-t + $(Q) echo 'export DM_UDEV_SYNCHRONIZATION THIN RAID CACHE\' >> $@-t $(Q) echo ' LVM_TEST_THIN_CHECK_CMD LVM_TEST_THIN_DUMP_CMD LVM_TEST_THIN_REPAIR_CMD LVM_TEST_THIN_RESTORE_CMD\' >> $@-t $(Q) echo ' LVM_TEST_CACHE_CHECK_CMD LVM_TEST_CACHE_DUMP_CMD LVM_TEST_CACHE_REPAIR_CMD LVM_TEST_CACHE_RESTORE_CMD' >> $@-t $(Q) mv $@-t $@
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/lib/aux.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/lib/aux.sh
Changed
@@ -32,8 +32,8 @@ } create_corosync_conf() { - COROSYNC_CONF="/etc/corosync/corosync.conf" - COROSYNC_NODE=$(hostname) + local COROSYNC_CONF="/etc/corosync/corosync.conf" + local COROSYNC_NODE=$(hostname) if test -a "$COROSYNC_CONF"; then if ! grep "created by lvm test suite" "$COROSYNC_CONF"; then @@ -47,8 +47,9 @@ echo "created new $COROSYNC_CONF" } -DLM_CONF="/etc/dlm/dlm.conf" create_dlm_conf() { + local DLM_CONF="/etc/dlm/dlm.conf" + if test -a "$DLM_CONF"; then if ! grep "created by lvm test suite" "$DLM_CONF"; then rm "$DLM_CONF" @@ -56,21 +57,14 @@ mv "$DLM_CONF" "$DLM_CONF.prelvmtest" fi fi - + mkdir -p "$(dirname "$DLM_CONF")" cp lib/test-dlm-conf "$DLM_CONF" echo "created new $DLM_CONF" } prepare_dlm() { - if pgrep dlm_controld ; then - echo "Cannot run while existing dlm_controld process exists." - exit 1 - fi - - if pgrep corosync; then - echo "Cannot run while existing corosync process exists." - exit 1 - fi + pgrep dlm_controld && skip "Cannot run while existing dlm_controld process exists." + pgrep corosync && skip "Cannot run while existing corosync process exists." create_corosync_conf create_dlm_conf @@ -90,8 +84,9 @@ fi } -SANLOCK_CONF="/etc/sanlock/sanlock.conf" create_sanlock_conf() { + local SANLOCK_CONF="/etc/sanlock/sanlock.conf" + if test -a "$SANLOCK_CONF"; then if ! grep "created by lvm test suite" "$SANLOCK_CONF"; then rm "$SANLOCK_CONF" @@ -100,15 +95,13 @@ fi fi + mkdir -p "$(dirname "$SANLOCK_CONF")" cp lib/test-sanlock-conf "$SANLOCK_CONF" echo "created new $SANLOCK_CONF" } prepare_sanlock() { - if pgrep sanlock ; then - echo "Cannot run while existing sanlock process exists" - exit 1 - fi + pgrep sanlock && skip "Cannot run while existing sanlock process exists" create_sanlock_conf @@ -120,10 +113,7 @@ } prepare_idm() { - if pgrep seagate_ilm; then - echo "Cannot run while existing seagate_ilm process exists" - exit 1 - fi + pgrep seagate_ilm && skip "Cannot run while existing seagate_ilm process exists" seagate_ilm -D 0 -l 0 -L 7 -E 7 -S 7 @@ -134,10 +124,7 @@ } prepare_lvmlockd() { - if pgrep lvmlockd ; then - echo "Cannot run while existing lvmlockd process exists" - exit 1 - fi + pgrep lvmlockd && skip "Cannot run while existing lvmlockd process exists" if test -n "$LVM_TEST_LOCK_TYPE_SANLOCK"; then # make check_lvmlockd_sanlock @@ -175,7 +162,7 @@ fi sleep 1 - if ! pgrep lvmlockd; then + if ! pgrep lvmlockd >LOCAL_LVMLOCKD; then echo "Failed to start lvmlockd" exit 1 fi @@ -418,9 +405,7 @@ for dm in $(dm_info name,open --separator ';' --nameprefixes --unquoted --sort open,"$sortby" -S "name=~$prefix" --mangle none || true) ; do test "$dm" != "No devices found" || break 2 - DM_NAME=${dm##DM_NAME=} - DM_NAME=${DM_NAME%%;DM_OPEN*} - DM_OPEN=${dm##*;DM_OPEN=} + eval "$dm" local force="-f" if test "$i" = 0; then if test "$once" = 1 ; then @@ -448,16 +433,29 @@ teardown_devs() { # Delete any remaining dm/udev semaphores teardown_udev_cookies + restore_dm_mirror test ! -f MD_DEV || cleanup_md_dev test ! -f DEVICES || teardown_devs_prefixed "$PREFIX" - test ! -f RAMDISK || { modprobe -r brd || true ; } + if test -f RAMDISK ; then + for i in 1 2 ; do + modprobe -r brd && break + sleep .1 + udev_wait + done + fi # NOTE: SCSI_DEBUG_DEV test must come before the LOOP test because # prepare_scsi_debug_dev() also sets LOOP to short-circuit prepare_loop() if test -f SCSI_DEBUG_DEV; then udev_wait - test "${LVM_TEST_PARALLEL:-0}" -eq 1 || modprobe -r scsi_debug + test "${LVM_TEST_PARALLEL:-0}" -eq 1 || { + for i in 1 2 ; do + modprobe -r scsi_debug && break + sleep .1 + udev_wait + done + } else test ! -f LOOP || losetup -d "$(< LOOP)" || true test ! -f LOOPFILE || rm -f "$(< LOOPFILE)" @@ -478,7 +476,6 @@ udev_wait } } - restore_dm_mirror } kill_sleep_kill_() { @@ -552,11 +549,7 @@ if test -n "$LVM_TEST_LVMLOCKD_TEST" ; then echo "" echo "## stopping lvmlockd in teardown" - killall lvmlockd - sleep 1 - killall lvmlockd || true - sleep 1 - killall -9 lvmlockd || true + kill_sleep_kill_ LOCAL_LVMLOCKD 0 fi dm_table | not grep -E -q "$vg|$vg1|$vg2|$vg3|$vg4" || { @@ -669,6 +662,7 @@ done fi test -n "$LOOP" # confirm or fail + touch NO_BLKDISCARD_Z # loop devices do not support WRITE_ZEROS BACKING_DEV=$LOOP echo "$LOOP" > LOOP echo "$LOOP" > BACKING_DEV @@ -678,8 +672,11 @@ prepare_ramdisk() { local size=$1 + # if brd is unused, remove and use for test + modprobe -r brd || return 0 + echo -n "## preparing ramdisk device..." - modprobe brd rd_size=$((size * 1024)) || return + modprobe brd rd_size=$((size * 1024)) rd_nr=1 || return BACKING_DEV=/dev/ram0 echo "ok ($BACKING_DEV)" @@ -867,37 +864,37 @@ } wipefs_a() { - local dev=$1 - local have_wipefs=1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/lib/flavour-udev-lvmlockd-dlm.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/lib/flavour-udev-lvmlockd-dlm.sh
Changed
@@ -1,5 +1,6 @@ export LVM_TEST_LOCKING=1 export LVM_TEST_LVMPOLLD=1 export LVM_TEST_LVMLOCKD=1 +export LVM_TEST_LVMLOCKD_TEST=1 export LVM_TEST_LOCK_TYPE_DLM=1 export LVM_TEST_DEVDIR=/dev
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/lib/inittest.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/lib/inittest.sh
Changed
@@ -106,25 +106,29 @@ fi cd "$TESTDIR" -mkdir lib +mkdir lib tmp # Setting up symlink from $i to $TESTDIR/lib +# library libdevmapper-event-lvm2.so.2.03 is needed with name test -n "${abs_top_builddir+varset}" && \ - find "$abs_top_builddir/daemons/dmeventd/plugins/" -name '*.so' \ + find "$abs_top_builddir/daemons/dmeventd/plugins/" -name '*.so*' \ -exec ln -s -t lib "{}" + find "$TESTOLDPWD/lib" ! \( -name '*.sh' -o -name '*.cdo' \ -o -name '*~' \) -exec ln -s -t lib "{}" + +LD_LIBRARY_PATH="$TESTDIR/lib:$LD_LIBRARY_PATH" DM_DEFAULT_NAME_MANGLING_MODE=none DM_DEV_DIR="$TESTDIR/dev" LVM_SYSTEM_DIR="$TESTDIR/etc" +TMPDIR="$TESTDIR/tmp" # abort on the internal dm errors in the tests (allowing test user override) DM_ABORT_ON_INTERNAL_ERRORS=${DM_ABORT_ON_INTERNAL_ERRORS:-1} DM_DEBUG_WITH_LINE_NUMBERS=${DM_DEBUG_WITH_LINE_NUMBERS:-1} export DM_DEFAULT_NAME_MANGLING_MODE DM_DEV_DIR LVM_SYSTEM_DIR DM_ABORT_ON_INTERNAL_ERRORS - mkdir "$LVM_SYSTEM_DIR" "$DM_DEV_DIR" +MACHINEID=$(uuidgen 2>/dev/null || echo "abcdefabcdefabcdefabcdefabcdefab") +echo "${MACHINEID//-/}" > "$LVM_SYSTEM_DIR/machine-id" # remove all '-' if test -n "$LVM_TEST_DEVDIR" ; then test -d "$LVM_TEST_DEVDIR" || die "Test device directory LVM_TEST_DEVDIR=\"$LVM_TEST_DEVDIR\" is not valid." DM_DEV_DIR=$LVM_TEST_DEVDIR
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/lib/lvm_vdo_wrapper.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/lib/lvm_vdo_wrapper.sh
Changed
@@ -11,7 +11,7 @@ # tool for shifting VDO metadata header by 2MiB LVM_VDO_PREPARE=${LVM_VDO_PREPARE-"oldvdoprepareforlvm"} # default vdo conf file -LVM_VDO_DEFAULT_CONF=${LVM_VDO_DEFAULT_CONF-"/tmp/vdoconf.yml"} +LVM_VDO_DEFAULT_CONF=${LVM_VDO_DEFAULT_CONF-"${TMPDIR:-/tmp}/vdoconf.yml"} vdo_die_() { echo -e "$@" >&2 @@ -39,6 +39,7 @@ esac case "$1" in + *kK) sz=1 ;; *mM) sz=1024 ;; *gG) sz=$(( 1024 * 1024 )) ;; *tT) sz=$(( 1024 * 1024 * 1024 )) ;; @@ -320,6 +321,10 @@ local vdo_name= local vdo_verbose= local vdo_device= +local vdo_dry_run= +local vdo_check= +local vdo_version= +local vdo_help= while "$#" -ne 0 do @@ -328,6 +333,10 @@ "--name"|"-n") shift; vdo_name=$1 ;; "--verbose"|"-d"|"--debug") vdo_verbose="-v" ;; "--force") vdo_force="--force" ;; + "--dry-run") vdo_dry_run="--dry-run" ;; + "--check") vdo_check="--check" ;; + "--version") vdo_version="--version" ;; + "--help") vdo_help="--help" ;; esac shift done @@ -339,7 +348,7 @@ "$vdo_confFile") #dmsetup status --target vdo "$vdo_name" || true -vdo_dry_ "$LVM_VDO_PREPARE" "$vdo_device" +vdo_dry_ "$LVM_VDO_PREPARE" $vdo_dry_run $vdo_check $vdo_version $vdo_help "$vdo_device" vdo_dry_ vdo_remove_ -f "$vdo_confFile" -n "$vdo_name" || true }
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/lib/utils.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/lib/utils.sh
Changed
@@ -189,14 +189,19 @@ echo "<======== Tree ========>" dmsetup ls --tree | sed -e "s,^,## DMTREE: ," echo "<======== Recursive list of $DM_DEV_DIR ========>" - ls -Rl --hide=shm --hide=bus --hide=snd --hide=input --hide=dri \ - --hide=net --hide=hugepages --hide=mqueue --hide=pts \ - "$DM_DEV_DIR" | sed -e "s,^,## LSLR: ," + ls -lR -I bsg -I bus -I char -Idma_heap -I dri \ + -I hugepages -I input -I mqueue \ + -I net -I pts -I shm -I snd \ + -I tty?* -I usb -I vfio -I vcs?* \ + -I virtio-ports \ + "$DM_DEV_DIR" | sed -e "s,^,## LS_LR: ," echo "<======== Udev DB content ========>" for i in /sys/block/dm-* /sys/block/loop* ; do udevadm info --query=all --path "$i" 2>/dev/null || true done | sed -e "s,^,## UDEV: ," fi + echo "<======== Free space ========>" + df -h | sed -e "s,^,## DF_H: ," echo "<======== Script file \"$(< TESTNAME)\" ========>" local script=$0 test -f "$script" || script="$TESTOLDPWD/$0" @@ -205,7 +210,7 @@ } init_udev_transaction() { - if test "$DM_UDEV_SYNCHRONISATION" = 1; then + if test "$DM_UDEV_SYNCHRONIZATION" = 1; then local cookie cookie=$(dmsetup udevcreatecookie) # Cookie is not generated if udev is not running! @@ -214,14 +219,14 @@ } finish_udev_transaction() { - if test "$DM_UDEV_SYNCHRONISATION" = 1 && test -n "${DM_UDEV_COOKIE-}" ; then + if test "$DM_UDEV_SYNCHRONIZATION" = 1 && test -n "${DM_UDEV_COOKIE-}" ; then dmsetup udevreleasecookie || true unset DM_UDEV_COOKIE fi } teardown_udev_cookies() { - if test "$DM_UDEV_SYNCHRONISATION" = 1; then + if test "$DM_UDEV_SYNCHRONIZATION" = 1; then # Delete any cookies created more than 10 minutes ago # and not used in the last 10 minutes. # Log only non-zero semaphores count @@ -297,9 +302,7 @@ *) PATH="$abs_top_builddir/test/lib:$abs_top_builddir/test/api:$PATH" LVM_BINARY=$(which lvm) - LD_LIBRARY_PATH=$(find -L "$abs_top_builddir/libdm/" "$abs_top_builddir/tools/"\ - "$abs_top_builddir/daemons/" \ - -name "*.so" -printf "%h:")"$LD_LIBRARY_PATH" + LD_LIBRARY_PATH="$abs_top_builddir/daemons/dmeventd:$abs_top_builddir/tools:$abs_top_builddir/libdm:$LD_LIBRARY_PATH" export PATH LD_LIBRARY_PATH LVM_BINARY ;; esac fi
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/aa-lvmlockd-dlm-prepare.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/aa-lvmlockd-dlm-prepare.sh
Changed
@@ -12,6 +12,8 @@ test_description='Set up things to run tests with dlm' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest -z "$LVM_TEST_LOCK_TYPE_DLM" && skip;
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/aa-lvmlockd-idm-prepare.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/aa-lvmlockd-idm-prepare.sh
Changed
@@ -12,6 +12,8 @@ test_description='Set up things to run tests with idm' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest -z "$LVM_TEST_LOCK_TYPE_IDM" && skip;
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/aa-lvmlockd-sanlock-prepare.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/aa-lvmlockd-sanlock-prepare.sh
Changed
@@ -12,6 +12,8 @@ test_description='Set up things to run tests with sanlock' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest -z "$LVM_TEST_LOCK_TYPE_SANLOCK" && skip;
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/allow-mixed-block-sizes.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/allow-mixed-block-sizes.sh
Changed
@@ -10,6 +10,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/cache-single-split.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/cache-single-split.sh
Changed
@@ -17,7 +17,7 @@ . lib/inittest case "$(uname -r)" in -6.2*) skip "Skippen test that kills this kernel" ;; +6.0123*|5.19*) skip "Skippen test that kills this kernel" ;; esac mkfs_mount_umount()
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/devicesfile-basic.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/devicesfile-basic.sh
Changed
@@ -12,6 +12,8 @@ test_description='devices file' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest aux prepare_devs 7 @@ -31,13 +33,7 @@ } wipe_all() { - aux wipefs_a "$dev1" - aux wipefs_a "$dev2" - aux wipefs_a "$dev3" - aux wipefs_a "$dev4" - aux wipefs_a "$dev5" - aux wipefs_a "$dev6" - aux wipefs_a "$dev7" + aux wipefs_a "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6" "$dev7" } # The tests run with system dir of "/etc" but lvm when running
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/devicesfile-devname.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/devicesfile-devname.sh
Changed
@@ -12,6 +12,8 @@ test_description='devices file with devnames' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest aux prepare_devs 7 @@ -581,10 +583,7 @@ echo "$md" > WAIT_MD_DEV } -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" -aux wipefs_a "$dev4" +aux wipefs_a "$dev1" "$dev2" "$dev3" "$dev4" rm "$DF" touch "$DF"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/devicesfile-edit.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/devicesfile-edit.sh
Changed
@@ -12,6 +12,8 @@ test_description='devices file editing with lvmdevices' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest aux lvmconf 'devices/scan = "/dev"' @@ -239,6 +241,16 @@ setup_loop_devs rm $DF +# test delnotfound +lvmdevices --addpvid "$PVID1" +echo "IDTYPE=sys_wwid IDNAME=naa.123 DEVNAME=/dev/sdx1 PVID=aaa PART=1" >> $DF +echo "IDTYPE=devname IDNAME=/dev/sdy DEVNAME=/dev/sdy PVID=bbb" >> $DF +lvmdevices +lvmdevices --update --delnotfound +not grep PVID=aaa $DF +not grep PVID=bbb $DF + + # TODO: add/rem of partitions of same device losetup -D
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/devicesfile-realdevs.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/devicesfile-realdevs.sh
Changed
@@ -12,6 +12,8 @@ test_description='devices file with real devs' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest #
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/devicesfile-serial.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/devicesfile-serial.sh
Changed
@@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (C) 2020 Red Hat, Inc. All rights reserved. +# Copyright (C) 2020-23 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions @@ -12,29 +12,31 @@ test_description='device id wwid from vpd_pg83' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest +test -d /sys/block/ram0 && skip "Ramdisk already loaded" + test "$DM_DEV_DIR" = "/dev" || skip "Only works with /dev access -> make check LVM_TEST_DEVDIR=/dev" -aux lvmconf 'devices/use_devicesfile = 1' # requires trailing / to match dm -aux lvmconf 'devices/device_id_sysfs_dir = "/test/sys/"' -SYS_DIR="/test/sys" - +SYS_DIR="$PWD/test/sys" +aux lvmconf "devices/use_devicesfile = 1" \ + "devices/device_id_sysfs_dir = \"$SYS_DIR/\"" # The string format of the serial numbers # encoded in the pg80 files -SERIAL1=003dd33a331c183c2300e1d883604609 -SERIAL2=003dd33a441c183c2300e1d883604609 -SERIAL3=003dd33a551c183c2300e1d883604609 -SERIAL4=003dd33a661c183c2300e1d883604609 +SERIAL1="003dd33a331c183c2300e1d883604609" +SERIAL2="003dd33a441c183c2300e1d883604609" +SERIAL3="003dd33a551c183c2300e1d883604609" +SERIAL4="003dd33a661c183c2300e1d883604609" create_base() { - mkdir -p $SYS_DIR/dev/block - mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device - mkdir -p $SYS_DIR/dev/block/$MAJOR2:$MINOR2/device - mkdir -p $SYS_DIR/dev/block/$MAJOR3:$MINOR3/device - mkdir -p $SYS_DIR/dev/block/$MAJOR4:$MINOR4/device + mkdir -p "$SYS_DIR/dev/block/$MAJOR1:$MINOR1/device" + mkdir -p "$SYS_DIR/dev/block/$MAJOR2:$MINOR2/device" + mkdir -p "$SYS_DIR/dev/block/$MAJOR3:$MINOR3/device" + mkdir -p "$SYS_DIR/dev/block/$MAJOR4:$MINOR4/device" # Create four different pg80 serial numbers that # can be assigned to devs @@ -53,73 +55,92 @@ } remove_base() { - rm -rf $SYS_DIR + rm -rf "$SYS_DIR" +} + +cleanup_and_teardown() +{ + remove_base + rmmod brd + + aux teardown } -modprobe brd -sleep 2 +trap 'cleanup_and_teardown' EXIT + +modprobe brd rd_nr=4 || skip +sleep 1 remove_base -dev1=/dev/ram0 -dev2=/dev/ram1 -dev3=/dev/ram2 -dev4=/dev/ram3 +dev1="/dev/ram0" +dev2="/dev/ram1" +dev3="/dev/ram2" +dev4="/dev/ram3" + +devs=( "$dev1" "$dev2" "$dev3" "$dev4" ) DFDIR="$LVM_SYSTEM_DIR/devices" mkdir -p "$DFDIR" || true DF="$DFDIR/system.devices" ORIG="$DFDIR/orig.devices" -touch $DF +touch "$DF" -aux wipefs_a $dev1 -aux wipefs_a $dev2 -aux wipefs_a $dev3 -aux wipefs_a $dev4 +aux wipefs_a "${devs@}" vgcreate $vg1 "$dev1" -MAJOR1=`pvs "$dev1" --noheading -o major | tr -d - | awk '{print $1}'` -MINOR1=`pvs "$dev1" --noheading -o minor | tr -d - | awk '{print $1}'` -OPVID1=`pvs "$dev1" --noheading -o uuid | awk '{print $1}'` -PVID1=`pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}'` +eval "$(pvs --noheading --nameprefixes -o major,minor,uuid "$dev1")" +MAJOR1=$LVM2_PV_MAJOR +MINOR1=$LVM2_PV_MINOR +OPVID1=$LVM2_PV_UUID +PVID1=${OPVID1//-/} vgcreate $vg2 "$dev2" -MAJOR2=`pvs "$dev2" --noheading -o major | tr -d - | awk '{print $1}'` -MINOR2=`pvs "$dev2" --noheading -o minor | tr -d - | awk '{print $1}'` -OPVID2=`pvs "$dev2" --noheading -o uuid | awk '{print $1}'` -PVID2=`pvs "$dev2" --noheading -o uuid | tr -d - | awk '{print $1}'` +eval "$(pvs --noheading --nameprefixes -o major,minor,uuid "$dev2")" +MAJOR2=$LVM2_PV_MAJOR +MINOR2=$LVM2_PV_MINOR +OPVID2=$LVM2_PV_UUID +PVID2=${OPVID2//-/} vgcreate $vg3 "$dev3" -MAJOR3=`pvs "$dev3" --noheading -o major | tr -d - | awk '{print $1}'` -MINOR3=`pvs "$dev3" --noheading -o minor | tr -d - | awk '{print $1}'` -OPVID3=`pvs "$dev3" --noheading -o uuid | awk '{print $1}'` -PVID3=`pvs "$dev3" --noheading -o uuid | tr -d - | awk '{print $1}'` +eval "$(pvs --noheading --nameprefixes -o major,minor,uuid "$dev3")" +MAJOR3=$LVM2_PV_MAJOR +MINOR3=$LVM2_PV_MINOR +OPVID3=$LVM2_PV_UUID +PVID3=${OPVID3//-/} vgcreate $vg4 "$dev4" -MAJOR4=`pvs "$dev4" --noheading -o major | tr -d - | awk '{print $1}'` -MINOR4=`pvs "$dev4" --noheading -o minor | tr -d - | awk '{print $1}'` -OPVID4=`pvs "$dev4" --noheading -o uuid | awk '{print $1}'` -PVID4=`pvs "$dev4" --noheading -o uuid | tr -d - | awk '{print $1}'` +eval "$(pvs --noheading --nameprefixes -o major,minor,uuid "$dev4")" +MAJOR4=$LVM2_PV_MAJOR +MINOR4=$LVM2_PV_MINOR +OPVID4=$LVM2_PV_UUID +PVID4=${OPVID4//-/} create_base # get serial number from pg80 -cp pg80_1 $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/vpd_pg80 -cp pg80_2 $SYS_DIR/dev/block/$MAJOR2:$MINOR2/device/vpd_pg80 -cp pg80_3 $SYS_DIR/dev/block/$MAJOR3:$MINOR3/device/vpd_pg80 -cp pg80_4 $SYS_DIR/dev/block/$MAJOR4:$MINOR4/device/vpd_pg80 - -rm $DF -lvmdevices --adddev "$dev1" -grep $SERIAL1 $DF -lvmdevices --adddev "$dev2" -grep $SERIAL2 $DF -lvmdevices --adddev "$dev3" -grep $SERIAL3 $DF -lvmdevices --adddev "$dev4" -grep $SERIAL4 $DF -cat $DF -cp $DF $ORIG +cp pg80_1 "$SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/vpd_pg80" +cp pg80_2 "$SYS_DIR/dev/block/$MAJOR2:$MINOR2/device/vpd_pg80" +cp pg80_3 "$SYS_DIR/dev/block/$MAJOR3:$MINOR3/device/vpd_pg80" +cp pg80_4 "$SYS_DIR/dev/block/$MAJOR4:$MINOR4/device/vpd_pg80" + +grep -r "" "$SYS_DIR/dev/block/" + +declare -A serials=( "$dev1"=$SERIAL1 "$dev2"=$SERIAL2 \ + "$dev3"=$SERIAL3 "$dev4"=$SERIAL4 ) + +rm -f "$DF" + +for i in "${devs@}" +do + lvmdevices --adddev "$i" + grep "${serials"$i"}" "$DF" || { + cat "$DF" + die "Cannot find ${serials"$i"}" + } +done +cat "$DF" +cp "$DF" "$ORIG" pvs # run command to update metadata so deviceids are written to metadata vgchange --addtag x $vg1 @@ -127,123 +148,117 @@ vgchange --addtag x $vg3 vgchange --addtag x $vg4 pvs -o uuid,deviceidtype,deviceid "$dev1" |tee out -grep $OPVID1 out +grep "$OPVID1" out grep sys_serial out -grep $SERIAL1 out +grep "$SERIAL1" out pvs -o uuid,deviceidtype,deviceid "$dev2" |tee out
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/devicesfile-vpd-ids.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/devicesfile-vpd-ids.sh
Changed
@@ -12,6 +12,8 @@ test_description='device id wwid from vpd_pg83' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest test "$DM_DEV_DIR" = "/dev" || skip "Only works with /dev access -> make check LVM_TEST_DEVDIR=/dev" @@ -80,6 +82,7 @@ DFDIR="$LVM_SYSTEM_DIR/devices" mkdir -p "$DFDIR" || true DF="$DFDIR/system.devices" +DFTMP="$DFDIR/system.devices_tmp" touch $DF pvcreate "$DEV1" @@ -222,8 +225,8 @@ # Test t10 wwid containing quote rm $DF aux wipefs_a "$DEV1" -mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/ -echo "t10.ATA_2.5\"_SATA_SSD_1112-A___111111111111" > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/wwid +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo "t10.ATA_2.5\"_SATA_SSD_1112-A___111111111111" > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid lvmdevices --adddev "$DEV1" cat $DF vgcreate $vg "$DEV1" @@ -240,9 +243,192 @@ grep 2.5_SATA_SSD $DF lvremove -y $vg vgremove $vg -rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/wwid +rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cleanup_sysfs + +# Test t10 wwid with trailing space and line feed at the end +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo -n "7431 302e 4154 4120 2020 2020 5642 4f58 \ +2048 4152 4444 4953 4b20 2020 2020 2020 \ +2020 2020 2020 2020 2020 2020 2020 2020 \ +2020 2020 5642 3963 3130 6433 3138 2d31 \ +3838 6439 6562 6320 0a" | xxd -r -p > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cat $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +lvmdevices --adddev "$DEV1" +cat $DF +vgcreate $vg "$DEV1" +lvcreate -l1 -an $vg +cat $DF +# check wwid string in metadata output +pvs -o+deviceidtype,deviceid "$DEV1" |tee out +grep sys_wwid out +# check wwid string in system.devices +grep sys_wwid $DF +lvremove -y $vg +vgremove $vg +rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid cleanup_sysfs +# Test t10 wwid with trailing space at the end that was created by 9.0/9.1 +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo -n "7431 302e 4154 4120 2020 2020 5642 4f58 \ +2048 4152 4444 4953 4b20 2020 2020 2020 \ +2020 2020 2020 2020 2020 2020 2020 2020 \ +2020 2020 5642 3963 3130 6433 3138 2d31 \ +3838 6439 6562 6320 0a" | xxd -r -p > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cat $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +lvmdevices --adddev "$DEV1" +cat $DF +vgcreate $vg "$DEV1" +PVID1=`pvs "$DEV1" --noheading -o uuid | tr -d - | awk '{print $1}'` +T10_WWID_RHEL91="t10.ATA_____VBOX_HARDDISK___________________________VB9c10d318-188d9ebc_" +lvcreate -l1 -an $vg +cat $DF +# check wwid string in metadata output +pvs -o+deviceidtype,deviceid "$DEV1" |tee out +grep sys_wwid out +# check wwid string in system.devices +grep sys_wwid $DF +# Replace IDNAME with the IDNAME that 9.0/9.1 created from this wwid +cat $DF | grep -v IDNAME > $DFTMP +cat $DFTMP +echo "IDTYPE=sys_wwid IDNAME=t10.ATA_____VBOX_HARDDISK___________________________VB9c10d318-188d9ebc_ DEVNAME=${DEV1} PVID=${PVID1}" >> $DFTMP +cp $DFTMP $DF +cat $DF +vgs +pvs +pvs -o+deviceidtype,deviceid "$DEV1" +# Removing the trailing _ which should then work +cat $DF | grep -v IDNAME > $DFTMP +cat $DFTMP +echo "IDTYPE=sys_wwid IDNAME=t10.ATA_____VBOX_HARDDISK___________________________VB9c10d318-188d9ebc DEVNAME=${DEV1} PVID=${PVID1}" >> $DFTMP +cp $DFTMP $DF +cat $DF +vgs +pvs +pvs -o+deviceidtype,deviceid "$DEV1" +lvremove -y $vg +vgremove $vg +rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cleanup_sysfs + +# test a t10 wwid that has actual trailing underscore which +# is followed by a trailing space. +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo -n "7431 302e 4154 4120 2020 2020 5642 4f58 \ +2048 4152 4444 4953 4b20 2020 2020 2020 \ +2020 2020 2020 2020 2020 2020 2020 2020 \ +2020 2020 5642 3963 3130 6433 3138 2d31 \ +3838 6439 6562 5f20 0a" | xxd -r -p > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cat $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +# The wwid has an actual underscore char (5f) followed by a space char (20) +# 9.1 converts the trailing space to an underscore +T10_WWID_RHEL91="t10.ATA_____VBOX_HARDDISK___________________________VB9c10d318-188d9eb__" +# 9.2 ignores the trailing space +T10_WWID_RHEL92="t10.ATA_____VBOX_HARDDISK___________________________VB9c10d318-188d9eb_" +lvmdevices --adddev "$DEV1" +cat $DF +vgcreate $vg "$DEV1" +PVID1=`pvs "$DEV1" --noheading -o uuid | tr -d - | awk '{print $1}'` +lvcreate -l1 -an $vg +cat $DF +# check wwid string in metadata output +pvs -o+deviceidtype,deviceid "$DEV1" |tee out +grep sys_wwid out +# check wwid string in system.devices +grep sys_wwid $DF +# Replace IDNAME with the IDNAME that 9.0/9.1 created from this wwid +cat $DF | grep -v IDNAME > $DFTMP +cat $DFTMP +echo "IDTYPE=sys_wwid IDNAME=${T10_WWID_RHEL91} DEVNAME=${DEV1} PVID=${PVID1}" >> $DFTMP +cp $DFTMP $DF +cat $DF +vgs +pvs +pvs -o+deviceidtype,deviceid "$DEV1" +lvremove -y $vg +vgremove $vg +rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cleanup_sysfs + +# +# Test trailing/leading/center spaces in sys_wwid and sys_serial device +# ids, and that old system.devices files that have trailing/leading +# underscores are understood. +# + +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo -n " s123 456 " > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/serial +lvmdevices --adddev "$DEV1" +cat $DF +grep "IDNAME=s123__456 DEVNAME" $DF +vgcreate $vg "$DEV1" +PVID1=`pvs "$DEV1" --noheading -o uuid | tr -d - | awk '{print $1}'` +cat $DF | grep -v IDNAME > $DFTMP +cat $DFTMP +echo "IDTYPE=sys_serial IDNAME=__s123__456__ DEVNAME=${DEV1} PVID=${PVID1}" >> $DFTMP +cp $DFTMP $DF +cat $DF +vgs +pvs -o+deviceidtype,deviceid "$DEV1" +lvremove -y $vg +vgremove $vg +rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/serial +cleanup_sysfs + +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo -n " t10.123 456 " > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +lvmdevices --adddev "$DEV1" +cat $DF +grep "IDNAME=t10.123_456 DEVNAME" $DF +vgcreate $vg "$DEV1" +PVID1=`pvs "$DEV1" --noheading -o uuid | tr -d - | awk '{print $1}'` +cat $DF | grep -v IDNAME > $DFTMP +cat $DFTMP +echo "IDTYPE=sys_wwid IDNAME=__t10.123__456__ DEVNAME=${DEV1} PVID=${PVID1}" >> $DFTMP +cp $DFTMP $DF +cat $DF +vgs +pvs -o+deviceidtype,deviceid "$DEV1" +lvremove -y $vg +vgremove $vg +rm $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +cleanup_sysfs + +rm $DF +aux wipefs_a "$DEV1" +mkdir -p $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device +echo -n " naa.123 456 " > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/wwid +lvmdevices --adddev "$DEV1"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/discards-thin.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/discards-thin.sh
Changed
@@ -15,6 +15,7 @@ SKIP_WITH_LVMPOLLD=1 +SKIP_WITH_LVMLOCKD=1 export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/dmsecuretest.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/dmsecuretest.sh
Changed
@@ -13,6 +13,7 @@ # Test secure table is not leaking data in user land SKIP_WITH_LVMPOLLD=1 +SKIP_WITH_LVMLOCKD=1 # AES key matching rot13 string from dmsecuretest.c */ SECURE="434e0cbab02ca68ffba9268222c3789d703fe62427b78b308518b3228f6a2122"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/dmstats-create.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/dmstats-create.sh
Changed
@@ -11,7 +11,7 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA SKIP_WITH_LVMPOLLD=1 - +SKIP_WITH_LVMLOCKD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/dmstats-report.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/dmstats-report.sh
Changed
@@ -11,7 +11,7 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA SKIP_WITH_LVMPOLLD=1 - +SKIP_WITH_LVMLOCKD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/duplicate-pvs-md0.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/duplicate-pvs-md0.sh
Changed
@@ -178,9 +178,7 @@ #lvs -o active $vg |tee out || true #not grep "active" out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux udev_wait +aux wipefs_a "$dev1" "$dev2" ########################################## # PV on an md raidX device @@ -242,9 +240,7 @@ lvmdevices --deldev $mddev || true aux cleanup_md_dev -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux udev_wait +aux wipefs_a "$dev1" "$dev2" if "$MD_LEVEL" = "1" ; then ########################################## @@ -303,10 +299,7 @@ test ! -f "$RUNDIR/lvm/pvs_online/$PVIDMD" test ! -f "$RUNDIR/lvm/vgs_online/$vg" -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev4" -aux udev_wait +aux wipefs_a "$dev1" "$dev2" "$dev4" fi # MD_LEVEL == 1 # next loop with 'start'
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/duplicate-vgnames.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/duplicate-vgnames.sh
Changed
@@ -116,8 +116,7 @@ vgs --foreign -o+uuid |tee out grep $UUID1 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" +aux wipefs_a "$dev1" "$dev2" # b. 0 local, 2 foreign # setup @@ -163,9 +162,7 @@ vgs --foreign -o+uuid |tee out grep $UUID1 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" +aux wipefs_a "$dev1" "$dev2" "$dev3" # c. 1 local, 1 foreign # setup @@ -221,9 +218,7 @@ vgs --foreign -o+uuid |tee out grep $UUID2 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" +aux wipefs_a "$dev1" "$dev2" "$dev3" # d. 1 local, 2 foreign # setup @@ -240,8 +235,7 @@ lvcreate -n $lv1 -l1 -an $vg1 UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other2" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" vgs -o+uuid |tee out grep $vg1 out @@ -292,10 +286,7 @@ grep $UUID2 out grep $UUID3 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" -aux wipefs_a "$dev4" +aux wipefs_a "$dev1" "$dev2" "$dev3" "$dev4" # e. 2 local, 0 foreign # setup @@ -354,9 +345,7 @@ not grep $UUID1 out not grep $UUID2 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" +aux wipefs_a "$dev1" "$dev2" "$dev3" # f. 2 local, 1 foreign # setup @@ -373,8 +362,7 @@ lvcreate -n $lv1 -l1 -an $vg1 UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" vgs -o+uuid |tee out grep $vg1 out @@ -399,7 +387,7 @@ grep $UUID3 out | not grep active vgchange -an -not vgchange -ay -vvvv $vg1 +not vgchange -ay $vg1 lvs --foreign -o vguuid,active |tee out grep $UUID1 out | not grep active grep $UUID2 out | not grep active @@ -429,10 +417,7 @@ not grep $UUID2 out grep $UUID3 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" -aux wipefs_a "$dev4" +aux wipefs_a "$dev1" "$dev2" "$dev3" "$dev4" # g. 2 local, 2 foreign # setup @@ -454,9 +439,7 @@ lvcreate -n $lv1 -l1 -an $vg1 UUID4=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other2" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev2" -aux enable_dev "$dev3" +aux enable_dev "$dev1" "$dev2" "$dev3" vgs -o+uuid |tee out grep $vg1 out @@ -507,11 +490,7 @@ grep $UUID3 out grep $UUID4 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" -aux wipefs_a "$dev4" -aux wipefs_a "$dev5" +aux wipefs_a "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" # h. 3 local, 3 foreign # setup @@ -543,11 +522,7 @@ lvcreate -n $lv1 -l1 -an $vg1 UUID6=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other3" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev2" -aux enable_dev "$dev3" -aux enable_dev "$dev4" -aux enable_dev "$dev5" +aux enable_dev "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" vgs -o+uuid |tee out grep $vg1 out @@ -610,12 +585,7 @@ grep $UUID5 out grep $UUID6 out -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" -aux wipefs_a "$dev4" -aux wipefs_a "$dev5" -aux wipefs_a "$dev6" +aux wipefs_a "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6" # vgreduce test with 1 local and 1 foreign vg. # setup @@ -624,15 +594,13 @@ UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs) PV1UUID=$(pvs --noheading -o uuid "$dev1") PV7UUID=$(pvs --noheading -o uuid "$dev7") -aux disable_dev "$dev1" -aux disable_dev "$dev7" +aux disable_dev "$dev1" "$dev7" vgcreate $vg1 "$dev2" PV2UUID=$(pvs --noheading -o uuid "$dev2") lvcreate -n $lv1 -l1 -an $vg1 UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev7" +aux enable_dev "$dev1" "$dev7" vgs --foreign -o+uuid |tee out grep $vg1 out @@ -654,7 +622,3 @@ not grep $vg1 out2 vgremove -ff $vg1 - -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev7"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/duplicate-vgrename.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/duplicate-vgrename.sh
Changed
@@ -61,8 +61,7 @@ lvs --foreign -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" +aux wipefs_a "$dev1" "$dev2" # c. 1 local, 1 foreign # setup @@ -93,8 +92,7 @@ lvs --foreign -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" +aux wipefs_a "$dev1" "$dev2" # d. 1 local, 2 foreign # setup @@ -111,8 +109,7 @@ lvcreate -n $lv1 -l1 -ky -an $vg1 UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other2" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" vgrename $vg1 $vg2 vgs --foreign -o+uuid |tee out @@ -133,9 +130,7 @@ lvs --foreign -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" +aux wipefs_a "$dev1" "$dev2" "$dev3" # e. 2 local, 0 foreign # setup @@ -172,8 +167,7 @@ lvs --foreign -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" +aux wipefs_a "$dev1" "$dev2" # f. 2 local, 1 foreign # setup @@ -189,8 +183,7 @@ lvcreate -n $lv1 -l1 -ky -an $vg1 UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs) vgchange -y --systemid "other" $vg1 -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" lvs --foreign not vgrename $vg1 $vg2 @@ -239,9 +232,7 @@ lvs --foreign -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" +aux wipefs_a "$dev1" "$dev2" "$dev3" # g. 3 local, 0 foreign # setup @@ -256,8 +247,7 @@ vgcreate $vg1 "$dev3" lvcreate -n ${lv1}_c -l1 -ky -an $vg1 UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs) -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" not vgrename $vg1 $vg2 vgs -o+uuid |tee out @@ -312,8 +302,3 @@ grep $UUID3 out lvs --foreign - -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" -
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/error-usage.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/error-usage.sh
Changed
@@ -13,6 +13,7 @@ # Basic usage of zero target +SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/fsadm-crypt-fsresize.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/fsadm-crypt-fsresize.sh
Changed
@@ -20,7 +20,7 @@ . lib/inittest -aux prepare_vg 1 300 +aux prepare_vg 1 1100 # Tests require a libblkid version that shows FSLASTBLOCK which mkfs.ext4 || skip @@ -209,8 +209,8 @@ vgchange -s 128k lvcreate -n $lv1 -L25M $vg -lvcreate -n ${lv1}bar -L35M $vg -lvcreate -n ${lv1}plain -L35M $vg +lvcreate -n ${lv1}bar -L335M $vg +lvcreate -n ${lv1}plain -L335M $vg create_crypt_device trap 'cleanup_mounted_and_teardown' EXIT @@ -275,9 +275,9 @@ } test_xfs_resize() { - mkfs.xfs -l internal,size=1536b -f "$3" + mkfs.xfs -f "$3" - fsadm --lvresize resize $1 30M + fsadm --lvresize resize $1 330M # Fails - not enough space for 4M fs lvresize -L+10M -y --fs resize $1 not lvreduce -L10M --fs resize $1 @@ -290,7 +290,7 @@ } test_xfs_small_shrink() { - mkfs.xfs -l internal,size=1536b -f "$3" + mkfs.xfs -f "$3" not lvresize -L-1 --fs resize $1 fscheck_xfs "$3" @@ -299,8 +299,10 @@ test_reiserfs_resize() { mkfs.reiserfs -s 513 -f "$3" - fsadm --lvresize resize $1 30M - lvresize -L+10M --fs resize $1 + fsadm -y --lvresize resize $1 30M + # resize fs does not support resiserfs and requires resize_fsadm + not lvresize -L+10M --fs resize $1 + lvresize -L+10M --fs resize_fsadm $1 fsadm --lvresize -y resize $1 10M fscheck_reiserfs "$3" @@ -314,8 +316,9 @@ test_reiserfs_small_shrink() { mkfs.reiserfs -s 513 -f "$3" - lvresize -y -L-1 --fs resize $1 - lvresize -y -L-1 --fs resize $1 + not lvresize -y -L-1 --fs resize $1 + lvresize -y -L-1 --fs resize_fsadm $1 + lvresize -y -L-1 --fs resize_fsadm $1 fscheck_reiserfs "$3" } @@ -354,7 +357,7 @@ test_xfs_inactive() { crypt_open "$2" $PWD2 "$4" - mkfs.xfs -l internal,size=1536b -f "$3" + mkfs.xfs -f "$3" crypt_close "$4" not fsadm --lvresize resize $1 30M @@ -435,7 +438,7 @@ } test_xfs_plain() { - mkfs.xfs -l internal,size=1536b -f "$3" + mkfs.xfs -f "$3" not fsadm --lvresize resize $1 30M not lvresize -L+10M --fs resize $1 @@ -443,7 +446,7 @@ fscheck_xfs "$3" lvresize -f -L+10M $1 - fsadm --cryptresize resize $3 40M + fsadm --cryptresize resize $3 345M # no shrink support in xfs not fsadm --cryptresize resize $3 35M fscheck_xfs "$3" @@ -455,7 +458,7 @@ crypt_open_plain "$2" $PWD3 "$4" fscheck_xfs "$3" - lvresize -f -L35M $1 + lvresize -f -L320M $1 } test_reiserfs_plain() { @@ -501,7 +504,7 @@ } test_xfs_detached() { - mkfs.xfs -l internal,size=1536b -f "$3" + mkfs.xfs -f "$3" not fsadm --lvresize resize $1 30M not lvresize -L+10M --fs resize $1 @@ -569,20 +572,21 @@ fi if check_missing xfs; then - test_xfs_resize "$vg_lv" "$dev_vg_lv" "$CRYPT_DEV" - lvresize --fs ignore -y -L25M $vg_lv + lvresize --fs ignore -y -L325M $vg_lv cryptsetup resize $CRYPT_NAME + test_xfs_resize "$vg_lv" "$dev_vg_lv" "$CRYPT_DEV" + test_xfs_inactive "$vg_lv2" "$dev_vg_lv2" "$CRYPT_DEV2" "$CRYPT_NAME2" crypt_open_plain "$dev_vg_lv3" $PWD3 "$CRYPT_NAME_PLAIN" test_xfs_plain "$vg_lv3" "$dev_vg_lv3" "$CRYPT_DEV_PLAIN" "$CRYPT_NAME_PLAIN" crypt_close "$CRYPT_NAME_PLAIN" - lvresize --fs ignore -y -L100M $vg_lv + lvresize --fs ignore -y -L310M $vg_lv cryptsetup resize $CRYPT_NAME test_xfs_small_shrink "$vg_lv" "$dev_vg_lv" "$CRYPT_DEV" - lvresize --fs ignore -y -L25M $vg_lv + lvresize --fs ignore -y -L325M $vg_lv cryptsetup resize $CRYPT_NAME if -z "$SKIP_DETACHED" ; then
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/hints.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/hints.sh
Changed
@@ -17,6 +17,11 @@ . lib/inittest +# Since this test is currenly using 'system's' hints, +# it cannot be running, while lvmdbusd operates in the system. +# FIXME: sometimes test suite itself 'leaks' lvmdbusd process. +pgrep lvmdbusd && skip "Can't run this test, while lvmdbusd is running" + RUNDIR="/run" test -d "$RUNDIR" || RUNDIR="/var/run" HINTS="$RUNDIR/lvm/hints" @@ -84,9 +89,7 @@ grep "$dev2" $HINTS grep "$dev3" $HINTS -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux wipefs_a "$dev3" +aux wipefs_a "$dev1" "$dev2" "$dev3" # # vg1 uses dev1,dev2
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-blocksize-2.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-blocksize-2.sh
Changed
@@ -21,37 +21,6 @@ mnt="mnt" mkdir -p $mnt -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually - if test -z "$sync"; then - echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - exit - fi - echo "timeout waiting for recalc" - return 1 -} - # prepare_devs uses ramdisk backing which has 512 LBS and 4K PBS # This should cause mkfs.xfs to use 4K sector size, # and integrity to use 4K block size @@ -74,8 +43,8 @@ lvchange -an $vg lvconvert --raidintegrity y $vg/$lv1 lvchange -ay $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello @@ -95,8 +64,8 @@ lvchange -an $vg lvchange -ay $vg lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello | grep "hello world" @@ -113,8 +82,8 @@ mount "$DM_DEV_DIR/$vg/$lv1" $mnt echo "hello world" > $mnt/hello lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg cat $mnt/hello | grep "hello world" umount $mnt
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-blocksize-3.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-blocksize-3.sh
Changed
@@ -19,37 +19,6 @@ mnt="mnt" mkdir -p $mnt -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually - if test -z "$sync"; then - echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - exit - fi - echo "timeout waiting for recalc" - return 1 -} - # scsi_debug devices with 512 LBS 512 PBS aux prepare_scsi_debug_dev 256 check sysfs "$(< SCSI_DEBUG_DEV)" queue/logical_block_size "512" @@ -73,8 +42,8 @@ lvchange -an $vg lvconvert --raidintegrity y $vg/$lv1 lvchange -ay $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello @@ -93,8 +62,8 @@ lvchange -an $vg lvchange -ay $vg lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello | grep "hello world" @@ -110,8 +79,8 @@ mount "$DM_DEV_DIR/$vg/$lv1" $mnt echo "hello world" > $mnt/hello lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg cat $mnt/hello | grep "hello world" umount $mnt @@ -150,8 +119,8 @@ lvchange -an $vg lvconvert --raidintegrity y $vg/$lv1 lvchange -ay $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello @@ -170,8 +139,8 @@ lvchange -an $vg lvchange -ay $vg lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello | grep "hello world" @@ -187,8 +156,8 @@ mount "$DM_DEV_DIR/$vg/$lv1" $mnt echo "hello world" > $mnt/hello lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg cat $mnt/hello | grep "hello world" umount $mnt @@ -227,8 +196,8 @@ lvchange -an $vg lvconvert --raidintegrity y $vg/$lv1 lvchange -ay $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello @@ -248,8 +217,8 @@ lvchange -an $vg lvchange -ay $vg lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg mount "$DM_DEV_DIR/$vg/$lv1" $mnt cat $mnt/hello | grep "hello world" @@ -266,8 +235,8 @@ mount "$DM_DEV_DIR/$vg/$lv1" $mnt echo "hello world" > $mnt/hello lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg cat $mnt/hello | grep "hello world" umount $mnt
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-blocksize.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-blocksize.sh
Changed
@@ -40,7 +40,7 @@ aux prepare_devs 1 vgcreate $vg "$dev1" lvcreate -n $lv1 -l8 $vg -mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1" +mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" blkid -p "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip lvchange -an $vg vgremove -ff $vg @@ -63,45 +63,39 @@ LOOP3=$(losetup -f loopc --sector-size 4096 --show) || skip "Loop cannot handle --sector-size 4096" LOOP4=$(losetup -f loopd --sector-size 4096 --show) || skip "Loop cannot handle --sector-size 4096" -echo $LOOP1 -echo $LOOP2 -echo $LOOP3 -echo $LOOP4 +echo "$LOOP1" +echo "$LOOP2" +echo "$LOOP3" +echo "$LOOP4" -aux extend_filter "a|$LOOP1|" -aux extend_filter "a|$LOOP2|" -aux extend_filter "a|$LOOP3|" -aux extend_filter "a|$LOOP4|" -aux extend_devices "$LOOP1" -aux extend_devices "$LOOP2" -aux extend_devices "$LOOP3" -aux extend_devices "$LOOP4" +aux extend_filter "a|$LOOP1|" "a|$LOOP2|" "a|$LOOP3|" "a|$LOOP4|" +aux extend_devices "$LOOP1" "$LOOP2" "$LOOP3" "$LOOP4" aux lvmconf 'devices/scan = "/dev"' -vgcreate $vg1 $LOOP1 $LOOP2 -vgcreate $vg2 $LOOP3 $LOOP4 +vgcreate $vg1 "$LOOP1" "$LOOP2" +vgcreate $vg2 "$LOOP3" "$LOOP4" # LOOP1/LOOP2 have LBS 512 and PBS 512 # LOOP3/LOOP4 have LBS 4K and PBS 4K -blockdev --getss $LOOP1 -blockdev --getpbsz $LOOP1 -blockdev --getss $LOOP2 -blockdev --getpbsz $LOOP2 -blockdev --getss $LOOP3 -blockdev --getpbsz $LOOP3 -blockdev --getss $LOOP4 -blockdev --getpbsz $LOOP4 +blockdev --getss "$LOOP1" +blockdev --getpbsz "$LOOP1" +blockdev --getss "$LOOP2" +blockdev --getpbsz "$LOOP2" +blockdev --getss "$LOOP3" +blockdev --getpbsz "$LOOP3" +blockdev --getss "$LOOP4" +blockdev --getpbsz "$LOOP4" # lvcreate on dev512, result 512 lvcreate --type raid1 -m1 --raidintegrity y -l 8 -n $lv1 $vg1 -pvck --dump metadata $LOOP1 | grep 'block_size = 512' +pvck --dump metadata "$LOOP1" | grep 'block_size = 512' lvremove -y $vg1/$lv1 # lvcreate on dev4k, result 4k lvcreate --type raid1 -m1 --raidintegrity y -l 8 -n $lv1 $vg2 -pvck --dump metadata $LOOP3 | grep 'block_size = 4096' +pvck --dump metadata "$LOOP3" | grep 'block_size = 4096' lvremove -y $vg2/$lv1 # lvcreate --bs 512 on dev4k, result fail @@ -110,7 +104,7 @@ # lvcreate --bs 4096 on dev512, result 4k lvcreate --type raid1 -m1 --raidintegrity y --raidintegrityblocksize 4096 -l 8 -n $lv1 $vg1 lvs -o raidintegrityblocksize $vg1/$lv1 | grep 4096 -pvck --dump metadata $LOOP1 | grep 'block_size = 4096' +pvck --dump metadata "$LOOP1" | grep 'block_size = 4096' lvremove -y $vg1/$lv1 # Test an unknown fs block size by simply not creating a fs on the lv. @@ -118,15 +112,15 @@ # lvconvert on dev512, fsunknown, result 512 lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1 # clear any residual fs so that libblkid cannot find an fs block size -aux wipefs_a /dev/$vg1/$lv1 +aux wipefs_a "$DM_DEV_DIR/$vg1/$lv1" lvconvert --raidintegrity y $vg1/$lv1 -pvck --dump metadata $LOOP1 | grep 'block_size = 512' +pvck --dump metadata "$LOOP1" | grep 'block_size = 512' lvremove -y $vg1/$lv1 # lvconvert on dev4k, fsunknown, result 4k lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2 # clear any residual fs so that libblkid cannot find an fs block size -aux wipefs_a /dev/$vg2/$lv1 +aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1" lvconvert --raidintegrity y $vg2/$lv1 pvck --dump metadata $LOOP3 | grep 'block_size = 4096' lvremove -y $vg2/$lv1 @@ -134,33 +128,34 @@ # lvconvert --bs 4k on dev512, fsunknown, result fail lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1 # clear any residual fs so that libblkid cannot find an fs block size -aux wipefs_a /dev/$vg1/$lv1 +aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1" not lvconvert --raidintegrity y --raidintegrityblocksize 4096 $vg1/$lv1 lvremove -y $vg1/$lv1 # lvconvert --bs 512 on dev4k, fsunknown, result fail lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2 # clear any residual fs so that libblkid cannot find an fs block size -aux wipefs_a /dev/$vg2/$lv1 +aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1" not lvconvert --raidintegrity y --raidintegrityblocksize 512 $vg2/$lv1 lvremove -y $vg2/$lv1 -# lvconvert on dev512, xfs 512, result 512 +# lvconvert on dev512, ext4 1024, result 1024 lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1 -aux wipefs_a /dev/$vg1/$lv1 -mkfs.xfs -f "$DM_DEV_DIR/$vg1/$lv1" -blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"512\" +aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1" +mkfs.ext4 "$DM_DEV_DIR/$vg1/$lv1" +blkid -p "$DM_DEV_DIR/$vg1/$lv1" | tee out +grep BLOCK_SIZE=\"1024\" out lvconvert --raidintegrity y $vg1/$lv1 -blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"512\" +blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\" mount "$DM_DEV_DIR/$vg1/$lv1" $mnt umount $mnt -pvck --dump metadata $LOOP1 | grep 'block_size = 512' +pvck --dump metadata "$LOOP1" | grep 'block_size = 512' lvremove -y $vg1/$lv1 -# lvconvert on dev4k, xfs 4096, result 4096 +# lvconvert on dev4k, ext4 4096, result 4096 lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2 -aux wipefs_a /dev/$vg2/$lv1 -mkfs.xfs -f "$DM_DEV_DIR/$vg2/$lv1" +aux wipefs_a "$DM_DEV_DIR/$vg2/$lv1" +mkfs.ext4 "$DM_DEV_DIR/$vg2/$lv1" blkid -p "$DM_DEV_DIR/$vg2/$lv1" | grep BLOCK_SIZE=\"4096\" lvconvert --raidintegrity y $vg2/$lv1 blkid -p "$DM_DEV_DIR/$vg2/$lv1" | grep BLOCK_SIZE=\"4096\" @@ -171,19 +166,19 @@ # lvconvert on dev512, ext4 1024, result 1024 (LV active when adding) lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1 -aux wipefs_a /dev/$vg1/$lv1 +aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1" mkfs.ext4 -b 1024 "$DM_DEV_DIR/$vg1/$lv1" blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\" lvconvert --raidintegrity y $vg1/$lv1 blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\" mount "$DM_DEV_DIR/$vg1/$lv1" $mnt umount $mnt -pvck --dump metadata $LOOP1 | grep 'block_size = 512' +pvck --dump metadata "$LOOP1" | grep 'block_size = 512' lvremove -y $vg1/$lv1 # lvconvert on dev512, ext4 1024, result 1024 (LV inactive when adding) lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1 -aux wipefs_a /dev/$vg1/$lv1 +aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1" mkfs.ext4 -b 1024 "$DM_DEV_DIR/$vg1/$lv1" blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\" lvchange -an $vg1/$lv1 @@ -192,38 +187,38 @@ blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"1024\" mount "$DM_DEV_DIR/$vg1/$lv1" $mnt umount $mnt -pvck --dump metadata $LOOP1 | grep 'block_size = 1024' +pvck --dump metadata "$LOOP1" | grep 'block_size = 1024' lvremove -y $vg1/$lv1 # lvconvert on dev4k, ext4 4096, result 4096 lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg2 -aux wipefs_a /dev/$vg2/$lv1 +aux wipefs_a "$DM_DEV_DIR//$vg2/$lv1" mkfs.ext4 "$DM_DEV_DIR/$vg2/$lv1" blkid -p "$DM_DEV_DIR/$vg2/$lv1" | grep BLOCK_SIZE=\"4096\" lvconvert --raidintegrity y $vg2/$lv1 blkid -p "$DM_DEV_DIR/$vg2/$lv1" | grep BLOCK_SIZE=\"4096\" mount "$DM_DEV_DIR/$vg2/$lv1" $mnt umount $mnt -pvck --dump metadata $LOOP3 | grep 'block_size = 4096' +pvck --dump metadata "$LOOP3" | grep 'block_size = 4096' lvremove -y $vg2/$lv1 -# lvconvert --bs 512 on dev512, xfs 4096, result 512 +# lvconvert --bs 512 on dev512, ext4 4096, result 512 lvcreate --type raid1 -m1 -l 8 -n $lv1 $vg1 -aux wipefs_a /dev/$vg1/$lv1 -mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg1/$lv1" +aux wipefs_a "$DM_DEV_DIR//$vg1/$lv1" +mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg1/$lv1" blkid -p "$DM_DEV_DIR/$vg1/$lv1" | grep BLOCK_SIZE=\"4096\"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-caching.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-caching.sh
Changed
@@ -14,8 +14,8 @@ . lib/inittest -which mkfs.xfs || skip -which xfs_growfs || skip +which mkfs.ext4 || skip +which resize2fs || skip aux have_integrity 1 5 0 || skip # Avoid 4K ramdisk devices on older kernels aux kernel_at_least 5 10 || export LVM_TEST_PREFER_BRD=0 @@ -23,12 +23,12 @@ mnt="mnt" mkdir -p $mnt -aux prepare_devs 6 80 +aux prepare_devs 9 80 # Use awk instead of anoyingly long log out from printf #printf "%0.sA" {1..16384} >> fileA awk 'BEGIN { while (z++ < 16384) printf "A" }' > fileA -awk 'BEGIN { while (z++ < 16384) printf "B" }' > fileB +awk 'BEGIN { while (z++ < 4096) printf "B" ; while (z++ < 16384) printf "b" }' > fileB awk 'BEGIN { while (z++ < 16384) printf "C" }' > fileC # generate random data @@ -39,17 +39,13 @@ _prepare_vg() { # zero devs so we are sure to find the correct file data # on the underlying devs when corrupting it - dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev4" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev5" bs=1M oflag=direct || true + aux clear_devs "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" "$dev6" pvs } _test_fs_with_read_repair() { - mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt @@ -82,18 +78,11 @@ umount $mnt lvchange -an $vg/$lv1 - for dev in "$@"; do - xxd "$dev" > dev.txt - # corrupt fileB - sed -e 's/4242 4242 4242 4242 4242 4242 4242 4242/4242 4242 4242 4242 4242 4242 4242 4243/' dev.txt > dev.bad - rm -f dev.txt - xxd -r dev.bad > "$dev" - rm -f dev.bad + aux corrupt_dev "$dev" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB done lvchange -ay $vg/$lv1 - mount "$DM_DEV_DIR/$vg/$lv1" $mnt cmp -b $mnt/fileA fileA @@ -103,7 +92,7 @@ } _add_new_data_to_mnt() { - mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt @@ -156,38 +145,6 @@ lvchange -an $vg/$lv1 } -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually -# if test -z "$sync"; then -# echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" -# dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" -# exit -# fi - echo "timeout waiting for recalc" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - return 1 -} - # lv1 is a raid+integrity LV # three variations of caching on lv1: # @@ -219,9 +176,9 @@ lvcreate --type $create_type -n fast -l 4 -an $vg "$dev6" lvconvert -y --type $convert_type $convert_option fast $vg/$lv1 lvs -a -o name,size,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_${suffix}_rimage_0 -_wait_recalc $vg/${lv1}_${suffix}_rimage_1 -_wait_recalc $vg/${lv1}_${suffix} +aux wait_recalc $vg/${lv1}_${suffix}_rimage_0 +aux wait_recalc $vg/${lv1}_${suffix}_rimage_1 +aux wait_recalc $vg/${lv1}_${suffix} _test_fs_with_read_repair "$dev1" lvs -o integritymismatches $vg/${lv1}_${suffix}_rimage_0 |tee mismatch not grep ' 0 ' mismatch @@ -238,10 +195,10 @@ lvcreate --type $create_type -n fast -l 4 -an $vg "$dev6" lvconvert -y --type $convert_type $convert_option fast $vg/$lv1 lvs -a -o name,size,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_${suffix}_rimage_0 -_wait_recalc $vg/${lv1}_${suffix}_rimage_1 -_wait_recalc $vg/${lv1}_${suffix}_rimage_2 -_wait_recalc $vg/${lv1}_${suffix} +aux wait_recalc $vg/${lv1}_${suffix}_rimage_0 +aux wait_recalc $vg/${lv1}_${suffix}_rimage_1 +aux wait_recalc $vg/${lv1}_${suffix}_rimage_2 +aux wait_recalc $vg/${lv1}_${suffix} _test_fs_with_read_repair "$dev1" "$dev2" lvs -o integritymismatches $vg/${lv1}_${suffix}_rimage_0 |tee mismatch not grep ' 0 ' mismatch @@ -254,14 +211,14 @@ vgremove -ff $vg _prepare_vg -lvcreate --type raid5 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" "$dev3" +lvcreate --type raid5 --raidintegrity y -n $lv1 -I4 -l 8 $vg "$dev1" "$dev2" "$dev3" lvcreate --type $create_type -n fast -l 4 -an $vg "$dev6" lvconvert -y --type $convert_type $convert_option fast $vg/$lv1 lvs -a -o name,size,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_${suffix}_rimage_0 -_wait_recalc $vg/${lv1}_${suffix}_rimage_1 -_wait_recalc $vg/${lv1}_${suffix}_rimage_2 -_wait_recalc $vg/${lv1}_${suffix} +aux wait_recalc $vg/${lv1}_${suffix}_rimage_0 +aux wait_recalc $vg/${lv1}_${suffix}_rimage_1 +aux wait_recalc $vg/${lv1}_${suffix}_rimage_2 +aux wait_recalc $vg/${lv1}_${suffix} _test_fs_with_read_repair "$dev1" "$dev2" "$dev3" lvs -o integritymismatches $vg/${lv1}_${suffix}_rimage_0 lvs -o integritymismatches $vg/${lv1}_${suffix}_rimage_1 @@ -281,9 +238,9 @@ lvcreate --type $create_type -n fast -l 4 -an $vg "$dev6" lvconvert -y --type $convert_type $convert_option fast $vg/$lv1 lvs -a -o name,size,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_${suffix}_rimage_0 -_wait_recalc $vg/${lv1}_${suffix}_rimage_1 -_wait_recalc $vg/${lv1}_${suffix} +aux wait_recalc $vg/${lv1}_${suffix}_rimage_0 +aux wait_recalc $vg/${lv1}_${suffix}_rimage_1 +aux wait_recalc $vg/${lv1}_${suffix} _add_new_data_to_mnt lvconvert --raidintegrity n $vg/${lv1}_${suffix} _add_more_data_to_mnt @@ -299,15 +256,15 @@ _prepare_vg lvcreate --type raid1 -m1 -n $lv1 -l 8 $vg -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/$lv1 lvcreate --type $create_type -n fast -l 4 -an $vg "$dev6" lvconvert -y --type $convert_type $convert_option fast $vg/$lv1 lvs -a -o name,size,segtype,devices,sync_percent $vg _add_new_data_to_mnt # Can only be enabled while raid is top level lv (for now.) not lvconvert --raidintegrity y $vg/${lv1}_${suffix} -#_wait_recalc $vg/${lv1}_${suffix}_rimage_0 -#_wait_recalc $vg/${lv1}_${suffix}_rimage_1 +#aux wait_recalc $vg/${lv1}_${suffix}_rimage_0 +#aux wait_recalc $vg/${lv1}_${suffix}_rimage_1 _add_more_data_to_mnt _verify_data_on_mnt umount $mnt @@ -319,22 +276,26 @@ # Test lvextend while inactive _prepare_vg -lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg -_wait_recalc $vg/${lv1}_rimage_0
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-dmeventd.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-dmeventd.sh
Changed
@@ -94,37 +94,6 @@ lvchange -an $vg/$lv1 } -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually - if test -z "$sync"; then - echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - exit - fi - echo "timeout waiting for recalc" - return 1 -} - aux lvmconf \ 'activation/raid_fault_policy = "allocate"' @@ -136,9 +105,9 @@ lvcreate --type raid1 -m 2 --raidintegrity y --ignoremonitoring -l 8 -n $lv1 $vg "$dev1" "$dev2" "$dev3" lvchange --monitor y $vg/$lv1 lvs -a -o+devices $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 aux wait_for_sync $vg $lv1 _add_new_data_to_mnt @@ -176,14 +145,13 @@ lvcreate --type raid1 -m 2 --raidintegrity y --ignoremonitoring -l 8 -n $lv1 $vg "$dev1" "$dev2" "$dev3" lvchange --monitor y $vg/$lv1 lvs -a -o+devices $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 aux wait_for_sync $vg $lv1 _add_new_data_to_mnt -aux disable_dev "$dev2" -aux disable_dev "$dev1" +aux disable_dev "$dev1" "$dev2" # wait for dmeventd to call lvconvert --repair which should # replace dev1 and dev2 with dev4 and dev5 @@ -200,8 +168,7 @@ _add_more_data_to_mnt _verify_data_on_mnt -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" lvs -a -o+devices $vg | tee out not grep "$dev1" out @@ -222,11 +189,11 @@ lvcreate --type raid6 --raidintegrity y --ignoremonitoring -l 8 -n $lv1 $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" lvchange --monitor y $vg/$lv1 lvs -a -o+devices $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/${lv1}_rimage_3 -_wait_recalc $vg/${lv1}_rimage_4 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/${lv1}_rimage_3 +aux wait_recalc $vg/${lv1}_rimage_4 aux wait_for_sync $vg $lv1 _add_new_data_to_mnt @@ -262,10 +229,10 @@ lvcreate --type raid10 --raidintegrity y --ignoremonitoring -l 8 -n $lv1 $vg "$dev1" "$dev2" "$dev3" "$dev4" lvchange --monitor y $vg/$lv1 lvs -a -o+devices $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/${lv1}_rimage_3 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/${lv1}_rimage_3 aux wait_for_sync $vg $lv1 _add_new_data_to_mnt
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-large.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-large.sh
Changed
@@ -92,42 +92,11 @@ umount $mnt } -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 20) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually - if test -z "$sync"; then - echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - exit - fi - echo "timeout waiting for recalc" - return 1 -} - # lvextend to 512MB is needed for the imeta LV to # be extended from 4MB to 8MB. _prepare_vg -lvcreate --type raid1 -m1 -n $lv1 -l 8 $vg +lvcreate --type raid1 -m1 -n $lv1 -L 300 $vg lvchange -an $vg/$lv1 lvchange -ay $vg/$lv1 _add_data_to_lv @@ -135,8 +104,8 @@ lvchange -an $vg/$lv1 lvconvert --raidintegrity y $vg/$lv1 lvchange -ay $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg _verify_data_on_lv lvchange -an $vg/$lv1 @@ -144,8 +113,8 @@ lvs -a -o+devices $vg lvchange -ay $vg/$lv1 _verify_data_on_lv -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg check lv_field $vg/${lv1}_rimage_0_imeta size "12.00m" check lv_field $vg/${lv1}_rimage_1_imeta size "12.00m" @@ -166,8 +135,8 @@ # adding integrity again will allocate new 12MB imeta LVs # on dev3,dev4 lvconvert --raidintegrity y $vg/$lv1 -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 lvs -a -o+devices $vg check lv_field $vg/${lv1}_rimage_0_imeta size "20.00m" check lv_field $vg/${lv1}_rimage_1_imeta size "20.00m"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-misc.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-misc.sh
Changed
@@ -14,7 +14,7 @@ . lib/inittest -which mkfs.xfs || skip +which mkfs.ext4 || skip aux have_integrity 1 5 0 || skip # Avoid 4K ramdisk devices on older kernels aux kernel_at_least 5 10 || export LVM_TEST_PREFER_BRD=0 @@ -41,7 +41,7 @@ } _add_new_data_to_mnt() { - mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt @@ -94,43 +94,12 @@ lvchange -an $vg/$lv1 } -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_sync() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually - if test -z "$sync"; then - echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - exit - fi - echo "timeout waiting for recalc" - return 1 -} - # lvrename _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg -_wait_sync $vg/${lv1}_rimage_0 -_wait_sync $vg/${lv1}_rimage_1 -_wait_sync $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 _add_new_data_to_mnt umount $mnt lvrename $vg/$lv1 $vg/$lv2 @@ -146,9 +115,9 @@ # lv must be active _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" -_wait_sync $vg/${lv1}_rimage_0 -_wait_sync $vg/${lv1}_rimage_1 -_wait_sync $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 lvs -o raidintegritymode $vg/$lv1 | grep journal _add_new_data_to_mnt lvconvert --replace "$dev1" $vg/$lv1 "$dev3" @@ -169,9 +138,9 @@ # same as prev but with bitmap mode _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y --raidintegritymode bitmap -n $lv1 -l 8 $vg "$dev1" "$dev2" -_wait_sync $vg/${lv1}_rimage_0 -_wait_sync $vg/${lv1}_rimage_1 -_wait_sync $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 lvs -o raidintegritymode $vg/$lv1 | grep bitmap _add_new_data_to_mnt lvconvert --replace "$dev1" $vg/$lv1 "$dev3" @@ -194,9 +163,9 @@ # (like lvconvert --replace does for a dev that's not missing). _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" -_wait_sync $vg/${lv1}_rimage_0 -_wait_sync $vg/${lv1}_rimage_1 -_wait_sync $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 _add_new_data_to_mnt aux disable_dev "$dev2" lvs -a -o+devices $vg > out @@ -223,9 +192,9 @@ _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" -_wait_sync $vg/${lv1}_rimage_0 -_wait_sync $vg/${lv1}_rimage_1 -_wait_sync $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 _add_new_data_to_mnt umount $mnt lvchange -an $vg/$lv1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity-syncaction.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity-syncaction.sh
Changed
@@ -14,8 +14,7 @@ . lib/inittest -which mkfs.xfs || skip -which xfs_growfs || skip +which mkfs.ext4 || skip aux have_integrity 1 5 0 || skip # Avoid 4K ramdisk devices on older kernels aux kernel_at_least 5 10 || export LVM_TEST_PREFER_BRD=0 @@ -28,30 +27,22 @@ # Use awk instead of anoyingly long log out from printf #printf "%0.sA" {1..16384} >> fileA awk 'BEGIN { while (z++ < 16384) printf "A" }' > fileA -awk 'BEGIN { while (z++ < 16384) printf "B" }' > fileB +awk 'BEGIN { while (z++ < 4096) printf "B" ; while (z++ < 16384) printf "b" }' > fileB awk 'BEGIN { while (z++ < 16384) printf "C" }' > fileC _prepare_vg() { # zero devs so we are sure to find the correct file data # on the underlying devs when corrupting it - dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true + aux clear_devs "$dev1" "$dev2" "$dev3" vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" pvs } _test1() { - mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt - # we don't want fileA to be located too early in the fs, - # otherwise activating the LV will trigger the corruption - # to be found and corrected, leaving nothing for syncaction - # to find and correct. - dd if=/dev/urandom of=$mnt/rand16M bs=1M count=16 - cp fileA $mnt cp fileB $mnt cp fileC $mnt @@ -59,24 +50,31 @@ umount $mnt lvchange -an $vg/$lv1 - xxd "$dev1" > dev1.txt - # corrupt fileB - sed -e 's/4242 4242 4242 4242 4242 4242 4242 4242/4242 4242 4242 4242 4242 4242 4242 4243/' dev1.txt > dev1.bad - rm -f dev1.txt - xxd -r dev1.bad > "$dev1" - rm -f dev1.bad + # Corrupting raid1 is simple - 1 leg needs to be modifed + # For raid5 corrupted block can be places on any of its leg. + for i in "$@" ; do + aux corrupt_dev "$i" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB |& tee out + grep -q "copied" out && break # leg found and corrupted + done lvchange -ay $vg/$lv1 - lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch - grep 0 mismatch + # so without synchecking the array - integrity doesn't know yet about failure + check lv_field $vg/${lv1}_rimage_0 integritymismatches "0" + check lv_field $vg/${lv1}_rimage_1 integritymismatches "0" + $# -gt 2 && check lv_field $vg/${lv1}_rimage_2 integritymismatches "0" lvchange --syncaction check $vg/$lv1 - _wait_recalc $vg/$lv1 + aux wait_recalc $vg/$lv1 - lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch - not grep 0 mismatch + # after synaction check - integrity should recognize faulty devices + baddev=0 + for i in 0 1 2 ; do + "$i" -gt 1 && $# -lt 3 && continue # only raid5 has rimage_2 + "$(get lv_field $vg/${lv1}_rimage_${i} integritymismatches)" = "0" || baddev=$(( baddev + 1 )) + done + "$baddev" -eq 1 || die "Unexpected number of integritymismatched devices ($baddev)!" mount "$DM_DEV_DIR/$vg/$lv1" $mnt cmp -b $mnt/fileA fileA @@ -86,16 +84,10 @@ } _test2() { - mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt - # we don't want fileA to be located too early in the fs, - # otherwise activating the LV will trigger the corruption - # to be found and corrected, leaving nothing for syncaction - # to find and correct. - dd if=/dev/urandom of=$mnt/rand16M bs=1M count=16 - cp fileA $mnt cp fileB $mnt cp fileC $mnt @@ -104,35 +96,23 @@ lvchange -an $vg/$lv1 # corrupt fileB and fileC on dev1 - xxd "$dev1" > dev1.txt - sed -e 's/4242 4242 4242 4242 4242 4242 4242 4242/4242 4242 4242 4242 4242 4242 4242 4243/' dev1.txt > dev1.bad - sed -e 's/4343 4343 4343 4343 4343 4343 4343 4343/4444 4444 4444 4444 4444 4444 4444 4444/' dev1.txt > dev1.bad - rm -f dev1.txt - xxd -r dev1.bad > "$dev1" - rm -f dev1.bad + aux corrupt_dev "$dev1" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB + aux corrupt_dev "$dev1" CCCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDD # corrupt fileA on dev2 - xxd "$dev2" > dev2.txt - sed -e 's/4141 4141 4141 4141 4141 4141 4141 4141/4141 4141 4141 4141 4141 4141 4145 4141/' dev2.txt > dev2.bad - rm -f dev2.txt - xxd -r dev2.bad > "$dev2" - rm -f dev2.bad + aux corrupt_dev "$dev2" AAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAEAA lvchange -ay $vg/$lv1 - lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch - grep 0 mismatch - lvs -o integritymismatches $vg/${lv1}_rimage_1 |tee mismatch - grep 0 mismatch + check lv_field $vg/${lv1}_rimage_0 integritymismatches "0" + check lv_field $vg/${lv1}_rimage_1 integritymismatches "0" lvchange --syncaction check $vg/$lv1 - _wait_recalc $vg/$lv1 + aux wait_recalc $vg/$lv1 - lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch - not grep 0 mismatch - lvs -o integritymismatches $vg/${lv1}_rimage_1 |tee mismatch - not grep 0 mismatch + not check lv_field $vg/${lv1}_rimage_0 integritymismatches "0" + not check lv_field $vg/${lv1}_rimage_1 integritymismatches "0" mount "$DM_DEV_DIR/$vg/$lv1" $mnt cmp -b $mnt/fileA fileA @@ -141,45 +121,13 @@ umount $mnt } -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually - if test -z "$sync"; then - echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - exit - fi - echo "timeout waiting for recalc" - return 1 -} - _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 6 $vg "$dev1" "$dev2" -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/$lv1 -_test1 -lvs -o integritymismatches $vg/$lv1 |tee mismatch -not grep 0 mismatch +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 +_test1 "$dev1" +not check $vg/$lv1 integritymismatches "0" lvchange -an $vg/$lv1 lvconvert --raidintegrity n $vg/$lv1 lvremove $vg/$lv1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/integrity.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/integrity.sh
Changed
@@ -14,8 +14,8 @@ . lib/inittest -which mkfs.xfs || skip -which xfs_growfs || skip +which mkfs.ext4 || skip +which resize2fs || skip aux have_integrity 1 5 0 || skip # Avoid 4K ramdisk devices on older kernels aux kernel_at_least 5 10 || export LVM_TEST_PREFER_BRD=0 @@ -28,7 +28,7 @@ # Use awk instead of anoyingly long log out from printf #printf "%0.sA" {1..16384} >> fileA awk 'BEGIN { while (z++ < 16384) printf "A" }' > fileA -awk 'BEGIN { while (z++ < 16384) printf "B" }' > fileB +awk 'BEGIN { while (z++ < 4096) printf "B" ; while (z++ < 16384) printf "b" }' > fileB awk 'BEGIN { while (z++ < 16384) printf "C" }' > fileC # generate random data @@ -39,17 +39,13 @@ _prepare_vg() { # zero devs so we are sure to find the correct file data # on the underlying devs when corrupting it - dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev4" bs=1M oflag=direct || true - dd if=/dev/zero of="$dev5" bs=1M oflag=direct || true + aux clear_devs "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" pvs } _test_fs_with_read_repair() { - mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt @@ -64,12 +60,7 @@ lvchange -an $vg/$lv1 for dev in "$@"; do - xxd "$dev" > dev.txt - # corrupt fileB - sed -e 's/4242 4242 4242 4242 4242 4242 4242 4242/4242 4242 4242 4242 4242 4242 4242 4243/' dev.txt > dev.bad - rm -f dev.txt - xxd -r dev.bad > "$dev" - rm -f dev.bad + aux corrupt_dev "$dev" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB done lvchange -ay $vg/$lv1 @@ -82,7 +73,7 @@ } _add_new_data_to_mnt() { - mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lv1" + mkfs.ext4 -b 4096 "$DM_DEV_DIR/$vg/$lv1" mount "$DM_DEV_DIR/$vg/$lv1" $mnt @@ -135,47 +126,15 @@ lvchange -an $vg/$lv1 } -_sync_percent() { - local checklv=$1 - get lv_field "$checklv" sync_percent | cut -d. -f1 -} - -_wait_recalc() { - local checklv=$1 - - for i in $(seq 1 10) ; do - sync=$(_sync_percent "$checklv") - echo "sync_percent is $sync" - - if test "$sync" = "100"; then - return - fi - - sleep 1 - done - - # TODO: There is some strange bug, first leg of RAID with integrity - # enabled never gets in sync. I saw this in BB, but not when executing - # the commands manually -# if test -z "$sync"; then -# echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed" -# dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" -# exit -# fi - echo "timeout waiting for recalc" - dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}" - return 1 -} - # Test corrupting data on an image and verifying that # it is detected by integrity and corrected by raid. _prepare_vg lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" lvs -a -o name,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/$lv1 _test_fs_with_read_repair "$dev1" lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch not grep 0 mismatch @@ -189,10 +148,10 @@ _prepare_vg lvcreate --type raid1 -m2 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" "$dev3" lvs -a -o name,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/$lv1 _test_fs_with_read_repair "$dev1" "$dev2" lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch not grep 0 mismatch @@ -204,12 +163,12 @@ vgremove -ff $vg _prepare_vg -lvcreate --type raid4 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" "$dev3" +lvcreate --type raid4 --raidintegrity y -n $lv1 -I 4K -l 8 $vg "$dev1" "$dev2" "$dev3" lvs -a -o name,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/$lv1 _test_fs_with_read_repair "$dev1" "$dev2" "$dev3" lvs -o integritymismatches $vg/${lv1}_rimage_0 lvs -o integritymismatches $vg/${lv1}_rimage_1 @@ -222,12 +181,12 @@ vgremove -ff $vg _prepare_vg -lvcreate --type raid5 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" "$dev3" +lvcreate --type raid5 --raidintegrity y -n $lv1 -I 4K -l 8 $vg "$dev1" "$dev2" "$dev3" lvs -a -o name,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/$lv1 _test_fs_with_read_repair "$dev1" "$dev2" "$dev3" lvs -o integritymismatches $vg/${lv1}_rimage_0 lvs -o integritymismatches $vg/${lv1}_rimage_1 @@ -240,14 +199,14 @@ vgremove -ff $vg _prepare_vg -lvcreate --type raid6 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" +lvcreate --type raid6 --raidintegrity y -n $lv1 -I 4K -l 8 $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" lvs -a -o name,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/${lv1}_rimage_3 -_wait_recalc $vg/${lv1}_rimage_4 -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/${lv1}_rimage_3 +aux wait_recalc $vg/${lv1}_rimage_4 +aux wait_recalc $vg/$lv1 _test_fs_with_read_repair "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" lvs -o integritymismatches $vg/${lv1}_rimage_0 lvs -o integritymismatches $vg/${lv1}_rimage_1 @@ -264,11 +223,11 @@ _prepare_vg lvcreate --type raid10 --raidintegrity y -n $lv1 -l 8 $vg "$dev1" "$dev2" "$dev3" "$dev4" lvs -a -o name,segtype,devices,sync_percent $vg -_wait_recalc $vg/${lv1}_rimage_0 -_wait_recalc $vg/${lv1}_rimage_1 -_wait_recalc $vg/${lv1}_rimage_2 -_wait_recalc $vg/${lv1}_rimage_3 -_wait_recalc $vg/$lv1 +aux wait_recalc $vg/${lv1}_rimage_0 +aux wait_recalc $vg/${lv1}_rimage_1 +aux wait_recalc $vg/${lv1}_rimage_2 +aux wait_recalc $vg/${lv1}_rimage_3
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-cache-abort.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-cache-abort.sh
Changed
@@ -19,26 +19,25 @@ aux have_cache 1 3 0 || skip -aux prepare_vg 2 +aux prepare_vg -SIZE_MB=4 +SIZE_MB=200 -# Data device on later delayed dev1 -lvcreate -L4 -n cpool $vg "$dev1" -lvconvert -y --type cache-pool $vg/cpool "$dev2" -lvcreate -H -L $SIZE_MB -n $lv1 --chunksize 32k --cachemode writeback --cachepool $vg/cpool $vg "$dev2" +# Use large zero device and later delayed metadata dev1 +lvcreate -L$((SIZE_MB * 2))M --type zero -n cpool $vg +lvconvert -y --type cache-pool --chunksize 32k $vg/cpool "$dev1" +lvcreate -L$((SIZE_MB * 2))M --type zero -n $lv1 $vg +lvconvert -y -H --chunksize 32k --cachemode writeback --cachepool $vg/cpool $vg/$lv1 # # Ensure cache gets promoted blocks # -for i in $(seq 1 3) ; do -echo 3 >/proc/sys/vm/drop_caches -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=$SIZE_MB conv=fdatasync || true -echo 3 >/proc/sys/vm/drop_caches -dd if="$DM_DEV_DIR/$vg/$lv1" of=/dev/null bs=1M count=$SIZE_MB || true +for i in $(seq 1 2) ; do +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=$SIZE_MB oflag=direct || true +dd if="$DM_DEV_DIR/$vg/$lv1" of=/dev/null bs=1M count=$SIZE_MB iflag=direct || true done -aux delay_dev "$dev2" 0 300 "$(get first_extent_sector "$dev2"):" +aux delay_dev "$dev1" 0 200 "$(get first_extent_sector "$dev1"):" dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=$SIZE_MB lvdisplay --maps $vg @@ -53,20 +52,21 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -vvvv --splitcache $vg/$lv1 >logconvert 2>&1 & PID_CONVERT=$! for i in {1..50}; do - dmsetup table "$vg-$lv1" |& tee out - grep cleaner out && break + out=$(dmsetup status --noflush "$vg-$lv1") + case "$out" in + *cleaner*) break;; + esac echo "$i: Waiting for cleaner policy on $vg/$lv1" - sleep .05 + sleep .01 done test "$i" -ge 49 && die "Waited for cleaner policy on $vg/$lv1 too long!" -# While lvconvert updated table to 'cleaner' policy now it +# While lvconvert updated table to 'cleaner' policy now it # should be running in 'Flushing' loop and just 1 KILL should # cause abortion of flushing kill -INT $PID_CONVERT aux enable_dev "$dev2" wait - #cat logconvert || true # Problem of this test is, in older kernels, even the initial change to cleaner @@ -84,5 +84,6 @@ # check the table got restored check grep_dmsetup table $vg-$lv1 "writeback" +lvdisplay --maps $vg vgremove -f $vg
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-cache-thin.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-cache-thin.sh
Changed
@@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (C) 2014 Red Hat, Inc. All rights reserved. +# Copyright (C) 2014-2023 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions @@ -22,13 +22,15 @@ aux prepare_vg 5 80 +# +# Check caching of whole thin-pool +# lvcreate -L10 -n cpool $vg lvcreate -L10 -n tpool $vg lvcreate -L10 -n $lv1 $vg lvconvert --yes --cache --cachepool cpool $vg/tpool -# Currently the only allowed stacking is cache thin data volume lvconvert --yes --type thin-pool $vg/tpool lvcreate -V10 -T -n $lv2 $vg/tpool @@ -53,7 +55,38 @@ lvremove -f $vg + +# +# Check caching of single individual thin LV +# +lvcreate --type cache-pool -L10 -n cpool $vg +lvcreate -T -L10 -V10 -n $lv1 $vg/tpool + +lvconvert --yes -H --cachepool $vg/cpool $vg/$lv1 +check lv_field $vg/${lv1}_corig segtype "thin" -a +check lv_field $vg/$lv1 segtype "cache" + +# Other thins from the thin-pool can be created +lvcreate -V10 $vg/tpool + +# ATM there is no support to take snapshot of cache thin LV +not lvcreate -s $vg/$lv1 + +# Use can take thick snapshot +lvcreate -s -L10 -n $lv2 $vg/$lv1 +check lv_field $vg/$lv2 segtype "linear" + +lvchange -an $vg +lvchange -ay $vg + +lvconvert --uncache $vg/$lv1 + +lvremove -f $vg + + +# # Check conversion of cached LV works as thin-pool +# lvcreate -L10 -n $lv $vg lvcreate -L10 -n $lv1 $vg lvcreate -H -L10 $vg/$lv
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-cache.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-cache.sh
Changed
@@ -168,6 +168,19 @@ lvremove -f $vg +######################### +# Some testing variants # +######################### + +for i in error zero +do + lvcreate --type "$i" -L50G -n $lv1 $vg + lvcreate --type "$i" -L10G -n cpool $vg + lvconvert -y --cachepool $vg/cpool + lvconvert -y -H --cachepool $vg/cpool $vg/$lv1 + lvremove -f $vg +done + ########################## # Prohibited conversions # ##########################
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-raid-reshape-load.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-raid-reshape-load.sh
Changed
@@ -45,8 +45,8 @@ check lv_first_seg_field $vg/$lv1 segtype "raid5_ls" check lv_first_seg_field $vg/$lv1 data_stripes 13 check lv_first_seg_field $vg/$lv1 stripes 14 -wipefs -a /dev/$vg/$lv1 -mkfs -t ext4 /dev/$vg/$lv1 +wipefs -a "$DM_DEV_DIR/$vg/$lv1" +mkfs -t ext4 "$DM_DEV_DIR/$vg/$lv1" aux wait_for_sync $vg $lv1 mkdir -p $mount_dir
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
Changed
@@ -46,9 +46,9 @@ check lv_first_seg_field $vg/$lv1 stripesize "64.00k" check lv_first_seg_field $vg/$lv1 data_stripes 10 check lv_first_seg_field $vg/$lv1 stripes 11 -wipefs -a /dev/$vg/$lv1 -mkfs -t ext4 /dev/$vg/$lv1 -fsck -fn /dev/$vg/$lv1 +wipefs -a "$DM_DEV_DIR/$vg/$lv1" +mkfs -t ext4 "$DM_DEV_DIR/$vg/$lv1" +fsck -fn "$DM_DEV_DIR/$vg/$lv1" mkdir -p "$mount_dir" mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-raid-reshape-stripes-load.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-raid-reshape-stripes-load.sh
Changed
@@ -46,8 +46,8 @@ check lv_first_seg_field $vg/$lv1 stripesize "64.00k" check lv_first_seg_field $vg/$lv1 data_stripes 10 check lv_first_seg_field $vg/$lv1 stripes 11 -wipefs -a /dev/$vg/$lv1 -mkfs -t ext4 /dev/$vg/$lv1 +wipefs -a "$DM_DEV_DIR/$vg/$lv1" +mkfs -t ext4 "$DM_DEV_DIR//$vg/$lv1" mkdir -p $mount_dir mount "$DM_DEV_DIR/$vg/$lv1" $mount_dir
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-raid0_to_raid10.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-raid0_to_raid10.sh
Changed
@@ -20,11 +20,9 @@ aux have_raid 1 12 0 || skip # 8 PVs needed for RAID10 testing (4-stripes/2-mirror) -aux prepare_pvs 8 64 -get_devs -vgcreate $SHARED -s 256k "$vg" "${DEVICES@}" +aux prepare_vg 8 64 -lvcreate -y --ty raid0 -R32.00k -i 4 -n $lv1 -L 64M $vg +lvcreate -y --type raid0 -R32k -i 4 -n $lv1 -L 64M $vg lvcreate -y -i4 -l4 -n $lv2 $vg lvextend -y -l +4 $vg/$lv1 lvconvert -y -R512K --ty raid10 $vg/$lv1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-raid1-split-trackchanges.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-raid1-split-trackchanges.sh
Changed
@@ -20,9 +20,7 @@ aux have_raid 1 3 0 || skip # 8 PVs needed for RAID10 testing (4-stripes/2-mirror) -aux prepare_pvs 4 2 -get_devs -vgcreate $SHARED -s 512k "$vg" "${DEVICES@}" +aux prepare_vg 4 2 lvcreate -y --ty raid1 -m 2 -n $lv1 -l 1 $vg lvconvert -y --splitmirrors 1 --trackchanges $vg/$lv1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-raid10.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-raid10.sh
Changed
@@ -31,10 +31,7 @@ aux have_raid 1 3 1 || skip # 9 PVs needed for RAID10 testing (3-stripes/2-mirror - replacing 3 devs) -aux prepare_pvs 9 80 -get_devs - -vgcreate $SHARED -s 256k "$vg" "${DEVICES@}" +aux prepare_vg 9 80 lvcreate --type raid10 -m 1 -i 3 -l 3 -n $lv1 $vg aux wait_for_sync $vg $lv1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-repair-cache.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-repair-cache.sh
Changed
@@ -67,14 +67,14 @@ lvconvert --repair $vg/$lv1 lvs -a $vg -check lv_exists $vg ${lv1}_meta0 +check lv_exists $vg cpool_cpool_meta0 eval "$(lvs -S 'name=~_pmspare' -a --config 'report/mark_hidden_devices=0' -o name --noheading --nameprefixes $vg)" lvremove -f --yes "$vg/$LVM2_LV_NAME" # check --repair without creation of _pmspare device lvconvert --repair --poolmetadataspare n $vg/$lv1 -check lv_exists $vg ${lv1}_meta1 +check lv_exists $vg cpool_cpool_meta1 # check no _pmspare has been created in previous --repair test "0" = "$(lvs -S 'name=~_pmspare' -a -o name --noheading --nameprefixes $vg | wc -l)"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-repair-replace.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-repair-replace.sh
Changed
@@ -14,10 +14,10 @@ . lib/inittest -aux lvmconf "global/support_mirrored_mirror_log=1" - aux prepare_vg 6 -aux lvmconf 'allocation/maximise_cling = 0' \ + +aux lvmconf 'global/support_mirrored_mirror_log = 1' \ + 'allocation/maximise_cling = 0' \ 'allocation/mirror_logs_require_separate_pvs = 1' # 3-way, disk log
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-thin-external-cache.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-thin-external-cache.sh
Changed
@@ -51,7 +51,7 @@ lvchange --cachemode writethrough $vg/$lv1 # Check $lv1 remains mounted (so it's not been unmounted by systemd) -not mount "$DM_DEV_DIR/$vg/$lv1" mnt +mountpoint "$PWD/mnt" lvconvert --thin $vg/$lv1 --originname extorg --thinpool $vg/tpool
View file
_service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-thin-from-thick.sh
Added
@@ -0,0 +1,93 @@ +#!/usr/bin/env bash + +# Copyright (C) 2023 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# Test conversion to thin volume from thick LVs + +SKIP_WITH_LVMPOLLD=1 + +export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false} + +. lib/inittest + +which mkfs.ext4 || skip +which fsck || skip +aux have_tool_at_least "$LVM_TEST_THIN_RESTORE_CMD" 0 3 1 || skip +aux have_thin 1 5 0 || skip + +_convert_to_thin() { + mkfs.ext4 -E nodiscard "$DM_DEV_DIR/$vg/$lv1" + lvconvert --yes --type thin $vg/$lv1 + fsck -n "$DM_DEV_DIR/$vg/$lv1" + check lv_field $vg/$lv1 segtype thin + lvs -ao+segtype $vg + lvremove -f $vg +} + + +# +# Main +# +aux prepare_vg 2 6000 + +# error -> thin +lvcreate --type error -Zn -L10 -n $lv1 $vg +lvconvert --yes --type thin $vg/$lv1 +not dd if="$DM_DEV_DIR/$vg/$lv1" of=/dev/null bs=512 count=1 +lvremove -f $vg + +# zero -> thin +lvcreate --type zero -L2T -n $lv1 $vg +lvconvert --yes --type thin $vg/$lv1 +lvremove -f $vg + +# zero -> thin --test +if ! -e LOCAL_LVMLOCKD ; then +# FIXME: missing support with lvmlockd +lvcreate --type zero -L2T -n $lv1 $vg +lvconvert --yes --type thin --test $vg/$lv1 +check lv_field $vg/$lv1 segtype zero +check vg_field $vg lv_count 1 +lvremove -f $vg +fi + +# linear -> thin +lvcreate -L10 -n $lv1 $vg +_convert_to_thin + +# raid1 -> thin +if aux have_raid 1 7 0 ; then + lvcreate --type raid1 -L10 -n $lv1 $vg + _convert_to_thin +fi + +# cache -> thin +if aux have_cache 1 3 0 ; then + lvcreate -L10 -n $lv1 $vg + lvcreate -H -L10 $vg/$lv1 + _convert_to_thin +fi + +# writecache -> thin +if aux have_writecache 1 0 0 ; then + lvcreate -L10 -n $lv1 $vg + lvcreate -an -L10 -n $lv2 $vg + lvconvert --yes --type writecache --cachevol $lv2 $vg/$lv1 + _convert_to_thin +fi + +# vdo -> thin +if aux have_vdo 6 2 0 ; then + lvcreate --type vdo -L4G -n $lv1 $vg/$lv2 + _convert_to_thin +fi + +vgremove -ff $vg
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-thin.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-thin.sh
Changed
@@ -45,7 +45,7 @@ vgcreate $vg -s 64K "$dev4" "$DM_DEV_DIR/$vg1/$lv" lvcreate -L1T -n $lv1 $vg -invalid lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1 +lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1 # needs some --cachepool or --thinpool invalid lvconvert --yes --poolmetadatasize 1G $vg/$lv1
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-twostep.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-twostep.sh
Changed
@@ -10,7 +10,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - +SKIP_WITH_LVMPOLLD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvconvert-vdo-raid.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvconvert-vdo-raid.sh
Changed
@@ -46,8 +46,7 @@ lvremove -f $vg -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" lvcreate --type raid1 -L4G --nosync -n vpool1 $vg
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvcreate-mirror.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvcreate-mirror.sh
Changed
@@ -26,7 +26,7 @@ # 2-way mirror with disklog, 3 PVs # lvcreate --nosync is in 100% sync after creation (bz429342) lvcreate -aey -l2 --type mirror -m1 --nosync -n $lv2 $vg "$dev1" "$dev2" "$dev3":0-1 2>&1 | tee out -grep "New mirror won't be synchronised." out +grep "New mirror won't be synchronized." out check lv_field $vg/$lv2 copy_percent "100.00" check mirror_images_redundant $vg $lv2 check mirror_log_on $vg $lv2 "$dev3"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvcreate-thin-snap.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvcreate-thin-snap.sh
Changed
@@ -74,5 +74,25 @@ mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" lvcreate -K -s $vg/$lv1 --name snap fsck -n "$DM_DEV_DIR/$vg/snap" +vgchange -an $vg +lvremove -y $vg + +# One thin pool and one thin LV +lvcreate --type thin-pool -L 10M -n tp $vg +lvcreate --type thin -n thin1 -V 20M --thinpool tp $vg +# Different syntaxes for creating a thin snapshot +lvcreate --type thin -n snap1 $vg/thin1 +lvcreate --type thin --snapshot -n snap2 $vg/thin1 +lvcreate --type thin --thin -n snap3 $vg/thin1 +lvcreate --type thin --snapshot --thin -n snap4 $vg/thin1 +lvcreate --snapshot -n snap5 $vg/thin1 +lvcreate --thin -n snap6 $vg/thin1 +# The command defs allow --snapshot --thin, but the internal +# lvcreate option checks disallow it. It doesn't seem to make +# sense to disallow this from a syntax point of view, but it's +# possible that the lvcreate implementation would do the wrong +# thing (that should probably be fixed.) +not lvcreate --thin --snapshot -n snap7 $vg/thin1 +vgchange -an $vg vgremove -ff $vg
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvextend-caches.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvextend-caches.sh
Changed
@@ -17,7 +17,7 @@ . lib/inittest case "$(uname -r)" in -6.2*) skip "Skippen test that kills this kernel" ;; +6.0123*|5.19*) skip "Skippen test that kills this kernel" ;; esac do_test()
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvextend-raid.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvextend-raid.sh
Changed
@@ -80,8 +80,7 @@ check lv_field $vg/$lv1 sync_percent "100.00" fi -aux enable_dev "$dev1" -aux enable_dev "$dev2" +aux enable_dev "$dev1" "$dev2" aux wait_for_sync $vg $lv1 check lv_field $vg/$lv1 sync_percent "100.00"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvextend-snapshot-dmeventd.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvextend-snapshot-dmeventd.sh
Changed
@@ -19,7 +19,7 @@ } write_() { - dd if=/dev/zero of="$DM_DEV_DIR/$vg/snap" bs=1k count=$2 seek=$1 oflag=direct + dd if=/dev/zero of="$DM_DEV_DIR/$vg/snap" bs=1k count=$2 seek=$1 conv=fdatasync } percent_() {
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvextend-thin-full.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvextend-thin-full.sh
Changed
@@ -14,7 +14,6 @@ # play with thin-pool resize in corner cases # -SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false} @@ -34,9 +33,10 @@ 'activation/thin_pool_autoextend_threshold = 70' aux prepare_thin_metadata 400 0 | tee data -lvcreate -L200 -T $vg/pool +lvcreate -L200 -V10 -n $lv2 -T $vg/pool lvchange -an $vg +# Prepare full metadata volume lvcreate -L2M -n $lv1 $vg "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1 @@ -44,7 +44,7 @@ # active thin pool is needed to use policy not lvextend --use-policies $vg/pool 2>&1 | tee err -lvchange -ay $vg +lvchange -ay $vg/$lv2 # Cannot resize if set to 0% not lvextend --use-policies --config 'activation{thin_pool_autoextend_percent = 0}' $vg/pool 2>&1 | tee err
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvextend-thin-metadata-dmeventd.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvextend-thin-metadata-dmeventd.sh
Changed
@@ -48,7 +48,7 @@ for i in $(seq 10 $1) do echo ' <device dev_id="'$i'" mapped_blocks="30" transaction="0" creation_time="0" snap_time="0">' - echo ' <range_mapping origin_begin="0" data_begin="0" length="29" time="0"/>' + echo ' <range_mapping origin_begin="0" data_begin="0" length="30" time="0"/>' echo ' </device>' set +x done @@ -98,6 +98,10 @@ test -z "$BIG_DATA" || DATA=7400 fake_metadata_ "$DATA" 2 >data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2" + +# Check tha restored metadata are OK for thin_check +"$LVM_TEST_THIN_CHECK_CMD" "$DM_DEV_DIR/mapper/$vg-$lv2" + # Swap volume with restored fake metadata lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2 lvchange -ay $vg/pool
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvm-on-md.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvm-on-md.sh
Changed
@@ -160,9 +160,7 @@ vgremove -f $vg aux cleanup_md_dev -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" -aux udev_wait +aux wipefs_a "$dev1" "$dev2" done
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvresize-fs-crypt.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvresize-fs-crypt.sh
Changed
@@ -23,8 +23,7 @@ lvcreate -n $lv1 -L 300 $vg mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1" blkid -p "$DM_DEV_DIR/$vg/$lv1" | grep FSLASTBLOCK || skip -lvchange -an $vg -lvremove $vg/$lv1 +lvremove -f $vg/$lv1 mount_dir="mnt_lvresize_cr" mkdir -p "$mount_dir" @@ -38,7 +37,7 @@ echo 93R4P4pIqAH8 | cryptsetup luksOpen "$DM_DEV_DIR/$vg/$lv" $cr mkfs.ext4 /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct df --output=size "$mount_dir" |tee df1 lvextend -L+200M --fs resize $vg/$lv check lv_field $vg/$lv lv_size "456.00m" @@ -46,8 +45,7 @@ not diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # lvreduce ext4 on LUKS1 lvcreate -n $lv -L 456M $vg @@ -55,7 +53,7 @@ echo 93R4P4pIqAH8 | cryptsetup luksOpen "$DM_DEV_DIR/$vg/$lv" $cr mkfs.ext4 /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct df --output=size "$mount_dir" |tee df1 lvresize -L-100M --yes --fs resize $vg/$lv check lv_field $vg/$lv lv_size "356.00m" @@ -63,25 +61,23 @@ not diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # lvextend xfs on LUKS1 -lvcreate -n $lv -L 256M $vg +lvcreate -n $lv -L 320M $vg echo 93R4P4pIqAH8 | cryptsetup luksFormat -i1 --type luks1 "$DM_DEV_DIR/$vg/$lv" echo 93R4P4pIqAH8 | cryptsetup luksOpen "$DM_DEV_DIR/$vg/$lv" $cr mkfs.xfs /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct df --output=size "$mount_dir" |tee df1 -lvextend -L+200M --fs resize $vg/$lv +lvextend -L+136M --fs resize $vg/$lv check lv_field $vg/$lv lv_size "456.00m" df --output=size "$mount_dir" |tee df2 not diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # lvreduce xfs on LUKS1 lvcreate -n $lv -L 456M $vg @@ -89,7 +85,7 @@ echo 93R4P4pIqAH8 | cryptsetup luksOpen "$DM_DEV_DIR/$vg/$lv" $cr mkfs.xfs /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct df --output=size "$mount_dir" |tee df1 # xfs cannot be reduced not lvresize -L-100M --yes --fs resize $vg/$lv @@ -98,15 +94,14 @@ diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # lvextend ext4 on plain crypt (no header) lvcreate -n $lv -L 256M $vg echo 93R4P4pIqAH8 | cryptsetup create $cr "$DM_DEV_DIR/$vg/$lv" mkfs.ext4 /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct df --output=size "$mount_dir" |tee df1 # fails when no fs is found for --fs resize not lvextend -L+200M --yes --fs resize $vg/$lv @@ -115,15 +110,14 @@ diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # lvreduce ext4 on plain crypt (no header) lvcreate -n $lv -L 456M $vg echo 93R4P4pIqAH8 | cryptsetup create $cr "$DM_DEV_DIR/$vg/$lv" mkfs.ext4 /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct df --output=size "$mount_dir" |tee df1 # fails when no fs is found for --fs resize not lvresize -L-100M --yes --fs resize $vg/$lv @@ -132,8 +126,7 @@ diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # lvresize uses helper only for crypt dev resize # because the fs was resized separately beforehand @@ -142,10 +135,11 @@ echo 93R4P4pIqAH8 | cryptsetup luksOpen "$DM_DEV_DIR/$vg/$lv" $cr mkfs.ext4 /dev/mapper/$cr mount /dev/mapper/$cr "$mount_dir" -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=100 conv=fdatasync +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=10 oflag=direct df --output=size "$mount_dir" |tee df1 # resize only the fs (to 256M), not the crypt dev or LV umount "$mount_dir" +fsck -n /dev/mapper/$cr resize2fs /dev/mapper/$cr 262144k mount /dev/mapper/$cr "$mount_dir" # this lvresize will not resize the fs (which is already reduced @@ -162,8 +156,7 @@ not diff df1 df2 umount "$mount_dir" cryptsetup close $cr -lvchange -an $vg/$lv -lvremove $vg/$lv +lvremove -f $vg/$lv # test with LUKS2?
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvresize-fs.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvresize-fs.sh
Changed
@@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (C) 2007-2016 Red Hat, Inc. All rights reserved. +# Copyright (C) 2007-2023 Red Hat, Inc. All rights reserved. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions @@ -15,17 +15,22 @@ . lib/inittest -aux prepare_vg 3 256 +aux prepare_vg 2 100 -which mkfs.xfs || skip +which mkfs.ext4 || skip +which resize2fs || skip -# Test combinations of the following: -# lvreduce / lvextend -# no fs / ext4 / xfs -# each --fs opt / no --fs opt / --resizefs -# active / inactive -# mounted / unmounted -# fs size less than, equal to or greater than reduced lv size +# +# Workaroudn for kernel bug fixed with: +# a408f33e895e455f16cf964cb5cd4979b658db7b +# refreshing DM device - using fsfreeze with suspend +# +workaround_() { + blkid -p "$DM_DEV_DIR/$vg/$lv" >/dev/null || { + dmsetup suspend $vg-$lv + dmsetup resume $vg-$lv + } +} mount_dir="mnt_lvresize_fs" mkdir -p "$mount_dir" @@ -33,690 +38,421 @@ mount_dir_space="other mnt dir" mkdir -p "$mount_dir_space" -# Tests require a libblkid version that shows FSLASTBLOCK -lvcreate -n $lv1 -L 300 $vg -mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1" -blkid -p "$DM_DEV_DIR/$vg/$lv1" | grep FSLASTBLOCK || skip -lvchange -an $vg -lvremove $vg/$lv1 +mount_dir_2="mnt_lvresize_fs_2" +mkdir -p "$mount_dir_2" + +# Test combinations of the following: +# lvreduce / lvextend +# no fs / ext4 +# each --fs opt / no --fs opt / --resizefs +# active / inactive +# mounted / unmounted +# fs size less than, equal to or greater than reduced lv size + +################### # # lvextend, no fs # +################### # lvextend, no fs, active, no --fs -lvcreate -n $lv -L 256M $vg -aux wipefs_a "$DM_DEV_DIR/$vg/$lv" -lvextend -L+200M $vg/$lv -check lv_field $vg/$lv lv_size "456.00m" -lvchange -an $vg/$lv -lvremove $vg/$lv - -# lvextend, no fs, inactive, no --fs -lvcreate -n $lv -L 256M $vg -aux wipefs_a "$DM_DEV_DIR/$vg/$lv" -lvchange -an $vg/$lv -lvextend -L+200M $vg/$lv -check lv_field $vg/$lv lv_size "456.00m" -lvremove $vg/$lv +lvcreate -n $lv -L 10M $vg +lvextend -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "30.00m" # lvextend, no fs, active, --fs resize fails with no fs found -lvcreate -n $lv -L 256M $vg -aux wipefs_a "$DM_DEV_DIR/$vg/$lv" -not lvextend -L+200M --fs resize $vg/$lv -check lv_field $vg/$lv lv_size "256.00m" +not lvextend -L+20M --fs resize $vg/$lv +check lv_field $vg/$lv lv_size "30.00m" + lvchange -an $vg/$lv -lvremove $vg/$lv # lvextend, no fs, inactive, --fs resize error requires active lv -lvcreate -n $lv -L 256M $vg -aux wipefs_a "$DM_DEV_DIR/$vg/$lv" +not lvextend -L+20M --fs resize $vg/$lv +check lv_field $vg/$lv lv_size "30.00m" + +# lvextend, no fs, inactive, no --fs +lvextend -L+30M $vg/$lv +check lv_field $vg/$lv lv_size "60.00m" + +lvremove -f $vg + + +################### +# +# lvreduce, no fs +# +################### + +# lvreduce, no fs, active, no --fs setting is same as --fs checksize +lvcreate -n $lv -L 50M $vg +lvreduce -L-10M $vg/$lv +check lv_field $vg/$lv lv_size "40.00m" lvchange -an $vg/$lv -not lvextend -L+200M --fs resize $vg/$lv -check lv_field $vg/$lv lv_size "256.00m" -lvremove $vg/$lv +# lvreduce, no fs, inactive, no --fs setting is same as --fs checksize +not lvreduce -L-10M $vg/$lv +lvreduce --fs checksize -L-10M $vg/$lv +check lv_field $vg/$lv lv_size "30.00m" + +# lvreduce, no fs, inactive, --fs ignore +lvreduce -L-10M --fs ignore $vg/$lv +check lv_field $vg/$lv lv_size "20.00m" + +# lvreduce, no fs, active, --fs resize requires fs to be found +lvchange -ay $vg/$lv +not lvreduce -L-10M --fs resize $vg/$lv +check lv_field $vg/$lv lv_size "20.00m" + +lvremove -f $vg/$lv + + +################# # # lvextend, ext4 # +################# -# lvextend, ext4, active, mounted, no --fs setting is same as --fs ignore -lvcreate -n $lv -L 256M $vg +# Use one instance of ext4 for series of lvextend tests: +lvcreate -n $lv -L 20M $vg mkfs.ext4 "$DM_DEV_DIR/$vg/$lv" mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir" + +# --fs tests require a libblkid version that shows FSLASTBLOCK +# so exit 0 test here, if the feature is not present +blkid -p "$DM_DEV_DIR/$vg/$lv" | grep FSLASTBLOCK || exit 0 + + +# lvextend, ext4, active, mounted, no --fs setting is same as --fs ignore df --output=size "$mount_dir" |tee df1 -dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=200 conv=fdatasync -lvextend -L+200M $vg/$lv -check lv_field $vg/$lv lv_size "456.00m" +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=8 oflag=direct +lvextend -L+10M $vg/$lv +check lv_field $vg/$lv lv_size "30.00m" # with no --fs used, the fs size should be the same df --output=size "$mount_dir" |tee df2 diff df1 df2 resize2fs "$DM_DEV_DIR/$vg/$lv" df --output=size "$mount_dir" |tee df3 not diff df2 df3 -dd if=/dev/zero of="$mount_dir/zeros2" bs=1M count=200 conv=fdatasync -umount "$mount_dir" -lvchange -an $vg/$lv -lvremove $vg/$lv - -# lvextend, ext4, inactive, --fs ignore -lvcreate -n $lv -L 256M $vg -mkfs.ext4 "$DM_DEV_DIR/$vg/$lv" -lvchange -an $vg/$lv -lvextend --fs ignore -L+200M $vg/$lv -check lv_field $vg/$lv lv_size "456.00m" -lvremove $vg/$lv +dd if=/dev/zero of="$mount_dir/zeros2" bs=1M count=10 oflag=direct +# keep mounted fs # lvextend, ext4, active, mounted, --fs ignore -lvcreate -n $lv -L 256M $vg -mkfs.ext4 "$DM_DEV_DIR/$vg/$lv" -mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir" df --output=size "$mount_dir" |tee df1 -lvextend --fs ignore -L+200M $vg/$lv -check lv_field $vg/$lv lv_size "456.00m" +lvextend --fs ignore -L+10M $vg/$lv +check lv_field $vg/$lv lv_size "40.00m" df --output=size "$mount_dir" |tee df2
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/lvresize-rounding.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvresize-rounding.sh
Changed
@@ -36,7 +36,7 @@ vgremove -f $vg # 15 extents -LVM_TEST_AUX_TRACE=yes +export LVM_TEST_AUX_TRACE=yes aux prepare_vg 3 22 unset LVM_TEST_AUX_TRACE
View file
_service:tar_scm:LVM2.2.03.22.tgz/test/shell/lvresize-xfs.sh
Added
@@ -0,0 +1,306 @@ +#!/usr/bin/env bash + +# Copyright (C) 2023 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +SKIP_WITH_LVMPOLLD=1 + +. lib/inittest + +aux prepare_vg 1 500 + +which mkfs.xfs || skip +which xfs_growfs || skip + +mount_dir="mnt_lvresize_fs" +mkdir -p "$mount_dir" + +mount_dir_space="other mnt dir" +mkdir -p "$mount_dir_space" + + +# Test combinations of the following: +# lvreduce / lvextend +# xfs +# each --fs opt / no --fs opt / --resizefs +# active / inactive +# mounted / unmounted +# fs size less than, equal to or greater than reduced lv size + +################# +# +# lvextend, xfs +# +################# + +# lvextend, xfs, active, mounted, no --fs setting is same as --fs ignore +lvcreate -n $lv -L 300M $vg +mkfs.xfs "$DM_DEV_DIR/$vg/$lv" +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir" + +# --fs tests require a libblkid version that shows FSLASTBLOCK +# so exit 0 test here, if the feature is not present +blkid -p "$DM_DEV_DIR/$vg/$lv" | grep FSLASTBLOCK || skip + +df --output=size "$mount_dir" |tee df1 +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=10 oflag=direct +lvextend -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "320.00m" +# with no --fs used, the fs size should be the same +df --output=size "$mount_dir" |tee df2 +diff df1 df2 +xfs_growfs "$DM_DEV_DIR/$vg/$lv" +df --output=size "$mount_dir" |tee df3 +not diff df2 df3 +dd if=/dev/zero of="$mount_dir/zeros2" bs=1M count=20 oflag=direct +# keep it mounted + +# lvextend, xfs, active, mounted, --fs ignore +df --output=size "$mount_dir" |tee df1 +lvextend --fs ignore -L+20 $vg/$lv +check lv_field $vg/$lv lv_size "340.00m" +df --output=size "$mount_dir" |tee df2 +diff df1 df2 + +# lvextend, xfs, active, mounted, --fs resize +lvextend --fs resize -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "360.00m" +df --output=size "$mount_dir" |tee df3 +not diff df2 df3 + +# lvextend, xfs, active, mounted, --resizefs (same as --fs resize) +lvextend --resizefs -L+10M $vg/$lv +check lv_field $vg/$lv lv_size "370.00m" +df --output=size "$mount_dir" |tee df4 +not diff df3 df4 + +# lvextend, xfs, active, mounted, --fs resize --fsmode manage (same as --fs resize) +lvextend --fs resize --fsmode manage -L+10M $vg/$lv +check lv_field $vg/$lv lv_size "380.00m" +df --output=size "$mount_dir" |tee df2 +not diff df1 df2 + +umount "$mount_dir" +lvchange -an $vg/$lv + +# lvextend, xfs, inactive, --fs ignore +lvextend --fs ignore -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "400.00m" + +lvremove -f $vg/$lv + +#################### +# start with new fs +#################### + +# lvextend, xfs, active, mounted, --fs resize --fsmode offline +lvcreate -n $lv -L 300M $vg +mkfs.xfs "$DM_DEV_DIR/$vg/$lv" +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir_space" +df --output=size "$mount_dir_space" |tee df1 +dd if=/dev/zero of="$mount_dir_space/zeros1" bs=1M count=20 oflag=direct +# xfs_growfs requires the fs to be mounted, so extending the lv is +# succeeds, then the xfs extend fails because it cannot be done unmounted +not lvextend --fs resize --fsmode offline -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "320.00m" +df -a | tee dfa +grep "$mount_dir_space" dfa +df --output=size "$mount_dir_space" |tee df2 +# fs not extended so fs size not changed +diff df1 df2 + +# lvextend, xfs, active, mounted, --fs resize --fsmode nochange +lvextend --fs resize --fsmode nochange -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "340.00m" +df --output=size "$mount_dir_space" |tee df2 +not diff df1 df2 + +# lvextend, xfs, active, mounted, --fs resize_fsadm +lvextend --fs resize_fsadm -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "360.00m" +df --output=size "$mount_dir_space" |tee df3 +not diff df2 df3 +umount "$mount_dir_space" + +# lvextend, xfs, active, unmounted, --fs resize --fsmode nochange +# xfs_growfs requires the fs to be mounted to grow, so --fsmode nochange +# with an unmounted fs fails +not lvextend --fs resize --fsmode nochange -L+20M $vg/$lv +check lv_field $vg/$lv lv_size "380.00m" +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir_space" +df --output=size "$mount_dir_space" |tee df4 +# fs not extended so fs size not changed +diff df3 df4 +umount "$mount_dir_space" + +# lvextend, xfs, active, unmounted, --fs resize +# --yes needed because mount changes are required and plain "resize" +# fsopt did not specify if the user wants to change mount state +lvextend --yes --fs resize -L+10M $vg/$lv +check lv_field $vg/$lv lv_size "390.00m" +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir_space" +df --output=size "$mount_dir_space" |tee df5 +not diff df4 df5 +umount "$mount_dir_space" + +# lvextend, xfs, active, unmounted, --fs resize_fsadm +lvextend --fs resize_fsadm -L+10M $vg/$lv +check lv_field $vg/$lv lv_size "400.00m" +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir_space" +df --output=size "$mount_dir_space" |tee df6 +not diff df5 df6 +umount "$mount_dir_space" +lvremove -f $vg/$lv + + +################################################# +# +# lvreduce, xfs (xfs does not support shrinking) +# +################################################## + +# lvreduce, xfs, active, mounted, no --fs setting is same as --fs checksize +# fs smaller than the reduced size +lvcreate -n $lv -L 300M $vg +mkfs.xfs "$DM_DEV_DIR/$vg/$lv" +lvextend -L+100M $vg/$lv +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir" +dd if=/dev/zero of="$mount_dir/zeros1" bs=1M count=20 oflag=direct +df --output=size "$mount_dir" |tee df1 +# fs is 300M, reduced size is 326M, so no fs reduce is needed +lvreduce -L326M $vg/$lv +check lv_field $vg/$lv lv_size "326.00m" +df --output=size "$mount_dir" |tee df2 +# fs size unchanged +diff df1 df2 +umount "$mount_dir" +lvchange -an $vg/$lv + +# lvreduce, xfs, inactive, no fs setting is same as --fs checksize +# fs smaller than the reduced size +# fs is 200M, reduced size is 216M, so no fs reduce is needed +lvreduce --fs checksize -L316M $vg/$lv +check lv_field $vg/$lv lv_size "316.00m" +lvchange -ay $vg/$lv +mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir" +df --output=size "$mount_dir" |tee df2 +# fs size unchanged +diff df1 df2 + +# lvreduce, xfs, active, mounted, no --fs setting is same as --fs checksize +# fs equal to the reduced size
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/metadata-bad-text.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/metadata-bad-text.sh
Changed
@@ -29,9 +29,7 @@ aux prepare_devs 3 get_devs -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +aux clear_devs "$dev1" "$dev2" "$dev3" vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" @@ -74,9 +72,7 @@ # copy of the metadata. # -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +aux clear_devs "$dev1" "$dev2" "$dev3" vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" @@ -125,9 +121,7 @@ # makes the VG usable. # -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +aux clear_devs "$dev1" "$dev2" "$dev3" pvcreate "$dev1" pvcreate "$dev2" @@ -182,9 +176,7 @@ # devices. # -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +aux clear_devs "$dev1" "$dev2" "$dev3" pvcreate "$dev1" pvcreate "$dev2" @@ -258,9 +250,7 @@ exit 0 fi -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +aux clear_devs "$dev1" "$dev2" "$dev3" vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" @@ -328,4 +318,3 @@ vgchange -an $vg vgremove -ff $vg -
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/metadata-old.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/metadata-old.sh
Changed
@@ -118,9 +118,7 @@ # metadata, and the second mda has current metadata. # -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +aux clear_devs "$dev1" "$dev2" "$dev3" pvcreate "$dev1" pvcreate "$dev2" @@ -181,8 +179,7 @@ # Test when the metadata on two PVs have the same seqno # but different checksums. -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true +aux clear_devs "$dev1" "$dev2" pvcreate "$dev1" pvcreate "$dev2"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/process-each-duplicate-pvs.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/process-each-duplicate-pvs.sh
Changed
@@ -383,8 +383,7 @@ # Verify that devs being used by an active LV are # preferred over duplicates that are not used by an LV. -dd if=/dev/zero of="$dev3" bs=1M oflag=direct,sync || true -dd if=/dev/zero of="$dev4" bs=1M oflag=direct,sync || true +aux clear_devs "$dev3" "$dev4" #pvscan --cache # The previous steps prevent us from nicely cleaning up
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvck-dump.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvck-dump.sh
Changed
@@ -100,8 +100,8 @@ diff m1 m2 diff m1 m3 -not diff m1 m3b > tmp -grep "metadata text at" tmp +not diff m1 m3b > out +grep "metadata text at" out lvcreate -an -l1 $vg @@ -148,12 +148,16 @@ vgcreate $SHARED -s 64K --metadatasize 32M $vg "$dev1" "$dev2" "$dev3" "$dev4" -for i in $(seq 1 500); do echo "lvcreate -an -n lv$i -l1 $vg"; done | lvm +for i in $(seq 1 500); do echo "lvcreate -an -Zn -n lv$i -l1 $vg"; done | lvm +rm -f debug.log* pvck --dump headers "$dev1" > h1 pvck --dump metadata_search "$dev1" > m1 -grep "seqno 500" m1 +grep "seqno 500" m1 || { + cat m1 + die "Missing seqno 500" +} # When metadatasize is 32M, headers/rounding can mean that # we need more than the first 32M of the dev to get all the
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvcreate-operation-md.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvcreate-operation-md.sh
Changed
@@ -107,8 +107,7 @@ fi aux cleanup_md_dev -aux wipefs_a "$dev1" -aux wipefs_a "$dev2" +aux wipefs_a "$dev1" "$dev2" # Test newer topology-aware alignment detection w/ --dataalignment override if aux kernel_at_least 2 6 33 ; then @@ -133,6 +132,5 @@ check pv_field "$pvdev" pe_start "192.00k" aux cleanup_md_dev - aux wipefs_a "$dev1" - aux wipefs_a "$dev2" + aux wipefs_a "$dev1" "$dev2" fi
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvmove-abort-all.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvmove-abort-all.sh
Changed
@@ -55,10 +55,8 @@ "${cmd1@}" & aux wait_pvmove_lv_ready "$vg-pvmove0" "${cmd2@}" & - aux wait_pvmove_lv_ready "$vg-pvmove1" "${cmd3@}" & - aux wait_pvmove_lv_ready "$vg1-pvmove0" - lvs -a $vg $vg1 + aux wait_pvmove_lv_ready "$vg-pvmove1" "$vg1-pvmove0" else LVM_TEST_TAG="kill_me_$PREFIX" "${cmd1@}" LVM_TEST_TAG="kill_me_$PREFIX" "${cmd2@}"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvmove-abort.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvmove-abort.sh
Changed
@@ -49,7 +49,6 @@ LVM_TEST_TAG="kill_me_$PREFIX" "${cmd1@}" LVM_TEST_TAG="kill_me_$PREFIX" "${cmd2@}" fi - # remove specific device pvmove --abort "$dev1"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvmove-resume-1.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvmove-resume-1.sh
Changed
@@ -161,8 +161,7 @@ # disable delay device # fg pvmove would take ages to complete otherwise - aux enable_dev "$dev3" - aux enable_dev "$dev4" + aux enable_dev "$dev3" "$dev4" pvmove } @@ -206,8 +205,7 @@ # disable delay device # fg pvmove would take ages to complete otherwise - aux enable_dev "$dev3" - aux enable_dev "$dev4" + aux enable_dev "$dev3" "$dev4" pvmove "$dev1" pvmove "$dev2"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvmove-resume-multiseg.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvmove-resume-multiseg.sh
Changed
@@ -140,8 +140,7 @@ # disable delay device # fg pvmove would take ages to complete otherwise - aux enable_dev "$dev4" - aux enable_dev "$dev5" + aux enable_dev "$dev4" "$dev5" LVM_TEST_TAG="kill_me_$PREFIX" pvmove } @@ -185,8 +184,7 @@ # disable delay device # fg pvmove would take ages to complete otherwise - aux enable_dev "$dev4" - aux enable_dev "$dev5" + aux enable_dev "$dev4" "$dev5" LVM_TEST_TAG="kill_me_$PREFIX" pvmove "$dev1" LVM_TEST_TAG="kill_me_$PREFIX" pvmove "$dev3"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/pvscan-autoactivate.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/pvscan-autoactivate.sh
Changed
@@ -169,9 +169,9 @@ pvscan --cache -aay "$dev3" not ls "$RUNDIR/lvm/pvs_online/$PVID3" -lvs --foreign $vg2 > tmp -cat tmp -grep $lv2 tmp +lvs --foreign $vg2 > out +cat out +grep $lv2 out check lv_field $vg2/$lv2 lv_active "" --foreign fi
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/report-fields.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/report-fields.sh
Changed
@@ -10,7 +10,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - +SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/report-format.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/report-format.sh
Changed
@@ -11,6 +11,7 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/report-hidden.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/report-hidden.sh
Changed
@@ -10,7 +10,7 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - +SKIP_WITH_LVMLOCKD=1 SKIP_WITH_LVMPOLLD=1 . lib/inittest
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/select-report.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/select-report.sh
Changed
@@ -196,7 +196,7 @@ sel lv 'lv_minor=unknown' vol1 vol2 abc orig snap sel lv 'lv_minor=254' xyz # also test synonym for string field type -sel lv 'seg_monitor=undefined' vol1 vol2 abc abc orig snap xyz +sel lv 'seg_monitor=undefined' vol1 vol2 abc abc orig xyz # if size unit not spefied, the 'm' (MiB) unit is used by default sel lv 'lv_size=8' vol1
View file
_service:tar_scm:LVM2.2.03.22.tgz/test/shell/snapshot-raid.sh
Added
@@ -0,0 +1,423 @@ +#!/usr/bin/env bash + +# Copyright (C) 2018 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# Test snapshots of raid + +SKIP_WITH_LVMPOLLD=1 + +. lib/inittest + +aux have_raid 1 3 0 || skip +which mkfs.ext4 || skip + +mount_dir="mnt" +mkdir -p "$mount_dir" + +snap_dir="mnt_snap" +mkdir -p "$snap_dir" + +# add and remove a snapshot + +test_add_del_snap() { + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + + mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir" + touch "$mount_dir/A" + + lvcreate -s -n snap -L12M $vg/$lv1 "$dev3" + mount "$DM_DEV_DIR/$vg/snap" "$snap_dir" + + touch "$mount_dir/B" + not ls "$snap_dir/B" + touch "$snap_dir/C" + not ls "$mount_dir/C" + ls "$mount_dir/A" + ls "$snap_dir/A" + + umount "$snap_dir" + lvremove -y $vg/snap + umount "$mount_dir" +} + +# add and remove snapshot while origin has a missing raid image + +test_snap_with_missing_image() { + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + + mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir" + touch "$mount_dir/A" + + aux disable_dev "$dev1" + lvs -a -o+devices $vg + + not lvcreate -s -n snap -L12M $vg/$lv1 "$dev3" + + aux enable_dev "$dev1" + aux wait_for_sync $vg $lv1 + + lvcreate -s -n snap -L12M $vg/$lv1 "$dev3" + + aux disable_dev "$dev1" + lvs -a -o+devices $vg + + lvremove -y $vg/snap + + aux enable_dev "$dev1" + vgextend --restoremissing $vg "$dev1" + lvs -a -o+devices $vg + aux wait_for_sync $vg $lv1 + + umount "$mount_dir" +} + +# raid image is lost and restored while a snapshot exists + +test_missing_image_with_snap() { + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + + mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir" + touch "$mount_dir/A" + + lvcreate -s -n snap -L12M $vg/$lv1 "$dev3" + mount "$DM_DEV_DIR/$vg/snap" "$snap_dir" + + aux disable_dev "$dev1" + lvs -a -o+devices $vg + + touch "$mount_dir/B" + not ls "$snap_dir/B" + touch "$snap_dir/C" + not ls "$mount_dir/C" + ls "$mount_dir/A" + ls "$snap_dir/A" + + aux enable_dev "$dev1" + aux wait_for_sync $vg $lv1 + + ls "$mount_dir/B" + ls "$snap_dir/C" + + umount "$snap_dir" + lvremove -y $vg/snap + umount "$mount_dir" +} + +# add and remove raid image while snapshot exists + +test_add_del_image_with_snap() { + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + + mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir" + touch "$mount_dir/A" + + lvcreate -s -n snap -L12M $vg/$lv1 "$dev3" + mount "$DM_DEV_DIR/$vg/snap" "$snap_dir" + + touch "$mount_dir/B" + touch "$snap_dir/C" + + lvconvert -y -m+1 $vg/$lv1 "$dev4" + aux wait_for_sync $vg $lv1 + + ls "$mount_dir/B" + ls "$snap_dir/C" + ls "$mount_dir/A" + ls "$snap_dir/A" + + touch "$mount_dir/B2" + touch "$snap_dir/C2" + + lvconvert -y -m-1 $vg/$lv1 "$dev4" + + ls "$mount_dir/B" + ls "$snap_dir/C" + ls "$mount_dir/A" + ls "$snap_dir/A" + ls "$mount_dir/B2" + ls "$snap_dir/C2" + umount "$snap_dir" + lvremove -y $vg/snap + + umount "$mount_dir" +} + +test_replace_image_with_snap() { + # add an image to replace + lvconvert -y -m+1 $vg/$lv1 "$dev4" + aux wait_for_sync $vg $lv1 + + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + + mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir" + touch "$mount_dir/A" + + lvcreate -s -n snap -L12M $vg/$lv1 "$dev3" + mount "$DM_DEV_DIR/$vg/snap" "$snap_dir" + + touch "$mount_dir/B" + touch "$snap_dir/C" + + lvconvert -y --replace "$dev4" $vg/$lv1 "$dev5" + aux wait_for_sync $vg $lv1 + + ls "$mount_dir/B" + ls "$snap_dir/C" + ls "$mount_dir/A" + ls "$snap_dir/A" + + touch "$mount_dir/B2" + touch "$snap_dir/C2" + + umount "$snap_dir" + lvremove -y $vg/snap + + # put lv1 back to original state with images on dev1 and dev2 + lvconvert -y -m-1 $vg/$lv1 "$dev5" + + umount "$mount_dir" +} + +test_repair_image_with_snap() { + # add an image to repair + lvconvert -y -m+1 $vg/$lv1 "$dev4" + aux wait_for_sync $vg $lv1 + + mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1" + + mount "$DM_DEV_DIR/$vg/$lv1" "$mount_dir" + touch "$mount_dir/A" + + lvcreate -s -n snap -L12M $vg/$lv1 "$dev3"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/system_id.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/system_id.sh
Changed
@@ -24,10 +24,13 @@ aux prepare_devs 5 -SIDFILE="etc/lvm_test.conf" -LVMLOCAL="etc/lvmlocal.conf" +# get lvm.conf location in a form of: etc=path +eval "$(lvmconfig global/etc)" -DFDIR="$LVM_SYSTEM_DIR/devices" +SIDFILE="$etc/lvm_test.conf" +LVMLOCAL="$etc/lvmlocal.conf" + +DFDIR="$etc/devices" DF="$DFDIR/system.devices" # Avoid system id validation in the devices file @@ -50,10 +53,6 @@ check vg_field $vg1 systemid "$SID" vgremove $vg1 -# FIXME - print 'life' config data -#eval "$(lvmconfig global/etc 2>/dev/null || lvmconfig --type default global/etc)" -etc="/etc" - ## machineid if -e "$etc/machine-id" ; then SID=$(cat "$etc/machine-id") @@ -708,4 +707,3 @@ check vg_field $vg1 systemid "$SID" grep "No system ID found from system_id_source" err vgremove $vg1 -
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/thin-flags.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/thin-flags.sh
Changed
@@ -87,7 +87,11 @@ # Provisiong and last free bits in metadata dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=1 oflag=direct || true -check lv_attr_bit health $vg/pool "M" +check lv_attr_bit health $vg/pool "M" || { + echo "TEST ""WARNING: Missing metadata corruption for this version of thin-pool." + exit 0 +} + # TODO - use spaces ?? check lv_field $vg/pool lv_health_status "metadata_read_only" check lv_attr_bit health $vg/$lv2 "-"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/thin-foreign-dmeventd.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/thin-foreign-dmeventd.sh
Changed
@@ -70,6 +70,8 @@ # This mkfs should fill 2MB pool over 95% # no autoresize is configured mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN" +# ensure all data from mkfs are written to disk +sync test "$(percent_)" -gt 95 mount "$DM_DEV_DIR/mapper/$THIN" "$MOUNT_DIR"
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/vdo-convert.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/vdo-convert.sh
Changed
@@ -18,10 +18,12 @@ . lib/inittest # Use local for this test vdo configuratoin -VDOCONF="-f vdotestconf.yml" +VDO_CONFIG="vdotestconf.yml" +VDOCONF="-f $VDO_CONFIG" #VDOCONF="" -export VDOCONF +export VDOCONF VDO_CONFIG VDONAME="${PREFIX}-TESTVDO" +export DM_UUID_PREFIX=$PREFIX # VDO automatically starts dmeventd aux prepare_dmeventd @@ -44,11 +46,11 @@ aux have_vdo 6 2 0 || skip -aux prepare_devs 2 10000 +aux prepare_devs 2 20000 aux extend_filter_LVMTEST - +export TMPDIR=$PWD # Conversion can be made with this version of vdo driver @@ -63,10 +65,11 @@ lvcreate -L5G -n $lv1 $vg +# use some not so 'well' aligned virtual|logical size vdo create $VDOCONF --name "$VDONAME" --device "$DM_DEV_DIR/$vg/$lv1" --vdoSlabSize 128M --vdoLogicalSize 10G mkfs -E nodiscard "$DM_DEV_DIR/mapper/$VDONAME" - +##XXXXX # Different VG name fails not lvm_import_vdo -y -v --name $vg1/$lv1 "$DM_DEV_DIR/$vg/$lv1" @@ -130,26 +133,24 @@ mkfs -E nodiscard "$DM_DEV_DIR/mapper/$VDONAME" -lvm_import_vdo -y -v --name $vg1/$lv2 "$dev1" +lvm_import_vdo --vdo-config "$VDO_CONFIG" -y -v --name $vg1/$lv2 "$dev1" fsck -n "$DM_DEV_DIR/$vg1/$lv2" vgremove -f $vg1 -aux teardown_devs - - -# Check with some real non-DM device from system -# this needs to dropping DM_DEV_DIR +aux wipefs_a "$dev1" -aux prepare_loop 60000 || skip +# let's assume users with VDO target have 'new' enough version of stat too +# otherwise use more universal code from lvm_vdo_import +read major minor < <(stat -c '%Hr %Lr' $(readlink -e "$dev1")) +dmsetup create "$PREFIX-vdotest" --table "0 30280004 linear $major:$minor 32" -test -f LOOP -LOOP=$(< LOOP) -LOOP="${DM_DEV_DIR}/${LOOP##/dev/}" +TEST="$DM_DEV_DIR/mapper/$PREFIX-vdotest" -aux extend_filter "a|$LOOP|" -aux extend_devices "$LOOP" +aux wipefs_a "$TEST" +aux extend_filter "a|$TEST|" +aux extend_devices "$TEST" # # Unfortunatelly generates this in syslog: @@ -165,7 +166,9 @@ # # automate... # -vdo create $VDOCONF --name "$VDONAME" --device "$LOOP" --vdoSlabSize 128M --vdoLogicalSize 23G\ + +# use slightly smaller size then 'rounded' 23G - to enforce vdo_logicalSize rounding +vdo create $VDOCONF --name "$VDONAME" --device "$TEST" --vdoSlabSize 128M --vdoLogicalSize 24117240K\ --blockMapCacheSize 192 \ --blockMapPeriod 2048 \ --emulate512 disabled \ @@ -179,19 +182,49 @@ --vdoHashZoneThreads 3 \ --vdoLogicalThreads 3 \ --writePolicy async-unsafe +dmsetup table # Get VDO table line dmsetup table "$VDONAME" | tr " " "\n" | sed -e '5,6d' -e '12d' | tee vdo-orig +mkfs.ext4 -E nodiscard "$DM_DEV_DIR/mapper/$VDONAME" + +# For conversion we aux lvmconf 'global/vdo_disabled_features = "version4" ' -lvm_import_vdo -y --name $vg/$lv "$LOOP" -lvs -a $vg +# +# Try to prepare 'broken' case where header was moved by older tool to 2M position +# +export LVM_VDO_PREPARE=oldvdoprepareforlvm2M +if which "$LVM_VDO_PREPARE" ; then +# Use old vdoprepareforlvm tool, that always moves header to 2M offset +cp "$VDO_CONFIG" "$VDO_CONFIG.backup" +lvm_import_vdo --abort-after-vdo-convert --vdo-config "$VDO_CONFIG" -v -y --name $vg/$lv "$TEST" +# Restore VDO configuration (as it's been removed with succeful vdo conversion +cp "$VDO_CONFIG.backup" "$VDO_CONFIG" +# Check VDO header is seen at 2M offset +blkid -c /dev/null --probe --offset 2M "$TEST" +fi +unset LVM_VDO_PREPARE + +#lvm_import_vdo --no-snapshot --vdo-config "$VDO_CONFIG" -v -y --name $vg/$lv "$TEST" +lvm_import_vdo --vdo-config "$VDO_CONFIG" --uuid-prefix "$PREFIX" -v -y --name $vg/$lv "$TEST" +dmsetup table +# check our filesystem is OK +fsck -n "$DM_DEV_DIR/$vg/$lv" + +# Compare converted LV uses same VDO table line dmsetup table "$vg-${lv}_vpool-vpool" | tr " " "\n" | sed -e '5,6d' -e '12d' | tee new-vdo-lv +tail -n+3 vdo-orig >vdo-orig-3 +tail -n+3 new-vdo-lv >new-vdo-lv-3 + # Check there is a match between VDO and LV managed volume # (when differentiating parameters are deleted first) -diff -u vdo-orig new-vdo-lv || die "Found mismatching VDO table lines!" +# we need to skip first 2 lines as the device size gets rounded to match VG extent size +diff -u vdo-orig-3 new-vdo-lv-3 || die "Found mismatching VDO table lines!" check lv_field $vg/$lv size "23.00g" +unset LVM_VDO_PREPARE +
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/vgchange-pvs-online.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/vgchange-pvs-online.sh
Changed
@@ -30,10 +30,10 @@ # Because mapping devno to devname gets dm name from sysfs aux lvmconf 'devices/scan = "/dev"' -bd1="/dev/mapper/$(basename $dev1)" -bd2="/dev/mapper/$(basename $dev2)" -bd3="/dev/mapper/$(basename $dev3)" -bd4="/dev/mapper/$(basename $dev4)" +bd1="$DM_DEV_DIR/mapper/$(basename $dev1)" +bd2="$DM_DEV_DIR/mapper/$(basename $dev2)" +bd3="$DM_DEV_DIR/mapper/$(basename $dev3)" +bd4="$DM_DEV_DIR/mapper/$(basename $dev4)" aux extend_filter "a|$bd1|" "a|$bd2|" "a|$bd3|" "a|$bd4|" # Changing names will confuse df based on devname
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/vgimportdevices.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/vgimportdevices.sh
Changed
@@ -12,6 +12,8 @@ test_description='vgimportdevices' +SKIP_WITH_LVMPOLLD=1 + . lib/inittest aux prepare_devs 5
View file
_service:tar_scm:LVM2.2.03.21.tgz/test/shell/vgsplit-cache.sh -> _service:tar_scm:LVM2.2.03.22.tgz/test/shell/vgsplit-cache.sh
Changed
@@ -20,6 +20,7 @@ aux have_cache 1 3 0 || skip aux prepare_vg 7 +vgcfgbackup -f vgb $vg lvcreate -L5 -n $lv2 $vg "$dev2" lvcreate -L5 -n $lv3 $vg "$dev3" @@ -78,7 +79,7 @@ # # Check we handle pmspare for splitted VGs # -aux prepare_vg 7 +vgcfgrestore -f vgb $vg # Create cache-pool and pmspare on single PV1 lvcreate -L10 --type cache-pool $vg/cpool "$dev1" @@ -100,7 +101,7 @@ vgremove -f $vg1 -aux prepare_vg 7 +vgcfgrestore -f vgb $vg # Again - now with handling _pmspare by vgsplit lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/args.h -> _service:tar_scm:LVM2.2.03.22.tgz/tools/args.h
Changed
@@ -52,6 +52,9 @@ "When used alone, --deldev specifies a device name.\n" "When used with --deviceidtype, --deldev specifies a device id.\n") +arg(delnotfound_ARG, '\0', "delnotfound", 0, 0, 0, + "Remove devices file entries with no matching device.\n") + arg(addpvid_ARG, '\0', "addpvid", string_VAL, 0, 0, "Find a device with the PVID and add the device to the devices file.\n") arg(delpvid_ARG, '\0', "delpvid", string_VAL, 0, 0, @@ -565,7 +568,7 @@ "notify_dbus config setting is disabled.\n") arg(noudevsync_ARG, '\0', "noudevsync", 0, 0, 0, - "Disables udev synchronisation. The process will not wait for notification\n" + "Disables udev synchronization. The process will not wait for notification\n" "from udev. It will continue irrespective of any possible udev processing\n" "in the background. Only use this if udev is not running or has rules that\n" "ignore the devices LVM creates.\n")
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/command-lines.in -> _service:tar_scm:LVM2.2.03.22.tgz/tools/command-lines.in
Changed
@@ -473,21 +473,41 @@ RULE: all not lv_is_locked lv_is_raid_with_integrity RULE: --poolmetadata not --readahead --stripesize --stripes_long +# Convert to thin volume +lvconvert --type thin LV_linear_striped_raid_cache_writecache_vdo_error_zero +OO: --thin, OO_LVCONVERT_POOL, OO_LVCONVERT +ID: lvconvert_to_thin_with_data +DESC: Convert LV to a thin LV, using LV as thin-pool data volume. +RULE: all and lv_is_visible +RULE: all not lv_is_locked lv_is_origin lv_is_merging_origin lv_is_external_origin lv_is_raid_with_integrity +RULE: --poolmetadata not --readahead --stripesize --stripes_long + +# Convert to thin volume +lvconvert --thin LV_linear_striped_raid_cache_writecache_vdo_error_zero +OO: OO_LVCONVERT_POOL, OO_LVCONVERT +ID: lvconvert_to_thin_with_data +DESC: Convert LV to a thin LV, using LV as thin-pool data volume. +FLAGS: SECONDARY_SYNTAX +AUTOTYPE: thin +RULE: all and lv_is_visible +RULE: all not lv_is_locked lv_is_origin lv_is_merging_origin lv_is_external_origin lv_is_raid_with_integrity +RULE: --poolmetadata not --readahead --stripesize --stripes_long + --- -lvconvert --type cache --cachepool LV LV_linear_striped_raid_thinpool_vdo_vdopool_vdopooldata +lvconvert --type cache --cachepool LV LV_linear_striped_raid_thinpool_vdo_vdopool_vdopooldata_thin_error_zero OO: --cache, OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT ID: lvconvert_to_cache_with_cachepool DESC: Attach a cache pool to an LV, converts the LV to type cache. -RULE: all and lv_is_visible +RULE: all not lv_is_locked lv_is_merging_origin lv_is_merging_cow lv_is_cow RULE: --poolmetadata not --readahead --stripesize --stripes_long # alternate form of lvconvert --type cache -lvconvert --cache --cachepool LV LV_linear_striped_raid_thinpool_vdo_vdopool_vdopooldata +lvconvert --cache --cachepool LV LV_linear_striped_raid_thinpool_vdo_vdopool_vdopooldata_thin_error_zero OO: OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT ID: lvconvert_to_cache_with_cachepool DESC: Attach a cache pool to an LV. -RULE: all and lv_is_visible +RULE: all not lv_is_locked lv_is_merging_origin lv_is_merging_cow lv_is_cow RULE: --poolmetadata not --readahead --stripesize --stripes_long FLAGS: SECONDARY_SYNTAX AUTOTYPE: cache @@ -539,7 +559,7 @@ ID: lvconvert_to_thinpool DESC: Convert LV to type thin-pool. RULE: all and lv_is_visible -RULE: all not lv_is_locked lv_is_origin lv_is_merging_origin lv_is_external_origin lv_is_virtual lv_is_raid_with_integrity +RULE: all not lv_is_locked lv_is_origin lv_is_merging_origin lv_is_external_origin lv_is_raid_with_integrity RULE: --poolmetadata not --readahead --stripesize --stripes_long # This command syntax has two different meanings depending on @@ -564,7 +584,7 @@ # This command syntax is deprecated, and the primary forms # of creating a pool or swapping metadata should be used. -lvconvert --thinpool LV_linear_striped_raid_cache_writecache_thinpool +lvconvert --thinpool LV_linear_striped_raid_cache_writecache_error_zero_thinpool OO: --stripes_long Number, --stripesize SizeKB, OO_LVCONVERT_THINPOOL, OO_LVCONVERT_POOL, OO_LVCONVERT OP: PV ... @@ -579,7 +599,7 @@ --- -lvconvert --type cache-pool LV_linear_striped_raid +lvconvert --type cache-pool LV_linear_striped_raid_error_zero OO: OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT OP: PV ... ID: lvconvert_to_cachepool @@ -775,7 +795,7 @@ # and the LV type is known. lvconvert --repair LV_cache_cachepool_mirror_raid_thinpool -OO: --usepolicies, --interval Number, --poolmetadataspare Bool, OO_LVCONVERT +OO: --usepolicies, --interval Number, --setactivationskip Bool, --poolmetadataspare Bool, OO_LVCONVERT OP: PV ... ID: lvconvert_repair DESC: Replace failed PVs in a raid or mirror LV. @@ -783,6 +803,7 @@ DESC: Repair a cache pool. RULE: all not lv_is_locked lv_is_pvmove RULE: --poolmetadataspare and LV_cache LV_cachepool LV_thinpool +RULE: --setactivationskip and LV_cache LV_cachepool LV_thinpool lvconvert --replace PV LV_raid OO: OO_LVCONVERT @@ -1088,7 +1109,7 @@ --- lvcreate --type thin LV_thin -OO: --thin, OO_LVCREATE +OO: --thin, --snapshot, OO_LVCREATE IO: --mirrors 0 ID: lvcreate_thin_snapshot DESC: Create a thin LV that is a snapshot of an existing thin LV. @@ -1096,7 +1117,7 @@ # alternate form of lvcreate --type thin lvcreate --thin LV_thin -OO: OO_LVCREATE +OO: --snapshot, OO_LVCREATE IO: --mirrors 0 ID: lvcreate_thin_snapshot DESC: Create a thin LV that is a snapshot of an existing thin LV. @@ -1105,7 +1126,7 @@ # alternate form of lvcreate --type thin lvcreate --snapshot LV_thin -OO: OO_LVCREATE +OO: --thin, OO_LVCREATE IO: --mirrors 0 ID: lvcreate_thin_snapshot DESC: Create a thin LV that is a snapshot of an existing thin LV. @@ -1424,6 +1445,7 @@ DESC: Check the devices file and report incorrect values. lvmdevices --update +OO: --delnotfound ID: lvmdevices_update DESC: Update the devices file to fix incorrect values.
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/command.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/command.c
Changed
@@ -376,11 +376,12 @@ static int _opt_str_to_num(struct command *cmd, char *str) { char long_nameMAX_LONG_OPT_NAME_LEN; - char *p; + char *p = NULL; int i; int first = 0, last = ARG_COUNT - 1, middle; - (void) dm_strncpy(long_name, str, sizeof(long_name)); + if (!dm_strncpy(long_name, str, sizeof(long_name))) + goto err; if ((p = strstr(long_name, "_long"))) /* @@ -424,7 +425,7 @@ break; /* Nothing... */ } } - +err: log_error("Parsing command defs: unknown opt str: \"%s\"%s%s.", str, p ? " ": "", p ? long_name : ""); cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR; @@ -501,7 +502,7 @@ * lvt_bits |= lvt_enum_to_bit(lvt_enum) */ -#define LVTYPE_LEN 64 +#define LVTYPE_LEN 128 static uint64_t _lv_to_bits(struct command *cmd, char *name) { @@ -849,7 +850,7 @@ /* Find a saved OO_FOO definition. */ -#define OO_NAME_LEN 64 +#define OO_NAME_LEN 128 static char *_get_oo_line(const char *str) { @@ -1648,8 +1649,10 @@ continue; } - if (!skip) + if (!skip) { log_error("Parsing command defs: can't process input line %s.", line_orig); + return 0; + } } for (i = 0; i < COMMAND_COUNT; i++) { @@ -2323,13 +2326,12 @@ char *line_argvMAX_LINE_ARGC; int line_argc; int i; - - _was_hyphen = 0; int is_relative_opt = (opt_enum == size_ARG) || (opt_enum == extents_ARG) || (opt_enum == poolmetadatasize_ARG) || (opt_enum == mirrors_ARG); + _was_hyphen = 0; /* * Suppress the + prefix for lvcreate which we have to * accept for backwards compat, but don't want to advertise. @@ -2512,7 +2514,7 @@ { static char long_opt_nameLONG_OPT_NAME_LEN; const char *long_opt; - int i; + unsigned i; memset(&long_opt_name, 0, sizeof(long_opt_name)); @@ -4009,7 +4011,8 @@ if (optind < argc) desfile = argvoptind++; - define_commands(&cmdtool, NULL); + if (!define_commands(&cmdtool, NULL)) + goto out_free; if (!check) configure_command_option_values(cmdname);
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lv_props.h -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lv_props.h
Changed
@@ -46,7 +46,11 @@ lvp(is_thin_origin_LVP, "lv_is_thin_origin", NULL) lvp(is_thin_snapshot_LVP, "lv_is_thin_snapshot", NULL) +lvp(is_error_LVP, "lv_is_error", NULL) +lvp(is_zero_LVP, "lv_is_zero", NULL) + lvp(is_cache_origin_LVP, "lv_is_cache_origin", NULL) +lvp(is_cow_LVP, "lv_is_cow", NULL) lvp(is_merging_cow_LVP, "lv_is_merging_cow", NULL) lvp(is_cow_covering_origin_LVP, "lv_is_cow_covering_origin", NULL) lvp(is_visible_LVP, "lv_is_visible", NULL)
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lvchange.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lvchange.c
Changed
@@ -156,8 +156,11 @@ log_verbose("Monitoring LV %s", display_lvname(lv)); else log_verbose("Unmonitoring LV %s", display_lvname(lv)); - if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode())) - return_0; + if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode())) { + log_error("Failed to change monitoring for %s volume.", + display_lvname(lv)); + return 0; + } } return 1; @@ -357,7 +360,7 @@ init_dmeventd_monitor(monitored); init_mirror_in_sync(0); if (!sync_local_dev_names(cmd)) - log_warn("Failed to sync local dev names."); + log_warn("WARNING: Failed to sync local dev names."); log_very_verbose("Starting resync of %s%s%s%s %s.", (active) ? "active " : "",
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lvconvert.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lvconvert.c
Changed
@@ -19,8 +19,6 @@ #include "lib/metadata/metadata.h" #include "lvconvert_poll.h" -#define MAX_PDATA_ARGS 10 /* Max number of accepted args for d-m-p-d tools */ - typedef enum { /* Split: * For a mirrored or raid LV, split mirror into two mirrors, optionally tracking @@ -2338,17 +2336,14 @@ struct logical_volume *pool_lv, struct dm_list *pvh, int poolmetadataspare) { - const char *dmdir = dm_dir(); const char *thin_dump = find_config_tree_str_allow_empty(cmd, global_thin_dump_executable_CFG, NULL); - const char *thin_repair = - find_config_tree_str_allow_empty(cmd, global_thin_repair_executable_CFG, NULL); - const struct dm_config_node *cn; - const struct dm_config_value *cv; int ret = 0, status; int args = 0; - const char *argvMAX_PDATA_ARGS + 7; /* Max supported args */ - char *dm_name, *trans_id_str; + const char *argvDEFAULT_MAX_EXEC_ARGS + 7 = { /* Max supported args */ + find_config_tree_str_allow_empty(cmd, global_thin_repair_executable_CFG, NULL) + }; + char *trans_id_str; char meta_pathPATH_MAX; char pms_pathPATH_MAX; uint64_t trans_id; @@ -2357,9 +2352,15 @@ struct pipe_data pdata; FILE *f; - if (!thin_repair || !thin_repair0) { - log_error("Thin repair commnand is not configured. Repair is disabled."); - return 0; /* Checking disabled */ + if (!argv0 || !*argv0) { + log_error("Thin repair command is not configured. Repair is disabled."); + return 0; + } + + if (thin_pool_is_active(pool_lv)) { + log_error("Cannot repair active pool %s. Use lvchange -an first.", + display_lvname(pool_lv)); + return 0; } pmslv = pool_lv->vg->pool_metadata_spare_lv; @@ -2374,50 +2375,25 @@ pmslv = pool_lv->vg->pool_metadata_spare_lv; } - if (!(dm_name = dm_build_dm_name(cmd->mem, mlv->vg->name, - mlv->name, NULL)) || - (dm_snprintf(meta_path, sizeof(meta_path), "%s/%s", dmdir, dm_name) < 0)) { + if (dm_snprintf(meta_path, sizeof(meta_path), "%s%s/%s", + cmd->dev_dir, mlv->vg->name, mlv->name) < 0) { log_error("Failed to build thin metadata path."); return 0; } - if (!(dm_name = dm_build_dm_name(cmd->mem, pmslv->vg->name, - pmslv->name, NULL)) || - (dm_snprintf(pms_path, sizeof(pms_path), "%s/%s", dmdir, dm_name) < 0)) { + if (dm_snprintf(pms_path, sizeof(pms_path), "%s%s/%s", + cmd->dev_dir, pmslv->vg->name, pmslv->name) < 0) { log_error("Failed to build pool metadata spare path."); return 0; } - if (!(cn = find_config_tree_array(cmd, global_thin_repair_options_CFG, NULL))) { - log_error(INTERNAL_ERROR "Unable to find configuration for global/thin_repair_options"); - return 0; - } - - for (cv = cn->v; cv && args < MAX_PDATA_ARGS; cv = cv->next) { - if (cv->type != DM_CFG_STRING) { - log_error("Invalid string in config file: " - "global/thin_repair_options"); - return 0; - } - argv++args = cv->v.str; - } - - if (args >= MAX_PDATA_ARGS) { - log_error("Too many options for thin repair command."); - return 0; - } + if (!prepare_exec_args(cmd, argv, &args, global_thin_repair_options_CFG)) + return_0; - argv0 = thin_repair; argv++args = "-i"; argv++args = meta_path; argv++args = "-o"; argv++args = pms_path; - argv++args = NULL; - - if (thin_pool_is_active(pool_lv)) { - log_error("Active pools cannot be repaired. Use lvchange -an first."); - return 0; - } if (!activate_lv(cmd, pmslv)) { log_error("Cannot activate pool metadata spare volume %s.", @@ -2439,7 +2415,7 @@ } /* Check matching transactionId when thin-pool is used by lvm2 (transactionId != 0) */ - if (first_seg(pool_lv)->transaction_id && thin_dump0) { + if (first_seg(pool_lv)->transaction_id && thin_dump && thin_dump0) { argv0 = thin_dump; argv1 = pms_path; argv2 = NULL; @@ -2455,13 +2431,15 @@ (trans_id_str = strstr(meta_path, "transaction=\"")) && (sscanf(trans_id_str + 13, FMTu64, &trans_id) == 1) && (trans_id != first_seg(pool_lv)->transaction_id) && - ((trans_id - 1) != first_seg(pool_lv)->transaction_id)) + ((trans_id - 1) != first_seg(pool_lv)->transaction_id)) { log_error("Transaction id " FMTu64 " from pool \"%s/%s\" " "does not match repaired transaction id " FMTu64 " from %s.", first_seg(pool_lv)->transaction_id, pool_lv->vg->name, pool_lv->name, trans_id, pms_path); + ret = 0; + } (void) pipe_close(&pdata); /* killing pipe */ } @@ -2484,16 +2462,6 @@ if (!ret) return 0; - if (pmslv == pool_lv->vg->pool_metadata_spare_lv) { - pool_lv->vg->pool_metadata_spare_lv = NULL; - pmslv->status &= ~POOL_METADATA_SPARE; - lv_set_visible(pmslv); - } - - /* Try to allocate new pool metadata spare LV */ - if (!handle_pool_metadata_spare(pool_lv->vg, 0, pvh, poolmetadataspare)) - stack; - if (dm_snprintf(meta_path, sizeof(meta_path), "%s_meta%%d", pool_lv->name) < 0) { log_error("Can't prepare new metadata name for %s.", pool_lv->name); return 0; @@ -2504,9 +2472,23 @@ return 0; } + if (pmslv == pool_lv->vg->pool_metadata_spare_lv) { + pool_lv->vg->pool_metadata_spare_lv = NULL; + pmslv->status &= ~POOL_METADATA_SPARE; + lv_set_visible(pmslv); + } + + /* Try to allocate new pool metadata spare LV */ + if (!handle_pool_metadata_spare(pool_lv->vg, 0, pvh, poolmetadataspare)) + stack; + if (!detach_pool_metadata_lv(first_seg(pool_lv), &mlv)) return_0; + /* TODO: change default to skip */ + lv_set_activation_skip(mlv, 1, arg_int_value(cmd, setactivationskip_ARG, 0)); + mlv->status &= ~LVM_WRITE; /* read-only metadata backup */ + /* Swap _pmspare and _tmeta name */ if (!swap_lv_identifiers(cmd, mlv, pmslv)) return_0; @@ -2538,15 +2520,11 @@ struct logical_volume *cache_lv, struct dm_list *pvh, int poolmetadataspare) { - const char *dmdir = dm_dir(); - const char *cache_repair = - find_config_tree_str_allow_empty(cmd, global_cache_repair_executable_CFG, NULL); - const struct dm_config_node *cn; - const struct dm_config_value *cv; int ret = 0, status; int args = 0; - const char *argvMAX_PDATA_ARGS + 7; /* Max supported args */ - char *dm_name; + const char *argvDEFAULT_MAX_EXEC_ARGS + 7 = { /* Max supported args */ + find_config_tree_str_allow_empty(cmd, global_cache_repair_executable_CFG, NULL) + }; char meta_pathPATH_MAX; char pms_pathPATH_MAX; struct logical_volume *pool_lv; @@ -2558,11 +2536,16 @@ return 0; } + if (lv_is_active(cache_lv)) { + log_error("Only inactive cache can be repaired."); + return 0;
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lvmcmdline.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lvmcmdline.c
Changed
@@ -126,6 +126,7 @@ { lvconvert_to_thinpool_CMD, lvconvert_to_pool_cmd }, { lvconvert_to_cachepool_CMD, lvconvert_to_pool_cmd }, { lvconvert_to_thin_with_external_CMD, lvconvert_to_thin_with_external_cmd }, + { lvconvert_to_thin_with_data_CMD, lvconvert_to_thin_with_data_cmd }, { lvconvert_to_cache_with_cachevol_CMD, lvconvert_to_cache_with_cachevol_cmd }, { lvconvert_to_cache_with_device_CMD, lvconvert_to_cache_with_cachevol_cmd }, { lvconvert_to_cache_with_cachepool_CMD, lvconvert_to_cache_with_cachepool_cmd }, @@ -179,6 +180,18 @@ /* Command line args */ +int arg_is_valid_for_command(const struct cmd_context *cmd, int a) +{ + int i; + + for (i = 0; i < cmd->cname->num_args; i++) { + if (cmd->cname->valid_argsi == a) + return 1; + } + + return 0; +} + unsigned arg_count(const struct cmd_context *cmd, int a) { return cmd->opt_arg_values ? cmd->opt_arg_valuesa.count : 0; @@ -2607,7 +2620,7 @@ if (!strcmp(search_mode, "none") || !strcmp(search_mode, "auto") || !strcmp(search_mode, "all")) cmd->search_for_devnames = search_mode; else { - log_warn("Ignoring unknown search_for_devnames setting, using %s.", DEFAULT_SEARCH_FOR_DEVNAMES); + log_warn("WARNING: Ignoring unknown search_for_devnames setting, using %s.", DEFAULT_SEARCH_FOR_DEVNAMES); cmd->search_for_devnames = DEFAULT_SEARCH_FOR_DEVNAMES; } } @@ -3050,7 +3063,7 @@ !strcmp(md_check, "full")) cmd->md_component_checks = md_check; else { - log_warn("Ignoring unknown md_component_checks setting, using auto."); + log_warn("WARNING: Ignoring unknown md_component_checks setting, using auto."); cmd->md_component_checks = "auto"; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lvmdevices.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lvmdevices.c
Changed
@@ -293,6 +293,18 @@ label_scan_invalidate(du->dev); } + if (arg_is_set(cmd, delnotfound_ARG)) { + dm_list_iterate_items_safe(du, du2, &cmd->use_devices) { + if (!du->dev) { + log_print("Deleting IDTYPE=%s IDNAME=%s PVID=%s", + idtype_to_str(du->idtype), du->idname ?: ".", du->pvid ?: "."); + dm_list_del(&du->list); + free_du(du); + update_needed++; + } + } + } + if (arg_is_set(cmd, update_ARG)) { if (update_needed || serial_update_needed || !dm_list_empty(&found_devs)) { if (!device_ids_write(cmd))
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lvresize.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lvresize.c
Changed
@@ -259,29 +259,22 @@ static int _lv_extend_policy(struct cmd_context *cmd, struct logical_volume *lv, struct lvresize_params *lp, int *skipped) { - struct lvresize_params lp_meta; uint32_t percent_main = 0; uint32_t percent_meta = 0; int is_active; - memset(&lp_meta, 0, sizeof(lp_meta)); - - if (!lv_is_cow(lv) && !lv_is_thin_pool(lv) && !lv_is_vdo_pool(lv)) { + if (lv_is_cow(lv)) + is_active = lv_is_active(lv); + else if (lv_is_thin_pool(lv) || lv_is_vdo_pool(lv)) + /* check for -layer active LV */ + is_active = lv_info(lv->vg->cmd, lv, 1, NULL, 0, 0); + else { log_error("lvextend policy is supported only for snapshot, thin pool and vdo pool volumes."); - *skipped = 1; return 0; } - is_active = lv_is_active(lv); - - if (vg_is_shared(lv->vg) && !is_active) { - log_debug("lvextend policy requires LV to be active in a shared VG."); - *skipped = 1; - return 1; - } - - if (lv_is_thin_pool(lv) && !is_active) { - log_error("lvextend using policy requires the thin pool to be active."); + if (!is_active) { + log_error("lvextend using policy requires the volume to be active."); return 0; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/lvscan.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/lvscan.c
Changed
@@ -59,7 +59,7 @@ int lvscan(struct cmd_context *cmd, int argc, char **argv) { if (arg_is_set(cmd, cache_long_ARG)) { - log_warn("Ignoring lvscan --cache because lvmetad is no longer used."); + log_warn("WARNING: Ignoring lvscan --cache because lvmetad is no longer used."); return ECMD_PROCESSED; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/pvck.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/pvck.c
Changed
@@ -383,13 +383,13 @@ return false; off = lseek(def->fd, start, SEEK_SET); - if (off != start) + if (off != (off_t)start) return false; rv = read(def->fd, data, len); if (rv < 0) return false; - if (rv != len) + if ((size_t)rv != len) return false; return true; } @@ -418,7 +418,7 @@ int multiple_vgs = 0; int bad_end; int vgnamelen; - int count; + unsigned count; int len; if (tofile) { @@ -1028,7 +1028,6 @@ uint64_t pvh_offset; /* bytes */ uint64_t pvhe_offset; /* bytes */ uint64_t dlocn_offset; /* bytes */ - uint64_t tmp; int mda_count = 0; int bad = 0; int di; @@ -1095,7 +1094,7 @@ if ((void *)dlocn != (void *)(buf + dlocn_offset - lh_offset)) log_print("CHECK: problem with pv_header.disk_locn%d offset calculation", di); - while ((tmp = xlate64(dlocn->offset))) { + while (xlate64(dlocn->offset)) { if (print_fields) { log_print("pv_header.disk_locn%d at %llu # location of data area", di, (unsigned long long)dlocn_offset); @@ -1128,7 +1127,7 @@ if ((void *)dlocn != (void *)(buf + dlocn_offset - lh_offset)) log_print("CHECK: problem with pv_header.disk_locn%d offset calculation", di); - while ((tmp = xlate64(dlocn->offset))) { + while (xlate64(dlocn->offset)) { if (print_fields) { log_print("pv_header.disk_locn%d at %llu # location of metadata area", di, (unsigned long long)dlocn_offset); @@ -1214,7 +1213,7 @@ dlocn = pvhe->bootloader_areas_xl; dlocn_offset = pvhe_offset + 8; - while ((tmp = xlate64(dlocn->offset))) { + while (xlate64(dlocn->offset)) { if (print_fields) { log_print("pv_header_extension.disk_locn%d at %llu # bootloader area", di, (unsigned long long)dlocn_offset); @@ -1444,8 +1443,13 @@ int bad = 0; if (arg_is_set(cmd, file_ARG)) { + struct stat sb; if (!(tofile = arg_str_value(cmd, file_ARG, NULL))) return 0; + if (!stat(tofile, &sb)) { + log_error("File already exists."); + return 0; + } } if (set->mda_num) @@ -1855,8 +1859,8 @@ const char *str; char key64; char val64; - int num; - int pos; + unsigned num; + unsigned pos; /* * "grouped" means that multiple --settings options can be used. @@ -2115,7 +2119,7 @@ char buf2256; char *buf; uint64_t mda_offset, mda_size, extra_bytes; /* bytes */ - int i, found = 0; + unsigned i, found = 0; if (device_size < (2 * ONE_MB_IN_BYTES)) return_0; @@ -2829,7 +2833,7 @@ goto fail_close; rv = read(fd, back_buf, back_size); - if (rv != back_size) { + if (rv != (int)back_size) { log_error("Cannot read file: %s", input); free(back_buf); goto fail_close; @@ -2966,7 +2970,7 @@ goto_out; rv = read(fd, text_buf, text_size); - if (rv != text_size) { + if (rv != (int)text_size) { log_error("Cannot read file: %s", mf->filename); free(text_buf); goto out;
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/pvmove_poll.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/pvmove_poll.c
Changed
@@ -20,7 +20,7 @@ static int _is_pvmove_image_removable(struct logical_volume *mimage_lv, void *baton) { - uint32_t mimage_to_remove = *((uint32_t *)baton); + uint32_t mimage_to_remove = baton ? *((uint32_t *)baton) : UINT32_MAX; struct lv_segment *mirror_seg; if (!(mirror_seg = get_only_segment_using_this_lv(mimage_lv))) {
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/pvscan.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/pvscan.c
Changed
@@ -19,7 +19,6 @@ #include "lib/metadata/metadata.h" #include "lib/label/hints.h" #include "lib/device/online.h" -#include "lib/filters/filter.h" #include <dirent.h>
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/reporter.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/reporter.c
Changed
@@ -633,6 +633,7 @@ struct logical_volume *lv) { struct selection_handle *sh = parent_handle->selection_handle; + report_type_t initial_report_type = sh->report_type; struct report_args args = {0}; struct single_report_args *single_args = &args.single_argsREPORT_IDX_SINGLE; int do_lv_info, do_lv_seg_status; @@ -648,8 +649,10 @@ &sh->report_type)) return_0; - if (!(handle = init_processing_handle(cmd, parent_handle))) + if (!(handle = init_processing_handle(cmd, parent_handle))) { + sh->report_type = initial_report_type; return_0; + } /* * We're already reporting for select so override @@ -695,6 +698,8 @@ break; } + sh->report_type = initial_report_type; + /* * Keep the selection handle provided from the caller - * do not destroy it - the caller will still use it to
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/toollib.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/toollib.c
Changed
@@ -88,6 +88,7 @@ _exit(ECMD_FAILED); } + /* coverityleaked_handle don't care */ if ((dup2(null_fd, STDIN_FILENO) < 0) || /* reopen stdin */ (dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */ (dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */ @@ -113,7 +114,6 @@ } /* coverityleaked_handle null_fd does not leak here */ - return 1; } @@ -211,7 +211,7 @@ } return 1; } else { - log_warn("Skipping clustered VG %s.", vg_name); + log_warn("WARNING: Skipping clustered VG %s.", vg_name); if (!_printed_clustered_vg_advice) { _printed_clustered_vg_advice = 1; log_error("See lvmlockd(8) for changing a clvm/clustered VG to a shared VG."); @@ -565,7 +565,7 @@ if (vp_new->system_id && cmd->system_id && strcmp(vp_new->system_id, cmd->system_id)) { if (*vp_new->system_id) - log_warn("VG with system ID %s might become inaccessible as local system ID is %s", + log_warn("WARNING: VG with system ID %s might become inaccessible as local system ID is %s", vp_new->system_id, cmd->system_id); else log_warn("WARNING: A VG without a system ID allows unsafe access from other hosts."); @@ -584,7 +584,7 @@ if (vp_new->system_id && cmd->system_id && strcmp(vp_new->system_id, cmd->system_id)) { - log_warn("VG with system ID %s might become inaccessible as local system ID is %s", + log_warn("WARNING: VG with system ID %s might become inaccessible as local system ID is %s", vp_new->system_id, cmd->system_id); } } @@ -904,7 +904,7 @@ /* Ensure there is nothing waiting on cookie */ if (!sync_local_dev_names(cmd)) - log_warn("Failed to sync local dev names."); + log_warn("WARNING: Failed to sync local dev names."); if (lv_is_pvmove(lv)) lv_mirr = lv; @@ -1319,7 +1319,6 @@ // Settings bellow cannot be changed with lvchange command is_lvchange = checked_lvchange; - DO_OFFLINE(check_point_frequency); DO_OFFLINE(index_memory_size_mb); DO_OFFLINE(minimum_io_size); DO_OFFLINE(slab_size_mb); @@ -1336,6 +1335,11 @@ continue; } + if (_compare_vdo_option(cn->key, "check_point_frequency")) { + log_verbose("Ignoring deprecated --vdosettings option \"%s\" and its value.", cn->key); + continue; /* Accept & ignore deprecated option */ + } + log_error("Unknown VDO setting \"%s\".", cn->key); goto out; } @@ -1494,13 +1498,13 @@ return 0; } - log_warn("Unrecognized writecache setting \"%s\" may cause activation failure.", key); + log_warn("WARNING: Unrecognized writecache setting \"%s\" may cause activation failure.", key); if (yes_no_prompt("Use unrecognized writecache setting? y/n: ") == 'n') { log_error("Aborting writecache conversion."); return 0; } - log_warn("Using unrecognized writecache setting: %s = %s.", key, val); + log_warn("WARNING: Using unrecognized writecache setting: %s = %s.", key, val); settings->new_key = dm_pool_strdup(cmd->mem, key); settings->new_val = dm_pool_strdup(cmd->mem, val); @@ -1520,7 +1524,7 @@ char key64; char val64; int num; - int pos; + unsigned pos; int rn; int found = 0; @@ -1850,7 +1854,7 @@ *major, cmd->dev_types->device_mapper_major); } /* Stay with dynamic major:minor if minor is not specified. */ - *major = (*minor == -1) ? -1 : cmd->dev_types->device_mapper_major; + *major = (*minor == -1) ? -1 : (int)cmd->dev_types->device_mapper_major; } if ((*minor != -1) && !validate_major_minor(cmd, fmt, *major, *minor)) @@ -2313,7 +2317,12 @@ * is unknown. */ log_error("Multiple VGs found with the same name: skipping %s", sl->str); - log_error("Use --select vg_uuid=<uuid> in place of the VG name."); + + if (arg_is_valid_for_command(cmd, select_ARG)) + log_error("Use --select vg_uuid=<uuid> in place of the VG name."); + else + log_error("Use VG uuid in place of the VG name."); + dm_list_del(&sl->list); ret = ECMD_FAILED; } @@ -2737,10 +2746,16 @@ return lv_is_cache_origin(lv); case is_merging_cow_LVP: return lv_is_merging_cow(lv); + case is_cow_LVP: + return lv_is_cow(lv); case is_cow_covering_origin_LVP: return lv_is_cow_covering_origin(lv); case is_visible_LVP: return lv_is_visible(lv); + case is_error_LVP: + return lv_is_error(lv); + case is_zero_LVP: + return lv_is_zero(lv); case is_historical_LVP: return lv_is_historical(lv); case is_raid_with_tracking_LVP: @@ -2804,9 +2819,9 @@ case integrity_LVT: return seg_is_integrity(seg); case error_LVT: - return !strcmp(seg->segtype->name, SEG_TYPE_NAME_ERROR); + return seg_is_error(seg); case zero_LVT: - return !strcmp(seg->segtype->name, SEG_TYPE_NAME_ZERO); + return seg_is_zero(seg); default: log_error(INTERNAL_ERROR "unknown lv type value lvt_enum %d", lvt_enum); } @@ -2864,9 +2879,9 @@ if (seg_is_integrity(seg)) return integrity_LVT; - if (!strcmp(seg->segtype->name, SEG_TYPE_NAME_ERROR)) + if (seg_is_error(seg)) return error_LVT; - if (!strcmp(seg->segtype->name, SEG_TYPE_NAME_ZERO)) + if (seg_is_zero(seg)) return zero_LVT; return 0; @@ -2986,10 +3001,10 @@ int lvt_enum = get_lvt_enum(lv); struct lv_type *type = get_lv_type(lvt_enum); if (!type) { - log_warn("Command on LV %s does not accept LV type unknown (%d).", + log_warn("WARNING: Command on LV %s does not accept LV type unknown (%d).", display_lvname(lv), lvt_enum); } else { - log_warn("Command on LV %s does not accept LV type %s.", + log_warn("WARNING: Command on LV %s does not accept LV type %s.", display_lvname(lv), type->name); } } @@ -3100,7 +3115,7 @@ if (rule->check_opts && (rule->rule == RULE_INVALID) && opts_match_count) { memset(buf, 0, sizeof(buf)); opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf)); - log_warn("Command on LV %s has invalid use of option %s.", + log_warn("WARNING: Command on LV %s has invalid use of option %s.", display_lvname(lv), buf); ret = 0; } @@ -3110,7 +3125,7 @@ if (rule->check_opts && (rule->rule == RULE_REQUIRE) && opts_unmatch_count) { memset(buf, 0, sizeof(buf)); opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf)); - log_warn("Command on LV %s requires option %s.", + log_warn("WARNING: Command on LV %s requires option %s.", display_lvname(lv), buf); ret = 0; } @@ -3119,10 +3134,10 @@ if (rule->check_lvt_bits && (rule->rule == RULE_INVALID) && lv_types_match_bits) { if (rule->opts_count) - log_warn("Command on LV %s uses options invalid with LV type %s.", + log_warn("WARNING: Command on LV %s uses options invalid with LV type %s.", display_lvname(lv), lvtype ? lvtype->name : "unknown"); else
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/tools.h -> _service:tar_scm:LVM2.2.03.22.tgz/tools/tools.h
Changed
@@ -193,6 +193,7 @@ int dumptype_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_values *av); /* we use the enums to access the switches */ +int arg_is_valid_for_command(const struct cmd_context *cmd, int a); unsigned arg_count(const struct cmd_context *cmd, int a); unsigned arg_is_set(const struct cmd_context *cmd, int a); int arg_from_list_is_set(const struct cmd_context *cmd, const char *err_found, ...); @@ -263,6 +264,7 @@ int lvconvert_to_cache_with_cachepool_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_to_writecache_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_to_thin_with_external_cmd(struct cmd_context *cmd, int argc, char **argv); +int lvconvert_to_thin_with_data_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_swap_pool_metadata_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_to_pool_or_swap_metadata_cmd(struct cmd_context *cmd, int argc, char **argv); int lvconvert_merge_thin_cmd(struct cmd_context *cmd, int argc, char **argv);
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/vgchange.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/vgchange.c
Changed
@@ -386,7 +386,7 @@ uint32_t extent_size; if (arg_uint64_value(cmd, physicalextentsize_ARG, 0) > MAX_EXTENT_SIZE) { - log_warn("Physical extent size cannot be larger than %s.", + log_warn("WARNING: Physical extent size cannot be larger than %s.", display_size(cmd, (uint64_t) MAX_EXTENT_SIZE)); return 1; } @@ -394,7 +394,7 @@ extent_size = arg_uint_value(cmd, physicalextentsize_ARG, 0); /* FIXME: remove check - redundant with vg_change_pesize */ if (extent_size == vg->extent_size) { - log_warn("Physical extent size of VG %s is already %s.", + log_warn("WARNING: Physical extent size of VG %s is already %s.", vg->name, display_size(cmd, (uint64_t) extent_size)); return 1; } @@ -463,10 +463,10 @@ if (mda_copies == vg_mda_copies(vg)) { if (vg_mda_copies(vg) == VGMETADATACOPIES_UNMANAGED) - log_warn("Number of metadata copies for VG %s is already unmanaged.", + log_warn("WARNING: Number of metadata copies for VG %s is already unmanaged.", vg->name); else - log_warn("Number of metadata copies for VG %s is already %u.", + log_warn("WARNING: Number of metadata copies for VG %s is already %u.", vg->name, mda_copies); return 1; } @@ -863,6 +863,9 @@ *flags &= ~READ_WITHOUT_LOCK; cmd->can_use_one_scan = 0; } + + free(vgname); + return 1; } @@ -1049,7 +1052,7 @@ } if (lock_type && !strcmp(vg->lock_type, lock_type)) { - log_warn("New lock type %s matches the current lock type %s.", + log_warn("WARNING: New lock type %s matches the current lock type %s.", lock_type, vg->lock_type); return 1; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/vgimportdevices.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/vgimportdevices.c
Changed
@@ -233,7 +233,8 @@ log_print("Added %u devices to devices file.", vp.added_devices); out: if ((ret == ECMD_FAILED) && created_file) - unlink(cmd->devices_file_path); + if (unlink(cmd->devices_file_path) < 0) + log_sys_debug("unlink", cmd->devices_file_path); destroy_processing_handle(cmd, handle); return ret; }
View file
_service:tar_scm:LVM2.2.03.21.tgz/tools/vgscan.c -> _service:tar_scm:LVM2.2.03.22.tgz/tools/vgscan.c
Changed
@@ -48,7 +48,7 @@ } if (arg_is_set(cmd, cache_long_ARG)) { - log_warn("Ignoring vgscan --cache command because lvmetad is no longer used."); + log_warn("WARNING: Ignoring vgscan --cache command because lvmetad is no longer used."); return ECMD_PROCESSED; }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2