1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

integrity: always default to journal mode

lvconvert was defaulting to bitmap mode,
and lvcreate was defaulting to journal mode.
This commit is contained in:
David Teigland 2020-09-01 12:53:00 -05:00
parent 9a06700017
commit f2c1de783c
4 changed files with 16 additions and 16 deletions

View File

@ -303,6 +303,21 @@ int lv_remove_integrity_from_raid(struct logical_volume *lv)
return 1;
}
int integrity_mode_set(const char *mode, struct integrity_settings *settings)
{
if (!mode)
settings->mode[0] = DEFAULT_MODE;
else if (!strcmp(mode, "bitmap") || !strcmp(mode, "B"))
settings->mode[0] = 'B';
else if (!strcmp(mode, "journal") || !strcmp(mode, "J"))
settings->mode[0] = 'J';
else {
log_error("Invalid raid integrity mode (use \"bitmap\" or \"journal\")");
return 0;
}
return 1;
}
static int _set_integrity_block_size(struct cmd_context *cmd, struct logical_volume *lv, int is_active,
struct integrity_settings *settings,
int lbs_4k, int lbs_512, int pbs_4k, int pbs_512)

View File

@ -1414,5 +1414,6 @@ int lv_has_integrity_recalculate_metadata(struct logical_volume *lv);
int lv_raid_has_integrity(struct logical_volume *lv);
int lv_extend_integrity_in_raid(struct logical_volume *lv, struct dm_list *pvh);
int lv_get_raid_integrity_settings(struct logical_volume *lv, struct integrity_settings **isettings);
int integrity_mode_set(const char *mode, struct integrity_settings *settings);
#endif

View File

@ -718,20 +718,6 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd,
return 1;
}
int integrity_mode_set(const char *mode, struct integrity_settings *settings)
{
if (!mode || !strcmp(mode, "bitmap") || !strcmp(mode, "B"))
settings->mode[0] = 'B';
else if (!strcmp(mode, "journal") || !strcmp(mode, "J"))
settings->mode[0] = 'J';
else {
/* FIXME: the kernel has other modes, should we allow any of those? */
log_error("Invalid raid integrity mode (use \"bitmap\" or \"journal\")");
return 0;
}
return 1;
}
/* Shared code for changing activation state for vgchange/lvchange */
int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
activation_change_t activate)

View File

@ -212,8 +212,6 @@ unsigned grouped_arg_is_set(const struct arg_values *av, int a);
const char *grouped_arg_str_value(const struct arg_values *av, int a, const char *def);
int32_t grouped_arg_int_value(const struct arg_values *av, int a, const int32_t def);
int integrity_mode_set(const char *mode, struct integrity_settings *settings);
const char *command_name(struct cmd_context *cmd);
int pvmove_poll(struct cmd_context *cmd, const char *pv_name, const char *uuid,