1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-14 05:57:54 +03:00

fsadm: support configurable full path

Just like with other tools lvm2 is using allow to define
fully configurable path.

Default is selected by $PREFIX/sbin/fsadm
This commit is contained in:
Zdenek Kabelac 2017-04-08 19:43:20 +02:00
parent 1095322901
commit 3018cdcaa7
7 changed files with 26 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.170 -
==================================
Introduce global/fsadm_executable to make fsadm path configurable.
Look for limited thin pool metadata size when using 16G metadata.
Add lvconvert pool creation rule disallowing options with poolmetadata.
Fix lvconvert when the same LV is incorrectly reused in options.

8
configure vendored
View File

@ -15319,6 +15319,14 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
FSADM_PATH="$lvm_exec_prefix/sbin/fsadm"
cat >>confdefs.h <<_ACEOF
#define FSADM_PATH "$FSADM_PATH"
_ACEOF
################################################################################
if test "$BUILD_DMEVENTD" = yes; then

View File

@ -1895,6 +1895,10 @@ test "$prefix" != NONE && clvmd_prefix=$prefix
CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
FSADM_PATH="$lvm_exec_prefix/sbin/fsadm"
AC_DEFINE_UNQUOTED(FSADM_PATH, ["$FSADM_PATH"], [Path to fsadm binary.])
################################################################################
dnl -- dmeventd pidfile and executable path
if test "$BUILD_DMEVENTD" = yes; then

View File

@ -148,6 +148,9 @@
/* Library version */
#undef DM_LIB_VERSION
/* Path to fsadm binary. */
#undef FSADM_PATH
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM

View File

@ -1035,6 +1035,10 @@ cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECT
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(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,
"The full path to the fsadm command.\n"
"LVM uses this command to help with lvresize -r operations.\n")
cfg(global_system_id_source_CFG, "system_id_source", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_SYSTEM_ID_SOURCE, vsn(2, 2, 117), NULL, 0, NULL,
"The method LVM uses to set the local system ID.\n"
"Volume Groups can also be given a system ID (by vgcreate, vgchange,\n"

View File

@ -135,6 +135,8 @@
#define DEFAULT_CACHE_METADATA_FORMAT CACHE_METADATA_FORMAT_UNSELECTED /* Autodetect */
#define DEFAULT_CACHE_MODE "writethrough"
#define DEFAULT_FSADM_PATH FSADM_PATH
#define DEFAULT_UMASK 0077
#define DEFAULT_FORMAT "lvm2"

View File

@ -4567,13 +4567,13 @@ static int _request_confirmation(const struct logical_volume *lv,
}
enum fsadm_cmd_e { FSADM_CMD_CHECK, FSADM_CMD_RESIZE };
#define FSADM_CMD "fsadm"
#define FSADM_CMD_MAX_ARGS 6
#define FSADM_CHECK_FAILS_FOR_MOUNTED 3 /* shell exist status code */
/*
* FSADM_CMD --dry-run --verbose --force check lv_path
* FSADM_CMD --dry-run --verbose --force resize lv_path size
* fsadm --dry-run --verbose --force check lv_path
* fsadm --dry-run --verbose --force resize lv_path size
*/
static int _fsadm_cmd(enum fsadm_cmd_e fcmd,
struct logical_volume *lv,
@ -4588,7 +4588,7 @@ static int _fsadm_cmd(enum fsadm_cmd_e fcmd,
const char *argv[FSADM_CMD_MAX_ARGS + 2];
unsigned i = 0;
argv[i++] = FSADM_CMD;
argv[i++] = find_config_tree_str(cmd, global_fsadm_executable_CFG, NULL);
if (test_mode())
argv[i++] = "--dry-run";