master - udev: also print subsystem udev flags in debug message about udev flags + fix typo DM_SUBSSYTEM_UDEV_FLAG7 -> DM_SUBSYSTEM_UDEV_FLAG7
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1569e7a4985776...
Commit: 1569e7a4985776783fa0175ddfa6dd333a68b981
Parent: b3539907f582a924df1c056829a231d1d39e4cec
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue May 27 14:44:11 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue May 27 14:44:11 2014 +0200
udev: also print subsystem udev flags in debug message about udev flags + fix typo DM_SUBSSYTEM_UDEV_FLAG7 -> DM_SUBSYSTEM_UDEV_FLAG7
---
libdm/libdevmapper.h | 2 +-
libdm/libdm-common.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 990692c..386ef07 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1877,7 +1877,7 @@ struct dm_pool *dm_config_memory(struct dm_config_tree *cft);
#define DM_SUBSYSTEM_UDEV_FLAG4 0x1000
#define DM_SUBSYSTEM_UDEV_FLAG5 0x2000
#define DM_SUBSYSTEM_UDEV_FLAG6 0x4000
-#define DM_SUBSSYTEM_UDEV_FLAG7 0x8000
+#define DM_SUBSYSTEM_UDEV_FLAG7 0x8000
int dm_cookie_supported(void);
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index bb793e3..ea5b97e 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -2426,7 +2426,8 @@ int dm_task_set_cookie(struct dm_task *dmt, uint32_t *cookie, uint16_t flags)
dmt->cookie_set = 1;
log_debug_activation("Udev cookie 0x%" PRIx32 " (semid %d) assigned to "
- "%s task(%d) with flags%s%s%s%s%s%s%s (0x%" PRIx16 ")", *cookie, semid, _task_type_disp(dmt->type), dmt->type,
+ "%s task(%d) with flags%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s (0x%" PRIx16 ")",
+ *cookie, semid, _task_type_disp(dmt->type), dmt->type,
(flags & DM_UDEV_DISABLE_DM_RULES_FLAG) ? " DISABLE_DM_RULES" : "",
(flags & DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG) ? " DISABLE_SUBSYSTEM_RULES" : "",
(flags & DM_UDEV_DISABLE_DISK_RULES_FLAG) ? " DISABLE_DISK_RULES" : "",
@@ -2434,6 +2435,14 @@ int dm_task_set_cookie(struct dm_task *dmt, uint32_t *cookie, uint16_t flags)
(flags & DM_UDEV_LOW_PRIORITY_FLAG) ? " LOW_PRIORITY" : "",
(flags & DM_UDEV_DISABLE_LIBRARY_FALLBACK) ? " DISABLE_LIBRARY_FALLBACK" : "",
(flags & DM_UDEV_PRIMARY_SOURCE_FLAG) ? " PRIMARY_SOURCE" : "",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG0) ? " SUBSYSTEM_0" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG1) ? " SUBSYSTEM_1" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG2) ? " SUBSYSTEM_2" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG3) ? " SUBSYSTEM_3" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG4) ? " SUBSYSTEM_4" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG5) ? " SUBSYSTEM_5" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG6) ? " SUBSYSTEM_6" : " ",
+ (flags & DM_SUBSYSTEM_UDEV_FLAG7) ? " SUBSYSTEM_7" : " ",
flags);
return 1;
9 years, 11 months
master - tests: support thin_restore configurable
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b3539907f582a9...
Commit: b3539907f582a924df1c056829a231d1d39e4cec
Parent: b0ff3359f268913dbe01179600aa69c008cbb1ec
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 26 23:28:03 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 23:30:09 2014 +0200
tests: support thin_restore configurable
Currently this tool is used only in tests.
---
configure | 126 +++++++++++++++++++++++++
configure.in | 17 ++++
lib/misc/configure.h.in | 3 +
test/Makefile.in | 10 +-
test/shell/lvextend-thin-metadata-dmeventd.sh | 7 +-
5 files changed, 156 insertions(+), 7 deletions(-)
diff --git a/configure b/configure
index 49a89c2..7738c8f 100755
--- a/configure
+++ b/configure
@@ -767,6 +767,7 @@ PKGCONFIGINIT_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
+THIN_RESTORE_CMD
THIN_REPAIR_CMD
THIN_DUMP_CMD
THIN_CHECK_CMD
@@ -869,6 +870,7 @@ with_thin
with_thin_check
with_thin_dump
with_thin_repair
+with_thin_restore
enable_thin_check_needs_check
with_cache
enable_readline
@@ -1655,6 +1657,8 @@ Optional Packages:
--with-thin-check=PATH thin_check tool: [[autodetect]]
--with-thin-dump=PATH thin_dump tool: [[autodetect]]
--with-thin-repair=PATH thin_repair tool: [[autodetect]]
+ --with-thin-restore=PATH
+ thin_restore tool: [[autodetect]]
--with-cache=TYPE cache support: internal/shared/none [[TYPE=none]]
--with-ocfdir=DIR install OCF files in DIR
[[PREFIX/lib/ocf/resource.d/lvm2]]
@@ -7197,6 +7201,14 @@ else
fi
+# Check whether --with-thin-restore was given.
+if test "${with_thin_restore+set}" = set; then :
+ withval=$with_thin_restore; THIN_RESTORE_CMD=$withval
+else
+ THIN_RESTORE_CMD="autodetect"
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN" >&5
$as_echo "$THIN" >&6; }
@@ -7558,6 +7570,113 @@ $as_echo "$as_me: WARNING: thin_repair not found in path $PATH" >&2;}
THIN_CONFIGURE_WARN=y
}
fi
+ # Empty means a config way to ignore thin checking
+ if test "$THIN_RESTORE_CMD" = "autodetect"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}thin_restore", so it can be a program name with args.
+set dummy ${ac_tool_prefix}thin_restore; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_THIN_RESTORE_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $THIN_RESTORE_CMD in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_THIN_RESTORE_CMD="$THIN_RESTORE_CMD" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_THIN_RESTORE_CMD="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+THIN_RESTORE_CMD=$ac_cv_path_THIN_RESTORE_CMD
+if test -n "$THIN_RESTORE_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN_RESTORE_CMD" >&5
+$as_echo "$THIN_RESTORE_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_THIN_RESTORE_CMD"; then
+ ac_pt_THIN_RESTORE_CMD=$THIN_RESTORE_CMD
+ # Extract the first word of "thin_restore", so it can be a program name with args.
+set dummy thin_restore; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_THIN_RESTORE_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_THIN_RESTORE_CMD in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_THIN_RESTORE_CMD="$ac_pt_THIN_RESTORE_CMD" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_THIN_RESTORE_CMD="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_THIN_RESTORE_CMD=$ac_cv_path_ac_pt_THIN_RESTORE_CMD
+if test -n "$ac_pt_THIN_RESTORE_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_THIN_RESTORE_CMD" >&5
+$as_echo "$ac_pt_THIN_RESTORE_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_THIN_RESTORE_CMD" = x; then
+ THIN_RESTORE_CMD=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ THIN_RESTORE_CMD=$ac_pt_THIN_RESTORE_CMD
+ fi
+else
+ THIN_RESTORE_CMD="$ac_cv_path_THIN_RESTORE_CMD"
+fi
+
+ test -z "$THIN_RESTORE_CMD" && {
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thin_restore not found in path $PATH" >&5
+$as_echo "$as_me: WARNING: thin_restore not found in path $PATH" >&2;}
+ THIN_RESTORE_CMD=/usr/sbin/thin_restore
+ THIN_CONFIGURE_WARN=y
+ }
+ fi
;;
esac
@@ -7589,6 +7708,12 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define THIN_RESTORE_CMD "$THIN_RESTORE_CMD"
+_ACEOF
+
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include cache" >&5
$as_echo_n "checking whether to include cache... " >&6; }
@@ -11529,6 +11654,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile conf/Makefile conf/example.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile
python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
diff --git a/configure.in b/configure.in
index 6fbba27..16e63c0 100644
--- a/configure.in
+++ b/configure.in
@@ -422,6 +422,10 @@ AC_ARG_WITH(thin-repair,
AC_HELP_STRING([--with-thin-repair=PATH],
[thin_repair tool: [[autodetect]]]),
THIN_REPAIR_CMD=$withval, THIN_REPAIR_CMD="autodetect")
+AC_ARG_WITH(thin-restore,
+ AC_HELP_STRING([--with-thin-restore=PATH],
+ [thin_restore tool: [[autodetect]]]),
+ THIN_RESTORE_CMD=$withval, THIN_RESTORE_CMD="autodetect")
AC_MSG_RESULT($THIN)
@@ -484,6 +488,15 @@ case "$THIN" in
THIN_CONFIGURE_WARN=y
}
fi
+ # Empty means a config way to ignore thin checking
+ if test "$THIN_RESTORE_CMD" = "autodetect"; then
+ AC_PATH_TOOL(THIN_RESTORE_CMD, thin_restore)
+ test -z "$THIN_RESTORE_CMD" && {
+ AC_MSG_WARN(thin_restore not found in path $PATH)
+ THIN_RESTORE_CMD=/usr/sbin/thin_restore
+ THIN_CONFIGURE_WARN=y
+ }
+ fi
;;
esac
@@ -502,6 +515,9 @@ AC_DEFINE_UNQUOTED([THIN_DUMP_CMD], ["$THIN_DUMP_CMD"],
AC_DEFINE_UNQUOTED([THIN_REPAIR_CMD], ["$THIN_REPAIR_CMD"],
[The path to 'thin_repair', if available.])
+AC_DEFINE_UNQUOTED([THIN_RESTORE_CMD], ["$THIN_RESTORE_CMD"],
+ [The path to 'thin_restore', if available.])
+
################################################################################
dnl -- cache inclusion type
AC_MSG_CHECKING(whether to include cache)
@@ -1739,6 +1755,7 @@ AC_SUBST(THIN)
AC_SUBST(THIN_CHECK_CMD)
AC_SUBST(THIN_DUMP_CMD)
AC_SUBST(THIN_REPAIR_CMD)
+AC_SUBST(THIN_RESTORE_CMD)
AC_SUBST(UDEV_PC)
AC_SUBST(UDEV_RULES)
AC_SUBST(UDEV_SYNC)
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index ead131c..c618ff4 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -562,6 +562,9 @@
/* The path to 'thin_repair', if available. */
#undef THIN_REPAIR_CMD
+/* The path to 'thin_restore', if available. */
+#undef THIN_RESTORE_CMD
+
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
diff --git a/test/Makefile.in b/test/Makefile.in
index 1538fa3..370d9bd 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -28,6 +28,7 @@ LVM_TEST_RESULTS ?= results
export LVM_TEST_THIN_CHECK_CMD?=@THIN_CHECK_CMD@
export LVM_TEST_THIN_DUMP_CMD?=@THIN_DUMP_CMD@
export LVM_TEST_THIN_REPAIR_CMD?=@THIN_REPAIR_CMD@
+export LVM_TEST_THIN_RESTORE_CMD?=@THIN_RESTORE_CMD@
SUBDIRS = api unit
SOURCES = lib/not.c lib/harness.c
@@ -68,15 +69,16 @@ help:
@echo -e "\nSupported variables:"
@echo " LVM_TEST_CAN_CLOBBER_DMESG Allow to clobber dmesg buffer without /dev/kmsg. (1)"
@echo " LVM_TEST_DEVDIR Set to '/dev' to run on real /dev."
- @echo " LVM_TEST_DIR Where to create test files [$(LVM_TEST_DIR)]."
+ @echo " LVM_TEST_DIR Where to create test files [$(LVM_TEST_DIR)]."
@echo " LVM_TEST_LOCKING Normal (1), Cluster (3)."
@echo " LVM_TEST_LVMETAD Start lvmetad (1)."
@echo " LVM_TEST_NODEBUG Do not debug lvm commands."
@echo " LVM_TEST_PARALLEL May skip agresive wipe of LVMTEST resources."
@echo " LVM_TEST_RESULTS Where to create result files [results]."
- @echo " LVM_TEST_THIN_CHECK_CMD Command for thin_check [$(LVM_TEST_THIN_CHECK_CMD)]."
- @echo " LVM_TEST_THIN_DUMP_CMD Command for thin_dump [$(LVM_TEST_THIN_DUMP_CMD)]."
- @echo " LVM_TEST_THIN_REPAIR_CMD Command for thin_repair [$(LVM_TEST_THIN_REPAIR_CMD)]."
+ @echo " LVM_TEST_THIN_CHECK_CMD Command for thin_check [$(LVM_TEST_THIN_CHECK_CMD)]."
+ @echo " LVM_TEST_THIN_DUMP_CMD Command for thin_dump [$(LVM_TEST_THIN_DUMP_CMD)]."
+ @echo " LVM_TEST_THIN_REPAIR_CMD Command for thin_repair [$(LVM_TEST_THIN_REPAIR_CMD)]."
+ @echo " LVM_TEST_THIN_RESTORE_CMD Command for thin_restore [$(LVM_TEST_THIN_RESTORE_CMD)]."
@echo " LVM_TEST_UNLIMITED Set to get unlimited test log (>32MB)"
@echo " LVM_VALGRIND Enable valgrind testing (1,2,3) execs $$"VALGRIND
@echo " LVM_VALGRIND_CLVMD Enable valgrind testing of clvmd (1)."
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index cb5261c..6e03d9d 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -42,6 +42,7 @@ fake_metadata_() {
echo "</superblock>"
}
+test -n "$LVM_TEST_THIN_RESTORE_CMD" || LVM_TEST_THIN_RESTORE_CMD=$(which thin_restore) || skip
aux have_thin 1 10 0 || skip
aux prepare_dmeventd
@@ -61,7 +62,7 @@ lvchange -an $vg/thin $vg/pool
# Prepare some fake metadata with unmatching id
# Transaction_id is lower by 1 and there are no message -> ERROR
fake_metadata_ 10 0 >data
-thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
+$LVM_TEST_THIN_RESTORE_CMD -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
not vgchange -ay $vg 2>&1 | tee out
grep expected out
@@ -70,7 +71,7 @@ check inactive $vg pool_tmeta
# Transaction_id is higher by 1
fake_metadata_ 10 2 >data
-thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
+$LVM_TEST_THIN_RESTORE_CMD -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
not vgchange -ay $vg 2>&1 | tee out
grep expected out
@@ -79,7 +80,7 @@ check inactive $vg pool_tmeta
# Prepare some fake metadata prefilled to ~81% (>70%)
fake_metadata_ 400 1 >data
-thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
+$LVM_TEST_THIN_RESTORE_CMD -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
# Swap volume with restored fake metadata
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
9 years, 11 months
master - tests: update aux disable_dev
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b0ff3359f26891...
Commit: b0ff3359f268913dbe01179600aa69c008cbb1ec
Parent: 49521f4e563fe0a19e70413f740e831f5fd16e16
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 26 15:58:09 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 22:57:28 2014 +0200
tests: update aux disable_dev
disable_dev can't use transaction - since it may lead occasionaly to
weird error - example could be nomda-missing.sh test case.
Here occasionaly device instead of being removed was left as
error device and testing different code path (which is unfortunatelly
buggy)
When we want to test 'error' device - 'aux error_dev()' should be used.
---
test/lib/aux.sh | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 07ba576..9a13cc8 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -407,7 +407,6 @@ disable_dev() {
local dev
udev_wait
- init_udev_transaction
for dev in "$@"; do
maj=$(($(stat -L --printf=0x%t "$dev")))
min=$(($(stat -L --printf=0x%T "$dev")))
@@ -415,7 +414,6 @@ disable_dev() {
dmsetup remove -f "$dev" 2>/dev/null || true
notify_lvmetad --major "$maj" --minor "$min"
done
- finish_udev_transaction
}
enable_dev() {
@@ -699,7 +697,7 @@ raid456_replace_works() {
3.6.*.fc18.i686*|3.6.*.fc18.x86_64) return 1 ;;
3.9.*.fc19.i686*|3.9.*.fc19.x86_64) return 1 ;;
3.1[0123].*.fc18.i686*|3.1[0123].*.fc18.x86_64) return 1 ;;
- 3.1[0123].*.fc19.i686*|3.1[0123].*.fc19.x86_64) return 1 ;;
+ 3.1[01234].*.fc19.i686*|3.1[01234].*.fc19.x86_64) return 1 ;;
3.13.*.fc20.i686*|3.13.*.fc20.x86_64) return 1 ;;
3.14.*.fc21.i686*|3.14.*.fc21.x86_64) return 1 ;;
3.15.*rc6*.fc21.i686*|3.15.*rc6*.fc21.x86_64) return 1 ;;
9 years, 11 months
master - cleanup: internal error for impossible path
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=49521f4e563fe0...
Commit: 49521f4e563fe0a19e70413f740e831f5fd16e16
Parent: 965592340d04f02096b800107591290c1ad44443
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 23 23:53:04 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 22:57:28 2014 +0200
cleanup: internal error for impossible path
Add 'default' path for impossible execution code path.
---
lib/device/dev-md.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c
index d6a7609..91cc322 100644
--- a/lib/device/dev-md.c
+++ b/lib/device/dev-md.c
@@ -60,7 +60,7 @@ typedef enum {
static uint64_t _v1_sb_offset(uint64_t size, md_minor_version_t minor_version)
{
- uint64_t uninitialized_var(sb_offset);
+ uint64_t sb_offset;
switch(minor_version) {
case MD_MINOR_V0:
@@ -72,6 +72,10 @@ static uint64_t _v1_sb_offset(uint64_t size, md_minor_version_t minor_version)
case MD_MINOR_V2:
sb_offset = 4 * 2;
break;
+ default:
+ log_warn(INTERNAL_ERROR "WARNING: Unknown minor version %d.",
+ minor_version);
+ return 0;
}
sb_offset <<= SECTOR_SHIFT;
9 years, 11 months
master - man: cleanup dmsetup
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=965592340d04f0...
Commit: 965592340d04f02096b800107591290c1ad44443
Parent: 3cb2658fb7ff0bba45e66e79bce8812c819dff52
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 26 22:55:31 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 22:57:20 2014 +0200
man: cleanup dmsetup
Add few bold texts.
---
man/dmsetup.8.in | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index ae84489..9a738fb 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -426,11 +426,11 @@ that contain a version of device-mapper prior to 4.8.0.
In this case the device will be deleted when its open_count
drops to zero. From version 4.8.0 onwards, if a device can't
be removed because an uninterruptible process is waiting for
-I/O to return from it, adding \-\-force will replace the table
+I/O to return from it, adding \fB\-\-force\fP will replace the table
with one that fails all I/O, which might allow the
process to be killed. If an attempt to remove a device fails,
perhaps because a process run from a quick udev rule
-temporarily opened the device, the \-\-retry option will cause
+temporarily opened the device, the \fB\-\-retry\fP option will cause
the operation to be retried for a few seconds before failing.
Do NOT combine \fB\-\-force\fP and \fB\-\-udevcookie\fP,
as udev may start to process udev rules in the middle of error target
@@ -443,7 +443,7 @@ replacement and result in nondeterministic result.
Attempts to remove all device definitions i.e. reset the driver.
Use with care! From version 4.8.0 onwards, if devices can't
be removed because uninterruptible processes are waiting for
-I/O to return from them, adding \-\-force will replace the table
+I/O to return from them, adding \fB\-\-force\fP will replace the table
with one that fails all I/O, which might allow the
process to be killed. This also runs \fBmknodes\fP afterwards.
.br
@@ -494,7 +494,7 @@ Default subsystem is LVM.
.RI [ device_name ]
.br
Outputs status information for each of the device's targets.
-With \-\-target, only information relating to the specified target type
+With \fB\-\-target\fP, only information relating to the specified target type
any is displayed. With \fB\-\-noflush\fP, the thin target (from version 1.3.0)
doesn't commit any outstanding changes to disk before reporting its statistics.
.br
9 years, 11 months
master - dmsetup: add warning
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3cb2658fb7ff0b...
Commit: 3cb2658fb7ff0bba45e66e79bce8812c819dff52
Parent: 6e9105c7bb7f4a1beb34579303670e4510c7d2e6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 26 22:51:04 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 26 22:56:30 2014 +0200
dmsetup: add warning
Warn when --udevcookie/DM_UDEV_COOKIE is used with 'dmsetup remove --force'.
When command is doing multiple ioctl operations on a single device,
it may invoke udev activity, that is colliding with further ioctl commands.
The result of such operation becomes unpredictable.
Use of --retry could partially help...
---
WHATS_NEW_DM | 1 +
man/dmsetup.8.in | 6 ++++++
tools/dmsetup.c | 10 +++++++++-
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 6304ff6..8e221c1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.88 -
=================================
+ Warn user about incorrect use of cookie with 'dmsetup remove --force'.
Also recognize 'help'/'?' as reserved sort key name to show help.
Export recognized DM_REPORT_FIELD_RESERVED_NAME_{HELP,HELP_ALT} to show help.
Add dm_units_to_factor for size unit parsing.
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index 599c843..ae84489 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -243,6 +243,9 @@ Specify a one-line table directly on the command line.
.TP
.B \-\-udevcookie \fIcookie
Use cookie for udev synchronisation.
+Note: Same cookie should be used for same type of operations i.e. creation of
+multiple different devices. It's not adviced to combine different
+operations on the single device.
.TP
.BR \-u | \-\-uuid
Specify the uuid.
@@ -429,6 +432,9 @@ process to be killed. If an attempt to remove a device fails,
perhaps because a process run from a quick udev rule
temporarily opened the device, the \-\-retry option will cause
the operation to be retried for a few seconds before failing.
+Do NOT combine \fB\-\-force\fP and \fB\-\-udevcookie\fP,
+as udev may start to process udev rules in the middle of error target
+replacement and result in nondeterministic result.
.br
.HP
.B remove_all
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 4433571..f84d1a8 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -1498,8 +1498,16 @@ error:
static int _remove(CMD_ARGS)
{
- if (_switches[FORCE_ARG] && argc > 1)
+ if (_switches[FORCE_ARG] && argc > 1) {
+ /*
+ * 'remove --force' option is doing 2 operations on the same device
+ * this is not compatible with the use of --udevcookie/DM_UDEV_COOKIE.
+ * Udevd collision could be partially avoided with --retry.
+ */
+ if (_udev_cookie)
+ log_warn("WARNING: Use of cookie and --force is not compatible.");
(void) _error_device(cmd, argc, argv, NULL, 0);
+ }
return _simple(DM_DEVICE_REMOVE, argc > 1 ? argv[1] : NULL, 0, 0);
}
9 years, 11 months
master - cleanup: use const for endptr in dm_units_to_factor
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e9105c7bb7f4a...
Commit: 6e9105c7bb7f4a1beb34579303670e4510c7d2e6
Parent: cfe18d85c148c5d3c9407fac586b28b186471615
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon May 26 12:09:01 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon May 26 12:09:01 2014 +0200
cleanup: use const for endptr in dm_units_to_factor
---
libdm/libdevmapper.h | 2 +-
libdm/libdm-string.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index d63b135..990692c 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1496,7 +1496,7 @@ int dm_strncpy(char *dest, const char *src, size_t n);
* Returns the unit factor or 0 if no unit is recognized.
*/
uint64_t dm_units_to_factor(const char *units, char *unit_type,
- int strict, char **endptr);
+ int strict, const char **endptr);
/**************************
* file/stream manipulation
diff --git a/libdm/libdm-string.c b/libdm/libdm-string.c
index 7336e6b..8ad479c 100644
--- a/libdm/libdm-string.c
+++ b/libdm/libdm-string.c
@@ -444,7 +444,7 @@ static int _close_enough(double d1, double d2)
}
uint64_t dm_units_to_factor(const char *units, char *unit_type,
- int strict, char **endptr)
+ int strict, const char **endptr)
{
char *ptr = NULL;
uint64_t v;
9 years, 11 months
master - tests: improve command coverage
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cfe18d85c148c5...
Commit: cfe18d85c148c5d3c9407fac586b28b186471615
Parent: b7476e91ef4370746f85e009becb65ef891cc3d0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 23 23:34:00 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 23 23:35:42 2014 +0200
tests: improve command coverage
---
test/shell/listings.sh | 1 +
test/shell/vgextend-restoremissing.sh | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/test/shell/listings.sh b/test/shell/listings.sh
index 2121ecd..7069707 100644
--- a/test/shell/listings.sh
+++ b/test/shell/listings.sh
@@ -94,6 +94,7 @@ pvscan -e
pvscan -s
pvscan --novolumegroup
vgscan --mknodes
+vgmknodes --refresh
lvscan
lvmdiskscan
diff --git a/test/shell/vgextend-restoremissing.sh b/test/shell/vgextend-restoremissing.sh
index 143bff7..8812c8c 100644
--- a/test/shell/vgextend-restoremissing.sh
+++ b/test/shell/vgextend-restoremissing.sh
@@ -16,15 +16,37 @@ aux prepare_vg 3
lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg
lvcreate -l 1 -n lv1 $vg "$dev1"
+# vgextend require vgname
+invalid vgextend
+# --metadatacopies => use --pvmetadatacopies
+invalid vgextend --metadatacopies 3 $vg "$dev1" |& tee out
+grep -- "use --pvmetadatacopies" out
+
+# VG name should exist
+fail vgextend --restoremissing $vg-invalid "$dev1"
+
# try to just change metadata; we expect the new version (with MISSING_PV set
# on the reappeared volume) to be written out to the previously missing PV
aux disable_dev "$dev1"
lvremove $vg/mirror
+# try restore the still existing device
+fail vgextend --restore $vg "$dev1"
aux enable_dev "$dev1"
not vgck $vg 2>&1 | tee log
grep "missing 1 physical volume" log
not lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # write operations fail
-vgextend --restore $vg "$dev1" # restore the missing device
+# try restore the non-missing device
+fail vgextend --restore $vg "$dev2"
+# try restore the non-existing device
+fail vgextend --restore $vg "$dev2-invalid"
+# restore the missing device
+vgextend --restore $vg "$dev1"
+
+vgreduce $vg "$dev3"
+vgchange --metadatacopies 1 $vg
+# 'n' failing to change volume group
+fail vgextend --metadataignore y --pvmetadatacopies 2 $vg "$dev3"
+vgextend --yes --metadataignore y --pvmetadatacopies 2 $vg "$dev3"
vgck $vg
lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg
9 years, 11 months
master - tests: add unusable kernel for raid5 testing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b7476e91ef4370...
Commit: b7476e91ef4370746f85e009becb65ef891cc3d0
Parent: c5c3995ed587aee6aaa15ea69df81c69a5bfbcd8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 23 22:40:31 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 23 23:35:42 2014 +0200
tests: add unusable kernel for raid5 testing
---
test/lib/aux.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 01bc1ea..07ba576 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -702,6 +702,7 @@ raid456_replace_works() {
3.1[0123].*.fc19.i686*|3.1[0123].*.fc19.x86_64) return 1 ;;
3.13.*.fc20.i686*|3.13.*.fc20.x86_64) return 1 ;;
3.14.*.fc21.i686*|3.14.*.fc21.x86_64) return 1 ;;
+ 3.15.*rc6*.fc21.i686*|3.15.*rc6*.fc21.x86_64) return 1 ;;
esac
}
9 years, 11 months
master - tests: increase min version for raid testing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c5c3995ed587ae...
Commit: c5c3995ed587aee6aaa15ea69df81c69a5bfbcd8
Parent: 3f8048f28c45101fde391c3609a97ca116b8e92c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 23 22:35:05 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 23 23:35:42 2014 +0200
tests: increase min version for raid testing
Seems smaller version are causing weird kernel lookups.
---
test/shell/lvchange-partial.sh | 2 +-
test/shell/lvconvert-raid.sh | 2 +-
test/shell/lvconvert-raid456.sh | 2 +-
test/shell/lvconvert-repair-raid-dmeventd.sh | 2 +-
test/shell/lvconvert-repair-raid.sh | 2 +-
test/shell/lvcreate-large-raid.sh | 2 +-
test/shell/lvcreate-raid.sh | 2 +-
test/shell/lvresize-raid.sh | 2 +-
test/shell/vgsplit-raid.sh | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/shell/lvchange-partial.sh b/test/shell/lvchange-partial.sh
index c3d7217..3db1b4f 100644
--- a/test/shell/lvchange-partial.sh
+++ b/test/shell/lvchange-partial.sh
@@ -15,7 +15,7 @@
aux prepare_vg 4
TYPE=raid1
-aux have_raid 1 1 0 || TYPE=mirror
+aux have_raid 1 3 0 || TYPE=mirror
lvcreate -aey --type $TYPE -m 1 -l 2 -n $lv1 $vg
lvchange -an $vg/$lv1
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 2a498b2..e17d90e 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -22,7 +22,7 @@ get_image_pvs() {
########################################################
# MAIN
########################################################
-aux have_raid 1 2 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_pvs 5
vgcreate -s 256k $vg $(cat DEVICES)
diff --git a/test/shell/lvconvert-raid456.sh b/test/shell/lvconvert-raid456.sh
index b9386c9..38f8ed5 100644
--- a/test/shell/lvconvert-raid456.sh
+++ b/test/shell/lvconvert-raid456.sh
@@ -23,7 +23,7 @@ get_image_pvs() {
# MAIN
########################################################
aux raid456_replace_works || skip
-aux have_raid 1 2 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_pvs 6
vgcreate -s 256k $vg $(cat DEVICES)
diff --git a/test/shell/lvconvert-repair-raid-dmeventd.sh b/test/shell/lvconvert-repair-raid-dmeventd.sh
index f83e722..6766faa 100644
--- a/test/shell/lvconvert-repair-raid-dmeventd.sh
+++ b/test/shell/lvconvert-repair-raid-dmeventd.sh
@@ -12,7 +12,7 @@
. lib/test
which mkfs.ext3 || skip
-aux have_raid 1 1 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_dmeventd
aux prepare_vg 5
diff --git a/test/shell/lvconvert-repair-raid.sh b/test/shell/lvconvert-repair-raid.sh
index df64f3b..8ba27b8 100644
--- a/test/shell/lvconvert-repair-raid.sh
+++ b/test/shell/lvconvert-repair-raid.sh
@@ -11,7 +11,7 @@
. lib/test
-aux have_raid 1 1 0 || skip
+aux have_raid 1 3 0 || skip
aux raid456_replace_works || skip
aux lvmconf 'allocation/maximise_cling = 0'
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index 84110ab..57a7765 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -16,7 +16,7 @@
# FIXME update test to make something useful on <16T
aux can_use_16T || skip
-aux have_raid 1 1 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_vg 5
diff --git a/test/shell/lvcreate-raid.sh b/test/shell/lvcreate-raid.sh
index d9c949a..76a606f 100644
--- a/test/shell/lvcreate-raid.sh
+++ b/test/shell/lvcreate-raid.sh
@@ -18,7 +18,7 @@ lv_devices() {
########################################################
# MAIN
########################################################
-aux have_raid 1 1 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_pvs 6 20 # 6 devices for RAID10 (2-mirror,3-stripe) test
vgcreate -s 512k $vg $(cat DEVICES)
diff --git a/test/shell/lvresize-raid.sh b/test/shell/lvresize-raid.sh
index e13a08d..d5288f8 100644
--- a/test/shell/lvresize-raid.sh
+++ b/test/shell/lvresize-raid.sh
@@ -11,7 +11,7 @@
. lib/test
-aux have_raid 1 1 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_pvs 6 80
diff --git a/test/shell/vgsplit-raid.sh b/test/shell/vgsplit-raid.sh
index 6454556..3174e88 100644
--- a/test/shell/vgsplit-raid.sh
+++ b/test/shell/vgsplit-raid.sh
@@ -21,7 +21,7 @@ create_vg_() {
vgcreate -s 64k "$@"
}
-aux have_raid 1 1 0 || skip
+aux have_raid 1 3 0 || skip
aux prepare_pvs 5 10
9 years, 11 months