mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: add thin_repair and thin_dump options
Add new configure lvm.conf options for binaries thin_repair and thin_dump. Those are part of device-mapper-persistent-data package and will be used for recovery of thin_pool.
This commit is contained in:
parent
ea605d1ec7
commit
22fc80982a
@ -1,5 +1,7 @@
|
|||||||
Version 2.02.100 -
|
Version 2.02.100 -
|
||||||
================================
|
================================
|
||||||
|
Add --with-thin-repair and --with-thin-dump configure options.
|
||||||
|
Add lvm.conf thin_repair/dump_executable and thin_repair_options.
|
||||||
Require 1.9 thin pool target version for online thin pool metadata resize.
|
Require 1.9 thin pool target version for online thin pool metadata resize.
|
||||||
Ignore previous LV seg with alloc contiguous & cling when num stripes varies.
|
Ignore previous LV seg with alloc contiguous & cling when num stripes varies.
|
||||||
Fix segfault if devices/global_filter is not specified correctly.
|
Fix segfault if devices/global_filter is not specified correctly.
|
||||||
|
@ -561,11 +561,29 @@ global {
|
|||||||
# The thin tools are available as part of the device-mapper-persistent-data
|
# The thin tools are available as part of the device-mapper-persistent-data
|
||||||
# package from https://github.com/jthornber/thin-provisioning-tools.
|
# package from https://github.com/jthornber/thin-provisioning-tools.
|
||||||
#
|
#
|
||||||
thin_check_executable = "@THIN_CHECK_CMD@"
|
# thin_check_executable = "@THIN_CHECK_CMD@"
|
||||||
|
|
||||||
# String with options passed with thin_check command. By default,
|
# Array of string options passed with thin_check command. By default,
|
||||||
# option '-q' is for quiet output.
|
# option "-q" is for quiet output.
|
||||||
thin_check_options = [ "-q" ]
|
# With thin_check version 2.1 or newer you can add "--ignore-non-fatal-errors"
|
||||||
|
# to let it pass through ignoreable errors and fix them later.
|
||||||
|
#
|
||||||
|
# thin_check_options = [ "-q" ]
|
||||||
|
|
||||||
|
# Full path of the utility called to repair a thin metadata device
|
||||||
|
# is in a state that allows it to be used.
|
||||||
|
# Each time a thin pool needs repair this utility is executed.
|
||||||
|
# See thin_check_executable how to obtain binaries.
|
||||||
|
#
|
||||||
|
# thin_repair_executable = "@THIN_REPAIR_CMD@"
|
||||||
|
|
||||||
|
# Array of extra string options passed with thin_repair command.
|
||||||
|
# thin_repair_options = [ "" ]
|
||||||
|
|
||||||
|
# Full path of the utility called to dump thin metadata content.
|
||||||
|
# See thin_check_executable how to obtain binaries.
|
||||||
|
#
|
||||||
|
# thin_dump_executable = "@THIN_DUMP_CMD@"
|
||||||
|
|
||||||
# If set, given features are not used by thin driver.
|
# If set, given features are not used by thin driver.
|
||||||
# This can be helpful not just for testing, but i.e. allows to avoid
|
# This can be helpful not just for testing, but i.e. allows to avoid
|
||||||
@ -574,6 +592,8 @@ global {
|
|||||||
# block_size
|
# block_size
|
||||||
# discards
|
# discards
|
||||||
# discards_non_power_2
|
# discards_non_power_2
|
||||||
|
# external_origin
|
||||||
|
# metadata_resize
|
||||||
#
|
#
|
||||||
# thin_disabled_features = [ "discards", "block_size" ]
|
# thin_disabled_features = [ "discards", "block_size" ]
|
||||||
}
|
}
|
||||||
|
124
configure
vendored
124
configure
vendored
@ -730,6 +730,8 @@ PKGCONFIGINIT_CFLAGS
|
|||||||
PKG_CONFIG_LIBDIR
|
PKG_CONFIG_LIBDIR
|
||||||
PKG_CONFIG_PATH
|
PKG_CONFIG_PATH
|
||||||
PKG_CONFIG
|
PKG_CONFIG
|
||||||
|
THIN_REPAIR_CMD
|
||||||
|
THIN_DUMP_CMD
|
||||||
THIN_CHECK_CMD
|
THIN_CHECK_CMD
|
||||||
POW_LIB
|
POW_LIB
|
||||||
LIBOBJS
|
LIBOBJS
|
||||||
@ -826,6 +828,8 @@ with_raid
|
|||||||
with_replicators
|
with_replicators
|
||||||
with_thin
|
with_thin
|
||||||
with_thin_check
|
with_thin_check
|
||||||
|
with_thin_dump
|
||||||
|
with_thin_repair
|
||||||
enable_readline
|
enable_readline
|
||||||
enable_realtime
|
enable_realtime
|
||||||
enable_ocf
|
enable_ocf
|
||||||
@ -1598,6 +1602,8 @@ Optional Packages:
|
|||||||
--with-thin=TYPE thin provisioning support: internal/shared/none
|
--with-thin=TYPE thin provisioning support: internal/shared/none
|
||||||
[[TYPE=none]]
|
[[TYPE=none]]
|
||||||
--with-thin-check=PATH thin_check tool: [[autodetect]]
|
--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-ocfdir=DIR install OCF files in DIR
|
--with-ocfdir=DIR install OCF files in DIR
|
||||||
[[PREFIX/lib/ocf/resource.d/lvm2]]
|
[[PREFIX/lib/ocf/resource.d/lvm2]]
|
||||||
--with-default-pid-dir=PID_DIR
|
--with-default-pid-dir=PID_DIR
|
||||||
@ -7108,6 +7114,110 @@ fi
|
|||||||
|
|
||||||
test -z "$THIN_CHECK_CMD" && as_fn_error $? "thin_check not found in path $PATH" "$LINENO" 5
|
test -z "$THIN_CHECK_CMD" && as_fn_error $? "thin_check not found in path $PATH" "$LINENO" 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check whether --with-thin-dump was given.
|
||||||
|
if test "${with_thin_dump+set}" = set; then :
|
||||||
|
withval=$with_thin_dump; THIN_DUMP_CMD=$withval
|
||||||
|
else
|
||||||
|
THIN_DUMP_CMD="autodetect"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Empty means a config way to ignore thin checking
|
||||||
|
if test "$THIN_DUMP_CMD" = "autodetect"; then
|
||||||
|
# Extract the first word of "thin_dump", so it can be a program name with args.
|
||||||
|
set dummy thin_dump; 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_DUMP_CMD+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
case $THIN_DUMP_CMD in
|
||||||
|
[\\/]* | ?:[\\/]*)
|
||||||
|
ac_cv_path_THIN_DUMP_CMD="$THIN_DUMP_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_DUMP_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_DUMP_CMD=$ac_cv_path_THIN_DUMP_CMD
|
||||||
|
if test -n "$THIN_DUMP_CMD"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN_DUMP_CMD" >&5
|
||||||
|
$as_echo "$THIN_DUMP_CMD" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
test -z "$THIN_DUMP_CMD" && as_fn_error $? "thin_dump not found in path $PATH" "$LINENO" 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check whether --with-thin-repair was given.
|
||||||
|
if test "${with_thin_repair+set}" = set; then :
|
||||||
|
withval=$with_thin_repair; THIN_REPAIR_CMD=$withval
|
||||||
|
else
|
||||||
|
THIN_REPAIR_CMD="autodetect"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Empty means a config way to ignore thin checking
|
||||||
|
if test "$THIN_REPAIR_CMD" = "autodetect"; then
|
||||||
|
# Extract the first word of "thin_repair", so it can be a program name with args.
|
||||||
|
set dummy thin_repair; 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_REPAIR_CMD+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
case $THIN_REPAIR_CMD in
|
||||||
|
[\\/]* | ?:[\\/]*)
|
||||||
|
ac_cv_path_THIN_REPAIR_CMD="$THIN_REPAIR_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_REPAIR_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_REPAIR_CMD=$ac_cv_path_THIN_REPAIR_CMD
|
||||||
|
if test -n "$THIN_REPAIR_CMD"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $THIN_REPAIR_CMD" >&5
|
||||||
|
$as_echo "$THIN_REPAIR_CMD" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
test -z "$THIN_REPAIR_CMD" && as_fn_error $? "thin_repair not found in path $PATH" "$LINENO" 5
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -7118,6 +7228,18 @@ _ACEOF
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define THIN_DUMP_CMD "$THIN_DUMP_CMD"
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define THIN_REPAIR_CMD "$THIN_REPAIR_CMD"
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable readline" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable readline" >&5
|
||||||
$as_echo_n "checking whether to enable readline... " >&6; }
|
$as_echo_n "checking whether to enable readline... " >&6; }
|
||||||
@ -10806,6 +10928,8 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
26
configure.in
26
configure.in
@ -424,12 +424,36 @@ case "$THIN" in
|
|||||||
AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
|
AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
|
||||||
test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
|
test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
|
||||||
fi
|
fi
|
||||||
|
AC_ARG_WITH(thin-dump,
|
||||||
|
AC_HELP_STRING([--with-thin-dump=PATH],
|
||||||
|
[thin_dump tool: [[autodetect]]]),
|
||||||
|
THIN_DUMP_CMD=$withval, THIN_DUMP_CMD="autodetect")
|
||||||
|
# Empty means a config way to ignore thin checking
|
||||||
|
if test "$THIN_DUMP_CMD" = "autodetect"; then
|
||||||
|
AC_PATH_PROG(THIN_DUMP_CMD, thin_dump)
|
||||||
|
test -z "$THIN_DUMP_CMD" && AC_MSG_ERROR(thin_dump not found in path $PATH)
|
||||||
|
fi
|
||||||
|
AC_ARG_WITH(thin-repair,
|
||||||
|
AC_HELP_STRING([--with-thin-repair=PATH],
|
||||||
|
[thin_repair tool: [[autodetect]]]),
|
||||||
|
THIN_REPAIR_CMD=$withval, THIN_REPAIR_CMD="autodetect")
|
||||||
|
# Empty means a config way to ignore thin checking
|
||||||
|
if test "$THIN_REPAIR_CMD" = "autodetect"; then
|
||||||
|
AC_PATH_PROG(THIN_REPAIR_CMD, thin_repair)
|
||||||
|
test -z "$THIN_REPAIR_CMD" && AC_MSG_ERROR(thin_repair not found in path $PATH)
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
|
AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
|
||||||
[The path to 'thin_check', if available.])
|
[The path to 'thin_check', if available.])
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([THIN_DUMP_CMD], ["$THIN_DUMP_CMD"],
|
||||||
|
[The path to 'thin_dump', if available.])
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([THIN_REPAIR_CMD], ["$THIN_REPAIR_CMD"],
|
||||||
|
[The path to 'thin_repair', if available.])
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
dnl -- Disable readline
|
dnl -- Disable readline
|
||||||
@ -1598,6 +1622,8 @@ AC_SUBST(STATIC_LINK)
|
|||||||
AC_SUBST(TESTING)
|
AC_SUBST(TESTING)
|
||||||
AC_SUBST(THIN)
|
AC_SUBST(THIN)
|
||||||
AC_SUBST(THIN_CHECK_CMD)
|
AC_SUBST(THIN_CHECK_CMD)
|
||||||
|
AC_SUBST(THIN_DUMP_CMD)
|
||||||
|
AC_SUBST(THIN_REPAIR_CMD)
|
||||||
AC_SUBST(UDEV_LIBS)
|
AC_SUBST(UDEV_LIBS)
|
||||||
AC_SUBST(UDEV_PC)
|
AC_SUBST(UDEV_PC)
|
||||||
AC_SUBST(UDEV_RULES)
|
AC_SUBST(UDEV_RULES)
|
||||||
|
@ -160,6 +160,9 @@ cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL,
|
|||||||
cfg(global_thin_check_executable_CFG, "thin_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_CHECK_CMD, vsn(2, 2, 94), NULL)
|
cfg(global_thin_check_executable_CFG, "thin_check_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_CHECK_CMD, vsn(2, 2, 94), NULL)
|
||||||
cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_THIN_CHECK_OPTIONS, vsn(2, 2, 96), NULL)
|
cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_THIN_CHECK_OPTIONS, vsn(2, 2, 96), NULL)
|
||||||
cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S", vsn(2, 2, 99), NULL)
|
cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S", vsn(2, 2, 99), NULL)
|
||||||
|
cfg(global_thin_dump_executable_CFG, "thin_dump_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_DUMP_CMD, vsn(2, 2, 100), NULL)
|
||||||
|
cfg(global_thin_repair_executable_CFG, "thin_repair_executable", global_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, THIN_REPAIR_CMD, vsn(2, 2, 100), NULL)
|
||||||
|
cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, 0, CFG_TYPE_STRING, "#S" DEFAULT_THIN_REPAIR_OPTIONS, vsn(2, 2, 100), NULL)
|
||||||
|
|
||||||
cfg(activation_checks_CFG, "checks", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ACTIVATION_CHECKS, vsn(2, 2, 86), NULL)
|
cfg(activation_checks_CFG, "checks", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ACTIVATION_CHECKS, vsn(2, 2, 86), NULL)
|
||||||
cfg(activation_udev_sync_CFG, "udev_sync", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_UDEV_SYNC, vsn(2, 2, 51), NULL)
|
cfg(activation_udev_sync_CFG, "udev_sync", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_UDEV_SYNC, vsn(2, 2, 51), NULL)
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
#define DEFAULT_BACKGROUND_POLLING 1
|
#define DEFAULT_BACKGROUND_POLLING 1
|
||||||
|
|
||||||
#define DEFAULT_THIN_CHECK_OPTIONS "-q"
|
#define DEFAULT_THIN_CHECK_OPTIONS "-q"
|
||||||
|
#define DEFAULT_THIN_REPAIR_OPTIONS ""
|
||||||
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
|
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
|
||||||
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024) /* KB */
|
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024) /* KB */
|
||||||
#define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048 /* KB */
|
#define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048 /* KB */
|
||||||
|
@ -546,9 +546,15 @@
|
|||||||
/* The path to 'thin_check', if available. */
|
/* The path to 'thin_check', if available. */
|
||||||
#undef THIN_CHECK_CMD
|
#undef THIN_CHECK_CMD
|
||||||
|
|
||||||
|
/* The path to 'thin_dump', if available. */
|
||||||
|
#undef THIN_DUMP_CMD
|
||||||
|
|
||||||
/* Define to 1 to include built-in support for thin provisioning. */
|
/* Define to 1 to include built-in support for thin provisioning. */
|
||||||
#undef THIN_INTERNAL
|
#undef THIN_INTERNAL
|
||||||
|
|
||||||
|
/* The path to 'thin_repair', if available. */
|
||||||
|
#undef THIN_REPAIR_CMD
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||||
#undef TIME_WITH_SYS_TIME
|
#undef TIME_WITH_SYS_TIME
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user