main - partial flag for writecache and integrity
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b84a9927b78727efffb...
Commit: b84a9927b78727efffbb257a61e9e95a648cdfab
Parent: 23ef67776210ad6c55f4dd7475b806337140c513
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Dec 11 15:56:04 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Dec 11 16:25:25 2020 -0600
partial flag for writecache and integrity
When a writecache sublv or an integrity metadata sublv
are partial (missing a dev), set the partial flag on
the upper level LV also, as is done for other sublvs.
---
lib/metadata/metadata.c | 4 ++++
test/shell/writecache-split.sh | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index d04b8d8ba..f4d07a4f7 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -1916,6 +1916,10 @@ static int _lv_each_dependency(struct logical_volume *lv,
return_0;
if (lvseg->metadata_lv && !fn(lvseg->metadata_lv, data))
return_0;
+ if (lvseg->writecache && !fn(lvseg->writecache, data))
+ return_0;
+ if (lvseg->integrity_meta_dev && !fn(lvseg->integrity_meta_dev, data))
+ return_0;
for (s = 0; s < lvseg->area_count; ++s) {
if (seg_type(lvseg, s) == AREA_LV && !fn(seg_lv(lvseg,s), data))
return_0;
diff --git a/test/shell/writecache-split.sh b/test/shell/writecache-split.sh
index d1b14bfd3..5723f7aab 100644
--- a/test/shell/writecache-split.sh
+++ b/test/shell/writecache-split.sh
@@ -99,6 +99,11 @@ lvchange -an $vg/$lv1
aux disable_dev "$dev2"
+lvs -a -o+lv_health_status $vg |tee out
+grep $lv1 out | grep partial
+grep $lv2 out | grep partial
+check lv_attr_bit health $vg/$lv1 "p"
+
not lvconvert --splitcache $vg/$lv1
lvconvert --splitcache --force --yes $vg/$lv1
@@ -128,6 +133,11 @@ lvchange -an $vg/$lv1
aux disable_dev "$dev3"
+lvs -a -o+lv_health_status $vg |tee out
+grep $lv1 out | grep partial
+grep $lv2 out | grep partial
+check lv_attr_bit health $vg/$lv1 "p"
+
not lvconvert --splitcache $vg/$lv1
lvconvert --splitcache --force --yes $vg/$lv1
2 years, 11 months
main - configure: update
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=23ef67776210ad6c55f...
Commit: 23ef67776210ad6c55f4dd7475b806337140c513
Parent: 5dbe2fdd9dd783c2911a5375d6fdec86118af280
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Fri Dec 11 12:16:16 2020 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Fri Dec 11 12:16:16 2020 +0100
configure: update
---
aclocal.m4 | 10 ++++++----
configure | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 3e0fbd38d..7524c8313 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -496,12 +496,14 @@ AC_DEFUN([AM_PATH_PYTHON],
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
else
- dnl Query Python for its version number. Getting [:3] seems to be
- dnl the best way to do this; it's what "site.py" does in the standard
- dnl library.
+ dnl Query Python for its version number. Although site.py simply uses
+ dnl sys.version[:3], printing that failed with Python 3.10, since the
+ dnl trailing zero was eliminated. So now we output just the major
+ dnl and minor version numbers, as numbers. Apparently the tertiary
+ dnl version is not of interest.
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
- [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
+ [am_cv_python_version=`$PYTHON -c "import sys; print('%u.%u' % sys.version_info[[:2]])"`])
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
dnl Use the values of $prefix and $exec_prefix for the corresponding
diff --git a/configure b/configure
index 29d19f249..4c38cbebb 100755
--- a/configure
+++ b/configure
@@ -11962,7 +11962,7 @@ $as_echo_n "checking for $am_display_PYTHON version... " >&6; }
if ${am_cv_python_version+:} false; then :
$as_echo_n "(cached) " >&6
else
- am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`
+ am_cv_python_version=`$PYTHON -c "import sys; print('%u.%u' % sys.version_info[:2])"`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
$as_echo "$am_cv_python_version" >&6; }
2 years, 11 months
main - writecache: fix uncache for two step detach
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5dbe2fdd9dd783c2911...
Commit: 5dbe2fdd9dd783c2911a5375d6fdec86118af280
Parent: 9fe7aba251ff24c14277dfdf9be2d861a7699230
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Dec 10 15:37:23 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Dec 10 15:42:01 2020 -0600
writecache: fix uncache for two step detach
Fix the two-step writecache detach in commit c32d7fed4f78b.
In the case of uncache, the cachevol is removed after
detaching the writecache. When the detach is finished
in the second step, the remove must wait until then.
---
test/shell/writecache-large.sh | 29 ++++++++++++++++++++++++++
test/shell/writecache-split.sh | 46 ++++++++++++++++++++++++++++++++++++++++++
tools/lvconvert.c | 33 ++++++++++++++++++++++++++++--
3 files changed, 106 insertions(+), 2 deletions(-)
diff --git a/test/shell/writecache-large.sh b/test/shell/writecache-large.sh
index fc8f379cf..9a5a9f1dd 100644
--- a/test/shell/writecache-large.sh
+++ b/test/shell/writecache-large.sh
@@ -149,5 +149,34 @@ lvchange -an $vg/$lv2
lvremove $vg/$lv1
lvremove $vg/$lv2
+# Repeat similar using uncache
+
+lvcreate -n $lv1 -L 560M -an $vg "$dev1"
+lvcreate -n $lv2 -L 500M -an $vg "$dev2"
+
+lvchange -ay $vg/$lv1
+lvconvert --yes --type writecache --cachevol $lv2 $vg/$lv1
+
+_add_new_data_to_mnt
+_add_more_data_to_mnt
+dd if=/dev/zero of=$mnt/big1 bs=1M count=100 oflag=sync
+
+umount $mnt
+lvchange -an $vg/$lv1
+
+lvconvert --uncache $vg/$lv1
+
+check lv_field $vg/$lv1 segtype linear
+not lvs $vg/$lv2
+
+lvchange -ay $vg/$lv1
+mount "$DM_DEV_DIR/$vg/$lv1" $mnt
+
+_verify_data_on_mnt
+_verify_more_data_on_mnt
+
+umount $mnt
+lvchange -an $vg/$lv1
+
vgremove -ff $vg
diff --git a/test/shell/writecache-split.sh b/test/shell/writecache-split.sh
index e615e2a13..d1b14bfd3 100644
--- a/test/shell/writecache-split.sh
+++ b/test/shell/writecache-split.sh
@@ -171,5 +171,51 @@ lvconvert -y --type writecache --cachevol $lv2 $vg/$lv1
fail vgsplit $vg $vg1 "$dev2"
fail vgsplit $vg $vg1 "$dev3"
lvremove $vg/$lv1
+vgremove $vg
+
+#
+# uncache
+#
+vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4"
+
+# while inactive
+
+lvcreate -n $lv1 -l 16 -an $vg "$dev1" "$dev4"
+lvcreate -n $lv2 -l 4 -an $vg "$dev2"
+
+lvconvert -y --type writecache --cachevol $lv2 $vg/$lv1
+
+lvchange -ay $vg/$lv1
+mkfs_mount_umount $lv1
+lvchange -an $vg/$lv1
+
+lvconvert --uncache $vg/$lv1
+lvs -o segtype $vg/$lv1 | grep linear
+not lvs $vg/$lv2
+
+lvchange -ay $vg/$lv1
+mount_umount $lv1
+lvchange -an $vg/$lv1
+lvremove -y $vg/$lv1
+
+# while active
+
+lvcreate -n $lv1 -l 16 -an $vg "$dev1" "$dev4"
+lvcreate -n $lv2 -l 4 -an $vg "$dev2"
+
+lvconvert -y --type writecache --cachevol $lv2 $vg/$lv1
+
+lvchange -ay $vg/$lv1
+mkfs_mount_umount $lv1
+
+lvconvert --uncache $vg/$lv1
+lvs -o segtype $vg/$lv1 | grep linear
+not lvs $vg/$lv2
+
+lvchange -an $vg/$lv1
+lvchange -ay $vg/$lv1
+mount_umount $lv1
+lvchange -an $vg/$lv1
+lvremove -y $vg/$lv1
vgremove -ff $vg
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 7d5a541d0..432396567 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3662,6 +3662,7 @@ struct lvconvert_result {
unsigned need_polling:1;
unsigned wait_cleaner_writecache:1;
unsigned active_begin:1;
+ unsigned remove_cache:1;
struct dm_list poll_idls;
};
@@ -4966,8 +4967,18 @@ static int _lvconvert_split_cache_single(struct cmd_context *cmd,
return ECMD_FAILED;
if (cmd->command->command_enum == lvconvert_split_and_remove_cache_CMD) {
- if (lvremove_single(cmd, lv_fast, NULL) != ECMD_PROCESSED)
- return ECMD_FAILED;
+ struct lvconvert_result *lr = (struct lvconvert_result *) handle->custom_handle;
+ /*
+ * If detach is ongoing, then the remove needs to wait
+ * until _lvconvert_detach_writecache_when_clean(),
+ * after the detach has finished. When lr->remove_cache
+ * has been set, when_clean() knows it should remove
+ * lv_fast at the end.
+ */
+ if (!lr->wait_cleaner_writecache) {
+ if (lvremove_single(cmd, lv_fast, NULL) != ECMD_PROCESSED)
+ return ECMD_FAILED;
+ }
}
ret = 1;
} else if (lv_is_cache(lv_main) && lv_is_cache_vol(lv_fast)) {
@@ -5637,6 +5648,10 @@ static int _lvconvert_detach_writecache(struct cmd_context *cmd,
lr->wait_cleaner_writecache = 1;
lr->active_begin = active_begin;
+ /* The command wants to remove the cache after detaching. */
+ if (cmd->command->command_enum == lvconvert_split_and_remove_cache_CMD)
+ lr->remove_cache = 1;
+
dm_list_add(&lr->poll_idls, &idl->list);
return 1;
}
@@ -5679,6 +5694,7 @@ static int _lvconvert_detach_writecache_when_clean(struct cmd_context *cmd,
struct poll_operation_id *id;
struct volume_group *vg;
struct logical_volume *lv;
+ struct logical_volume *lv_fast;
uint32_t lockd_state, error_flags;
uint64_t dirty;
int ret;
@@ -5759,6 +5775,8 @@ static int _lvconvert_detach_writecache_when_clean(struct cmd_context *cmd,
log_print("Detaching writecache completed cleaning.");
+ lv_fast = first_seg(lv)->writecache;
+
/*
* When the cleaner has finished, we can detach with noflush since
* the cleaner has done the flushing.
@@ -5770,6 +5788,17 @@ static int _lvconvert_detach_writecache_when_clean(struct cmd_context *cmd,
goto out_release;
}
+ /*
+ * The detach was started by an uncache command that wants to remove
+ * the cachevol after detaching.
+ */
+ if (lr->remove_cache) {
+ if (lvremove_single(cmd, lv_fast, NULL) != ECMD_PROCESSED) {
+ log_error("Removing the writecache cachevol failed.");
+ ret = 0;
+ }
+ }
+
ret = 1;
backup(vg);
2 years, 11 months
main - cache: activation cache_check on cachevol
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9fe7aba251ff24c1427...
Commit: 9fe7aba251ff24c14277dfdf9be2d861a7699230
Parent: 57594fe673587ea33a6521733376862055ecbd65
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 9 17:36:09 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Dec 9 17:36:09 2020 -0600
cache: activation cache_check on cachevol
When using cache with a cachevol, the cache_check tool was
not being run on the cache metadata during activation.
cache_check clears the needs_check flag in the cache
metadata, so if the flag was set due to an unclean
shutdown, the activation would fail.
---
lib/activate/dev_manager.c | 36 ++++++++++++++++++++++++------------
lib/metadata/lv.c | 31 +++++++++++++++++++++++++++++++
lib/metadata/lv.h | 3 +++
3 files changed, 58 insertions(+), 12 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 85cfda246..8d27bd363 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -2270,21 +2270,31 @@ static int _pool_callback(struct dm_tree_node *node,
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;
+ struct cmd_context *cmd = pool_lv->vg->cmd;
long buf[64 / sizeof(long)]; /* buffer for short disk header (64B) */
int args = 0;
char *mpath;
const char *argv[19] = { /* Max supported 15 args */
- find_config_tree_str_allow_empty(pool_lv->vg->cmd, data->exec, NULL)
+ find_config_tree_str_allow_empty(cmd, data->exec, NULL)
};
if (!*argv[0]) /* *_check tool is unconfigured/disabled with "" setting */
return 1;
- if (!(mpath = lv_dmpath_dup(data->dm->mem, mlv))) {
- log_error("Failed to build device path for checking pool metadata %s.",
- display_lvname(mlv));
- return 0;
+ if (lv_is_cache_vol(pool_lv)) {
+ if (!(mpath = lv_dmpath_suffix_dup(data->dm->mem, pool_lv, "-cmeta"))) {
+ log_error("Failed to build device path for checking cachevol metadata %s.",
+ display_lvname(pool_lv));
+ return 0;
+ }
+ } else {
+ if (!(mpath = lv_dmpath_dup(data->dm->mem, mlv))) {
+ log_error("Failed to build device path for checking pool metadata %s.",
+ display_lvname(mlv));
+ return 0;
+ }
}
+ log_debug("Running check command on %s", mpath);
if (data->skip_zero) {
if ((fd = open(mpath, O_RDONLY)) < 0) {
@@ -2312,7 +2322,7 @@ static int _pool_callback(struct dm_tree_node *node,
}
}
- if (!(cn = find_config_tree_array(mlv->vg->cmd, data->opts, NULL))) {
+ if (!(cn = find_config_tree_array(cmd, data->opts, NULL))) {
log_error(INTERNAL_ERROR "Unable to find configuration for pool check options.");
return 0;
}
@@ -2334,7 +2344,7 @@ static int _pool_callback(struct dm_tree_node *node,
argv[++args] = mpath;
- if (!(ret = exec_cmd(pool_lv->vg->cmd, (const char * const *)argv,
+ if (!(ret = exec_cmd(cmd, (const char * const *)argv,
&status, 0))) {
if (status == ENOENT) {
log_warn("WARNING: Check is skipped, please install recommended missing binary %s!",
@@ -2343,7 +2353,7 @@ static int _pool_callback(struct dm_tree_node *node,
}
if ((data->version.maj || data->version.min || data->version.patch) &&
- !_check_tool_version(pool_lv->vg->cmd, argv[0],
+ !_check_tool_version(cmd, argv[0],
data->version.maj, data->version.min, data->version.patch)) {
log_warn("WARNING: Check is skipped, please upgrade installed version of %s!",
argv[0]);
@@ -2387,10 +2397,6 @@ static int _pool_register_callback(struct dev_manager *dm,
return 1;
#endif
- /* Skip for single-device cache pool */
- if (lv_is_cache(lv) && lv_is_cache_vol(first_seg(lv)->pool_lv))
- return 1;
-
if (!(data = dm_pool_zalloc(dm->mem, sizeof(*data)))) {
log_error("Failed to allocated path for callback.");
return 0;
@@ -3483,6 +3489,12 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
!_pool_register_callback(dm, dnode, lv))
return_0;
+ if (lv_is_cache(lv) && lv_is_cache_vol(first_seg(lv)->pool_lv) &&
+ /* Register callback only for layer activation or non-layered cache LV */
+ (layer || !lv_layer(lv)) &&
+ !_pool_register_callback(dm, dnode, lv))
+ return_0;
+
/*
* Update tables for ANY PVMOVE holders for active LV where the name starts with 'pvmove',
* but it's not anymore PVMOVE LV and also it's not a PVMOVE _mimage LV.
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index fac47e530..475f21191 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -1034,6 +1034,37 @@ char *lv_dmpath_dup(struct dm_pool *mem, const struct logical_volume *lv)
return repstr;
}
+/* maybe factor a common function with lv_dmpath_dup */
+char *lv_dmpath_suffix_dup(struct dm_pool *mem, const struct logical_volume *lv,
+ const char *suffix)
+{
+ char *name;
+ char *repstr;
+ size_t len;
+
+ if (!*lv->vg->name)
+ return dm_pool_strdup(mem, "");
+
+ if (!(name = dm_build_dm_name(mem, lv->vg->name, lv->name, NULL))) {
+ log_error("dm_build_dm_name failed");
+ return NULL;
+ }
+
+ len = strlen(dm_dir()) + strlen(name) + strlen(suffix) + 2;
+
+ if (!(repstr = dm_pool_zalloc(mem, len))) {
+ log_error("dm_pool_alloc failed");
+ return NULL;
+ }
+
+ if (dm_snprintf(repstr, len, "%s/%s%s", dm_dir(), name, suffix) < 0) {
+ log_error("lv_dmpath snprintf failed");
+ return NULL;
+ }
+
+ return repstr;
+}
+
char *lv_uuid_dup(struct dm_pool *mem, const struct logical_volume *lv)
{
return id_format_and_copy(mem ? mem : lv->vg->vgmem, &lv->lvid.id[1]);
diff --git a/lib/metadata/lv.h b/lib/metadata/lv.h
index e2e640f5d..28bd4b869 100644
--- a/lib/metadata/lv.h
+++ b/lib/metadata/lv.h
@@ -194,6 +194,9 @@ char *lv_lock_args_dup(struct dm_pool *mem, const struct logical_volume *lv);
char *lvseg_kernel_discards_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_with_info_and_seg_status *lvdm);
char *lv_time_dup(struct dm_pool *mem, const struct logical_volume *lv, int iso_mode);
+char *lv_dmpath_suffix_dup(struct dm_pool *mem, const struct logical_volume *lv,
+ const char *suffix);
+
typedef enum {
PERCENT_GET_DATA = 0,
PERCENT_GET_METADATA,
2 years, 11 months
stable-2.02 - tests: few more fsadm checks
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=92a67e3d3f84825c7be...
Commit: 92a67e3d3f84825c7be92d0d2259fa92b56092b9
Parent: 307acb072b68956bf7c08dc88b6927f6abf3d2e4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Dec 7 16:20:00 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Dec 8 22:17:17 2020 +0100
tests: few more fsadm checks
---
test/shell/fsadm.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/test/shell/fsadm.sh b/test/shell/fsadm.sh
index 910edddd8..67f9660e6 100644
--- a/test/shell/fsadm.sh
+++ b/test/shell/fsadm.sh
@@ -96,9 +96,19 @@ lvcreate -n $lv1 -L20M $vg
lvcreate -n ${lv1}bar -L10M $vg
trap 'cleanup_mounted_and_teardown' EXIT
+# prints help
+fsadm
+
+# check needs arg
+not fsadm check
+
if check_missing ext2; then
mkfs.ext2 -b4096 -j "$dev_vg_lv"
+ # Check 'check' works
+ fsadm check $vg_lv
+ # Check 'resize' without size parameter works
+ fsadm resize $vg_lv
fsadm --lvresize resize $vg_lv 30M
# Fails - not enough space for 4M fs
not fsadm -y --lvresize resize "$dev_vg_lv" 4M
2 years, 11 months
stable-2.02 - fsadm: fix unbound variable usage
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=307acb072b68956bf7c...
Commit: 307acb072b68956bf7c08dc88b6927f6abf3d2e4
Parent: da7ec2ec0f19dca9266ecb2a653485491cae850a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Dec 7 16:16:55 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Dec 8 22:17:17 2020 +0100
fsadm: fix unbound variable usage
When 'fsadm resize vg/lv' is used without size, it should just
resize filesystem to match device - but since we now check
for unbound variable in bash - the previous usage no longer
works and needs explicit check.
---
scripts/fsadm.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 9b95d318d..2cb1fc75b 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -798,6 +798,7 @@ fi
CHECK=""
RESIZE=""
+NEWSIZE=""
while [ "$#" -ne 0 ]
do
@@ -811,8 +812,11 @@ do
"-y"|"--yes") YES="-y" ;;
"-l"|"--lvresize") DO_LVRESIZE=1 ;;
"-c"|"--cryptresize") DO_CRYPTRESIZE=1 ;;
- "check") CHECK=$2 ; shift ;;
- "resize") RESIZE=$2 ; NEWSIZE=$3 ; shift 2 ;;
+ "check") test -z "${2-}" && error "Missing <device>. (see: $TOOL --help)"
+ CHECK=$2 ; shift ;;
+ "resize") test -z "${2-}" && error "Missing <device>. (see: $TOOL --help)"
+ RESIZE=$2 ; shift
+ if test -n "${2-}" ; then NEWSIZE="${2-}" ; shift ; fi ;;
*) error "Wrong argument \"$1\". (see: $TOOL --help)"
esac
shift
2 years, 11 months
main - tests: few more fsadm checks
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=57594fe673587ea33a6...
Commit: 57594fe673587ea33a6521733376862055ecbd65
Parent: 47608ff49b874f2a34b9d8644f53028d5ffa1fd3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Dec 7 16:20:00 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Dec 8 20:32:34 2020 +0100
tests: few more fsadm checks
---
test/shell/fsadm.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/test/shell/fsadm.sh b/test/shell/fsadm.sh
index 910edddd8..67f9660e6 100644
--- a/test/shell/fsadm.sh
+++ b/test/shell/fsadm.sh
@@ -96,9 +96,19 @@ lvcreate -n $lv1 -L20M $vg
lvcreate -n ${lv1}bar -L10M $vg
trap 'cleanup_mounted_and_teardown' EXIT
+# prints help
+fsadm
+
+# check needs arg
+not fsadm check
+
if check_missing ext2; then
mkfs.ext2 -b4096 -j "$dev_vg_lv"
+ # Check 'check' works
+ fsadm check $vg_lv
+ # Check 'resize' without size parameter works
+ fsadm resize $vg_lv
fsadm --lvresize resize $vg_lv 30M
# Fails - not enough space for 4M fs
not fsadm -y --lvresize resize "$dev_vg_lv" 4M
2 years, 11 months
main - fsadm: fix unbound variable usage
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=47608ff49b874f2a34b...
Commit: 47608ff49b874f2a34b9d8644f53028d5ffa1fd3
Parent: 7691213a91ca7cc2d5518db31d04c8afa74622e7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Dec 7 16:16:55 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Dec 8 20:32:34 2020 +0100
fsadm: fix unbound variable usage
When 'fsadm resize vg/lv' is used without size, it should just
resize filesystem to match device - but since we now check
for unbound variable in bash - the previous usage no longer
works and needs explicit check.
---
scripts/fsadm.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 9b95d318d..2cb1fc75b 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -798,6 +798,7 @@ fi
CHECK=""
RESIZE=""
+NEWSIZE=""
while [ "$#" -ne 0 ]
do
@@ -811,8 +812,11 @@ do
"-y"|"--yes") YES="-y" ;;
"-l"|"--lvresize") DO_LVRESIZE=1 ;;
"-c"|"--cryptresize") DO_CRYPTRESIZE=1 ;;
- "check") CHECK=$2 ; shift ;;
- "resize") RESIZE=$2 ; NEWSIZE=$3 ; shift 2 ;;
+ "check") test -z "${2-}" && error "Missing <device>. (see: $TOOL --help)"
+ CHECK=$2 ; shift ;;
+ "resize") test -z "${2-}" && error "Missing <device>. (see: $TOOL --help)"
+ RESIZE=$2 ; shift
+ if test -n "${2-}" ; then NEWSIZE="${2-}" ; shift ; fi ;;
*) error "Wrong argument \"$1\". (see: $TOOL --help)"
esac
shift
2 years, 11 months
main - man: update lvmvdo
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7691213a91ca7cc2d55...
Commit: 7691213a91ca7cc2d5518db31d04c8afa74622e7
Parent: 9b3458d5a945302a68e4f5ed3011f01677411e9b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Dec 7 17:04:49 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Dec 8 20:32:34 2020 +0100
man: update lvmvdo
Fix vdo example.
Update some sentences.
---
man/lvmvdo.7_main | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/man/lvmvdo.7_main b/man/lvmvdo.7_main
index 39dee3914..474d6dd73 100644
--- a/man/lvmvdo.7_main
+++ b/man/lvmvdo.7_main
@@ -16,7 +16,7 @@ and also eliminates any blocks of all zeroes.
With deduplication, instead of writing the same data more than once, VDO detects and records each
duplicate block as a reference to the original
-block. VDO maintains a mapping from logical block addresses (used by the
+block. VDO maintains a mapping from Logical Block Addresses (LBA) (used by the
storage layer above VDO) to physical block addresses (used by the storage
layer under VDO). After deduplication, multiple logical block addresses
may be mapped to the same physical block address; these are called shared
@@ -59,7 +59,7 @@ VDOPoolLV
.br
VDO pool LV
.br
-A pool for virtual VDOLV(s) with the size of used VDODataLV.
+A pool for virtual VDOLV(s), which are the size of used VDODataLV.
.br
Only a single VDOLV is currently supported.
.TP
@@ -72,7 +72,7 @@ Created from VDOPoolLV.
Appears blank after creation.
.SH VDO USAGE
The primary methods for using VDO with lvm2:
-.SS 1. Create VDOPoolLV with VDOLV
+.SS 1. Create a VDOPoolLV and a VDOLV
Create a VDOPoolLV that will hold VDO data, and a
virtual size VDOLV that the user can use. If you do not specify the virtual size,
then the VDOLV is created with the maximum size that
@@ -97,9 +97,9 @@ operation.
# lvcreate --type vdo -n vdo0 -L 10G -V 100G vg/vdopool0
# mkfs.ext4 -E nodiscard /dev/vg/vdo0
.fi
-.SS 2. Create VDOPoolLV from conversion of an existing LV into VDODataLV
-Convert an already created or existing LV into a volume that can hold
-VDO data and metadata (volume referenced by VDOPoolLV).
+.SS 2. Convert an existing LV into VDOPoolLV
+Convert an already created or existing LV into a VDOPoolLV, which is a volume
+that can hold data and metadata.
You will be prompted to confirm such conversion because it \fBIRREVERSIBLY
DESTROYS\fP the content of such volume and the volume is immediately
formatted by \fBvdoformat\fP(8) as a VDO pool data volume. You can
@@ -238,7 +238,8 @@ a long time.
.fi
.SS 8. Component activation of a VDODataLV
You can activate a VDODataLV separately as a component LV for examination
-purposes. It activates the data LV in read-only mode, and the data LV cannot be modified.
+purposes. The activation of the VDODataLV activates the data LV in read-only mode,
+and the data LV cannot be modified.
If the VDODataLV is active as a component, any upper LV using this volume CANNOT
be activated. You have to deactivate the VDODataLV first to continue to use the VDOPoolLV.
@@ -280,7 +281,7 @@ it hits the processing of the VDO Pool LV layer.
.I Example
.nf
-# lvcreate -L 5G -V 10G -n vdo1 vg/vdopool
+# lvcreate --type vdo -L 5G -V 10G -n vdo1 vg/vdopool
# lvcreate --type cache-pool -L 1G -n cachepool vg
# lvconvert --cache --cachepool vg/cachepool vg/vdo1
# lvconvert --uncache vg/vdo1
@@ -292,13 +293,13 @@ and takes a considerable amount of time and CPU.
Unless you really need it, you should avoid using discard.
When a block device is going to be rewritten,
-block will be automatically reused for new data.
-Discard is useful in situations when it is known that the given portion of a VDO LV
+its blocks will be automatically reused for new data.
+Discard is useful in situations when user knows that the given portion of a VDO LV
is not going to be used and the discarded space can be used for block
provisioning in other regions of the VDO LV.
For the same reason, you should avoid using mkfs with discard for
a freshly created VDO LV to save a lot of time that this operation would
-take otherwise as device after create empty.
+take otherwise as device is already expected to be empty.
.SS 6. Memory usage
The VDO target requires 370 MiB of RAM plus an additional 268 MiB
per each 1 TiB of physical storage managed by the volume.
2 years, 11 months
main - man lvmcache: add writecache cleaner info
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9b3458d5a945302a68e...
Commit: 9b3458d5a945302a68e4f5ed3011f01677411e9b
Parent: a2affffed558899af563b790eaf5112b8c7e5bd5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 2 15:29:21 2020 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Dec 2 15:29:21 2020 -0600
man lvmcache: add writecache cleaner info
---
man/lvmcache.7_main | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/man/lvmcache.7_main b/man/lvmcache.7_main
index 37d0e3359..85d4d9e34 100644
--- a/man/lvmcache.7_main
+++ b/man/lvmcache.7_main
@@ -303,6 +303,16 @@ afterwards. Some underlying devices perform better with fua, some with
nofua. Testing is necessary to determine which.
Applicable only to persistent memory.
+.IP \[bu] 2
+cleaner = 0|1
+
+Setting cleaner=1 enables the writecache cleaner mode in which data is
+gradually flushed from the cache. If this is done prior to detaching the
+writecache, then the splitcache command will have little or no flushing to
+perform. If not done beforehand, the splitcache command enables the
+cleaner mode and waits for flushing to complete before detaching the
+writecache. Adding cleaner=0 to the splitcache command will skip the
+cleaner mode, and any required flushing is performed in device suspend.
.SS dm-cache with separate data and metadata LVs
3 years