diff options
author | David Teigland <teigland@redhat.com> | 2020-10-23 13:53:52 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-10-26 11:13:27 -0500 |
commit | 2c319398274b930a38278e635e9171ce663f2bab (patch) | |
tree | e6e65a8a2bc46e8eb63be24a8c6911aeb96e17d2 /tools/lvmcmdline.c | |
parent | 7bafae48bb7b7bf1e7adc420bf83d0c5acaf0aac (diff) | |
download | lvm2-2c319398274b930a38278e635e9171ce663f2bab.tar.gz |
pvcreate: clean up opening and filtering of args
The args for pvcreate/pvremove (and vgcreate/vgextend
when applicable) were not efficiently opened, scanned,
and filtered. This change reorganizes the opening
and filtering in the following steps:
- label scan and filter all devs
. open ro
. standard label scan at the start of command
- label scan and filter dev args
. open ro
. uses full md component check
. typically the first scan and filter of pvcreate devs
- close and reopen dev args
. open rw and excl
- repeat label scan and filter dev args
. using reopened rw excl fd
- wipe and write new headers
. using reopened rw excl fd
Diffstat (limited to 'tools/lvmcmdline.c')
-rw-r--r-- | tools/lvmcmdline.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 3a2ce93b5..b84a9a014 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -2900,13 +2900,8 @@ static void _init_md_checks(struct cmd_context *cmd) if (!strcmp(cmd->md_component_checks, "full")) cmd->use_full_md_check = 1; - else if (!strcmp(cmd->md_component_checks, "auto")) { - /* use_full_md_check can also be set later */ - if (!strcmp(cmd->name, "pvcreate") || - !strcmp(cmd->name, "vgcreate") || - !strcmp(cmd->name, "vgextend")) - cmd->use_full_md_check = 1; - } + + /* use_full_md_check can also be set later */ log_debug("Using md_component_checks %s use_full_md_check %d", cmd->md_component_checks, cmd->use_full_md_check); |