summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-05-07 10:16:06 -0500
committerDavid Teigland <teigland@redhat.com>2021-05-07 10:53:40 -0500
commit2791a82ba02ee252b587c16336d898040128cc44 (patch)
tree86270c236939c0e493cf54cf61edd2d5787541b4
parentb0693d981f1ecd2cf934738bd0e3cb67220434f4 (diff)
downloadlvm2-dev-dct-lvreduce-check-4.tar.gz
lvreduce: add config option lvreduce_detectfsdev-dct-lvreduce-check-4
which controls whether or not lvreduce will check for a file system. The default is 1. The command option --detectfs y|n overrides this config setting.
-rw-r--r--lib/config/config_settings.h9
-rw-r--r--tools/lvresize.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index d3a42a153..2d7aa00b6 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1115,6 +1115,15 @@ cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_pa
"Previously this was always shown as /dev/vgname/lvname even when that\n"
"was never a valid path in the /dev filesystem.\n")
+cfg(global_lvreduce_detectfs_CFG, "lvreduce_detectfs", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, 1, vsn(2, 3, 12), 0, 0, NULL,
+ "Control if lvreduce will check for file systems that can be reduced.\n"
+ "When enabled, lvreduce will use blkid to check if the LV has a file system\n"
+ "that can be reduced. If the file system cannot be reduced, then the LV will\n"
+ "will not be reduced. If the file system can be reduced, then --resizefs\n"
+ "is also required. If no file system is found, then the LV is reduced.\n"
+ "The LV will be activated, if needed, to do the check.\n"
+ "The command line option --detectfs y|n overrides this setting.\n")
+
cfg(global_event_activation_CFG, "event_activation", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, 1, vsn(2, 3, 1), 0, 0, NULL,
"Activate LVs based on system-generated device events.\n"
"When a PV appears on the system, a system-generated uevent triggers\n"
diff --git a/tools/lvresize.c b/tools/lvresize.c
index ab434ba14..f97df4f42 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -43,7 +43,7 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
if (arg_is_set(cmd, detectfs_ARG))
lp->detectfs = arg_int_value(cmd, detectfs_ARG, 1);
else
- lp->detectfs = 1;
+ lp->detectfs = find_config_tree_bool(cmd, global_lvreduce_detectfs_CFG, NULL);;
}
lp->sign = lp->poolmetadata_sign = SIGN_NONE;