* [PATCH] lvcreate: support --force option
@ 2015-10-10 10:39 Lidong Zhong
2015-10-10 13:17 ` Zdenek Kabelac
0 siblings, 1 reply; 7+ messages in thread
From: Lidong Zhong @ 2015-10-10 10:39 UTC (permalink / raw)
To: lvm-devel
The option is supported in the logic of lvcreate but is omitted in
commands.h.
Signed-off-by: Lidong Zhong <lzhong@suse.com>
---
WHATS_NEW | 1 +
tools/commands.h | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 9af759e..274af43 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Make lvcreate support --force option
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
Add vg_missing_pv_count report field to report number of missing PVs in a VG.
Properly identify internal LV holding sanlock locks within lv_role field.
diff --git a/tools/commands.h b/tools/commands.h
index 92d13fd..7695498 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -311,6 +311,7 @@ xx(lvcreate,
"\t[-C|--contiguous {y|n}]\n"
"\t[--commandprofile ProfileName]\n"
"\t[-d|--debug]\n"
+ "\t[-f|--force]\n"
"\t[-h|-?|--help]\n"
"\t[--errorwhenfull {y|n}]\n"
"\t[--ignoremonitoring]\n"
@@ -360,6 +361,7 @@ xx(lvcreate,
"\t[--commandprofile ProfileName]\n"
"\t[-d|--debug]\n"
"\t[--discards {ignore|nopassdown|passdown}]\n"
+ "\t[-f|--force]\n"
"\t[-h|-?|--help]\n"
"\t[--ignoremonitoring]\n"
"\t[--monitor {y|n}]\n"
@@ -386,7 +388,7 @@ xx(lvcreate,
addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
cache_ARG, cachemode_ARG, cachepool_ARG, cachepolicy_ARG, cachesettings_ARG,
chunksize_ARG, contiguous_ARG, corelog_ARG, discards_ARG, errorwhenfull_ARG,
- extents_ARG, ignoreactivationskip_ARG, ignoremonitoring_ARG, major_ARG,
+ extents_ARG, force_ARG, ignoreactivationskip_ARG, ignoremonitoring_ARG, major_ARG,
metadataprofile_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG, monitor_ARG,
minrecoveryrate_ARG, maxrecoveryrate_ARG, name_ARG, nosync_ARG,
noudevsync_ARG, permission_ARG, persistent_ARG,
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] lvcreate: support --force option
2015-10-10 10:39 [PATCH] lvcreate: support --force option Lidong Zhong
@ 2015-10-10 13:17 ` Zdenek Kabelac
2015-10-12 2:26 ` Lidong Zhong
0 siblings, 1 reply; 7+ messages in thread
From: Zdenek Kabelac @ 2015-10-10 13:17 UTC (permalink / raw)
To: lvm-devel
Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):
> The option is supported in the logic of lvcreate but is omitted in
> commands.h.
>
Nope - it's not intended to be unsupported so far.
We do support --yes to overcome prompts.
Normally --force is meant to be used on paths to proceed with
i.e. lvremove, lvconvert
Do you have any case in mind where '--force' with lvcreate would have make any
sense ?
IMHO creating something with --force looks to me like crazy idea to start with
- but maybe there is some use-case I'm missing ?
Zdenek
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] lvcreate: support --force option
2015-10-10 13:17 ` Zdenek Kabelac
@ 2015-10-12 2:26 ` Lidong Zhong
2015-10-12 9:02 ` Zdenek Kabelac
0 siblings, 1 reply; 7+ messages in thread
From: Lidong Zhong @ 2015-10-12 2:26 UTC (permalink / raw)
To: lvm-devel
Hi Zdenek,
Thanks for your reply.
>>> On 10/10/2015 at 09:17 PM, in message <56190FE5.1030900@redhat.com>, Zdenek
Kabelac <zkabelac@redhat.com> wrote:
> Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):
> > The option is supported in the logic of lvcreate but is omitted in
> > commands.h.
> >
>
> Nope - it's not intended to be unsupported so far.
>
> We do support --yes to overcome prompts.
>
> Normally --force is meant to be used on paths to proceed with
> i.e. lvremove, lvconvert
>
> Do you have any case in mind where '--force' with lvcreate would have make any
>
> sense ?
Not really. I met this problem when I was using lvcreate with the --wipesignature option.
--yes works for me. But I also found that --force should also work when I read the source.
However, it reports -f/--force is an invalid option for lvcreate.
> IMHO creating something with --force looks to me like crazy idea to start with
>
> - but maybe there is some use-case I'm missing ?
>
Currently there is no introduction to --yes in the manpage of lvcreate. How about adding it to
the manpage?
Regards,
Lidong
> Zdenek
>
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] lvcreate: support --force option
2015-10-12 2:26 ` Lidong Zhong
@ 2015-10-12 9:02 ` Zdenek Kabelac
2015-10-26 10:07 ` Lidong Zhong
0 siblings, 1 reply; 7+ messages in thread
From: Zdenek Kabelac @ 2015-10-12 9:02 UTC (permalink / raw)
To: lvm-devel
Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):
> Hi Zdenek,
>
> Thanks for your reply.
>
>>>> On 10/10/2015 at 09:17 PM, in message <56190FE5.1030900@redhat.com>, Zdenek
> Kabelac <zkabelac@redhat.com> wrote:
>> Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):
>>> The option is supported in the logic of lvcreate but is omitted in
>>> commands.h.
>>>
>>
>> Nope - it's not intended to be unsupported so far.
>>
>> We do support --yes to overcome prompts.
>>
>> Normally --force is meant to be used on paths to proceed with
>> i.e. lvremove, lvconvert
>>
>> Do you have any case in mind where '--force' with lvcreate would have make any
>>
>> sense ?
>
> Not really. I met this problem when I was using lvcreate with the --wipesignature option.
> --yes works for me. But I also found that --force should also work when I read the source.
> However, it reports -f/--force is an invalid option for lvcreate.
Yep - and so far it should stay that way - --force has special meaning for
being quite unsafe operation.
>
>> IMHO creating something with --force looks to me like crazy idea to start with
>>
>> - but maybe there is some use-case I'm missing ?
>>
>
> Currently there is no introduction to --yes in the manpage of lvcreate. How about adding it to
> the manpage?
Every lvm man page references 'man lvm' as the source of description for all
'commonly' accepted options (like --yes).
One day we may switch to 'generated' man pages - where very man page would
have all options described - but I guess this 'day' is still pretty far away ;)
Regards
Zdenek
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] lvcreate: support --force option
2015-10-12 9:02 ` Zdenek Kabelac
@ 2015-10-26 10:07 ` Lidong Zhong
2015-10-26 13:42 ` Zdenek Kabelac
0 siblings, 1 reply; 7+ messages in thread
From: Lidong Zhong @ 2015-10-26 10:07 UTC (permalink / raw)
To: lvm-devel
Hi Zdenek,
>>> On 10/12/2015 at 05:02 PM, in message <561B7728.5010804@redhat.com>, Zdenek
Kabelac <zkabelac@redhat.com> wrote:
> Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):
> > Hi Zdenek,
> >
> > Thanks for your reply.
> >
> >>>> On 10/10/2015 at 09:17 PM, in message <56190FE5.1030900@redhat.com>, Zdenek
> > Kabelac <zkabelac@redhat.com> wrote:
> >> Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):
> >>> The option is supported in the logic of lvcreate but is omitted in
> >>> commands.h.
> >>>
> >>
> >> Nope - it's not intended to be unsupported so far.
> >>
> >> We do support --yes to overcome prompts.
> >>
> >> Normally --force is meant to be used on paths to proceed with
> >> i.e. lvremove, lvconvert
> >>
> >> Do you have any case in mind where '--force' with lvcreate would have make
> any
> >>
> >> sense ?
> >
> > Not really. I met this problem when I was using lvcreate with the
> --wipesignature option.
If we set the --wipesignature to y while creating an lv, there will be a prompt for confirming
in current code. Doesn't it make more sense that there shouldn't be the prompt? since we
definitely want to remove the signature by setting this option.
Some options such as "--zero=y" don't give prompt, why it is different?
Please give your opinion.
Regards,
Lidong
> > --yes works for me. But I also found that --force should also work when I read
> the source.
> > However, it reports -f/--force is an invalid option for lvcreate.
>
> Yep - and so far it should stay that way - --force has special meaning for
> being quite unsafe operation.
>
> >
> >> IMHO creating something with --force looks to me like crazy idea to start
> with
> >>
> >> - but maybe there is some use-case I'm missing ?
> >>
> >
> > Currently there is no introduction to --yes in the manpage of lvcreate. How
> about adding it to
> > the manpage?
>
> Every lvm man page references 'man lvm' as the source of description for all
>
> 'commonly' accepted options (like --yes).
>
> One day we may switch to 'generated' man pages - where very man page would
> have all options described - but I guess this 'day' is still pretty far away
> ;)
>
> Regards
>
> Zdenek
>
>
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] lvcreate: support --force option
2015-10-26 10:07 ` Lidong Zhong
@ 2015-10-26 13:42 ` Zdenek Kabelac
2015-10-27 2:29 ` Lidong Zhong
0 siblings, 1 reply; 7+ messages in thread
From: Zdenek Kabelac @ 2015-10-26 13:42 UTC (permalink / raw)
To: lvm-devel
Dne 26.10.2015 v 11:07 Lidong Zhong napsal(a):
> Hi Zdenek,
>
>>>> On 10/12/2015 at 05:02 PM, in message <561B7728.5010804@redhat.com>, Zdenek
> Kabelac <zkabelac@redhat.com> wrote:
>> Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):
>>> Hi Zdenek,
>>>
>>> Thanks for your reply.
>>>
>>>>>> On 10/10/2015 at 09:17 PM, in message <56190FE5.1030900@redhat.com>, Zdenek
>>> Kabelac <zkabelac@redhat.com> wrote:
>>>> Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):
>>>>> The option is supported in the logic of lvcreate but is omitted in
>>>>> commands.h.
>>>>>
>>>>
>>>> Nope - it's not intended to be unsupported so far.
>>>>
>>>> We do support --yes to overcome prompts.
>>>>
>>>> Normally --force is meant to be used on paths to proceed with
>>>> i.e. lvremove, lvconvert
>>>>
>>>> Do you have any case in mind where '--force' with lvcreate would have make
>> any
>>>>
>>>> sense ?
>>>
>>> Not really. I met this problem when I was using lvcreate with the
>> --wipesignature option.
>
> If we set the --wipesignature to y while creating an lv, there will be a prompt for confirming
> in current code. Doesn't it make more sense that there shouldn't be the prompt? since we
> definitely want to remove the signature by setting this option.
> Some options such as "--zero=y" don't give prompt, why it is different?
> Please give your opinion.
>
Hi
Here is explanation.
'zero' is unconditional and does not detect any signature - so it has nothing
to prompt about - it zeroes first 4K as that's what user asked for.
New 'wipesignature' first detects signature and asks if you want to wipe.
That's the API (and it's very similar to e.g. mkfs)
If lvm2 knows its overwriting something it prompts - that's the rule.
If you are going to take a 'risk' for no prompting - use '--yes'
lvm2 is possibly missing couple prompts - so you could possibly open BZ for
the case we convert/overwrite something without prompting first.
But existing prompts will remain as they are as they are correct.
Regards
Zdenek
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] lvcreate: support --force option
2015-10-26 13:42 ` Zdenek Kabelac
@ 2015-10-27 2:29 ` Lidong Zhong
0 siblings, 0 replies; 7+ messages in thread
From: Lidong Zhong @ 2015-10-27 2:29 UTC (permalink / raw)
To: lvm-devel
Hello Zdenek,
Thanks for your detailed explanation. I am clear that it's a rule that it prompt every time
when lvm2 overwrites something.
Once there is a exception in future, I surely will notify the upstream.
Thanks again.
Regards,
Lidong
>>> On 10/26/2015 at 09:42 PM, in message <562E2DC0.1020002@redhat.com>, Zdenek
Kabelac <zkabelac@redhat.com> wrote:
> Dne 26.10.2015 v 11:07 Lidong Zhong napsal(a):
> > Hi Zdenek,
> >
> >>>> On 10/12/2015 at 05:02 PM, in message <561B7728.5010804@redhat.com>, Zdenek
> > Kabelac <zkabelac@redhat.com> wrote:
> >> Dne 12.10.2015 v 04:26 Lidong Zhong napsal(a):
> >>> Hi Zdenek,
> >>>
> >>> Thanks for your reply.
> >>>
> >>>>>> On 10/10/2015 at 09:17 PM, in message <56190FE5.1030900@redhat.com>, Zdenek
> >>> Kabelac <zkabelac@redhat.com> wrote:
> >>>> Dne 10.10.2015 v 12:39 Lidong Zhong napsal(a):
> >>>>> The option is supported in the logic of lvcreate but is omitted in
> >>>>> commands.h.
> >>>>>
> >>>>
> >>>> Nope - it's not intended to be unsupported so far.
> >>>>
> >>>> We do support --yes to overcome prompts.
> >>>>
> >>>> Normally --force is meant to be used on paths to proceed with
> >>>> i.e. lvremove, lvconvert
> >>>>
> >>>> Do you have any case in mind where '--force' with lvcreate would have make
> >> any
> >>>>
> >>>> sense ?
> >>>
> >>> Not really. I met this problem when I was using lvcreate with the
> >> --wipesignature option.
> >
> > If we set the --wipesignature to y while creating an lv, there will be a
> prompt for confirming
> > in current code. Doesn't it make more sense that there shouldn't be the
> prompt? since we
> > definitely want to remove the signature by setting this option.
> > Some options such as "--zero=y" don't give prompt, why it is different?
> > Please give your opinion.
> >
>
>
> Hi
>
>
> Here is explanation.
>
> 'zero' is unconditional and does not detect any signature - so it has nothing
>
> to prompt about - it zeroes first 4K as that's what user asked for.
>
> New 'wipesignature' first detects signature and asks if you want to wipe.
> That's the API (and it's very similar to e.g. mkfs)
>
> If lvm2 knows its overwriting something it prompts - that's the rule.
>
> If you are going to take a 'risk' for no prompting - use '--yes'
>
> lvm2 is possibly missing couple prompts - so you could possibly open BZ for
> the case we convert/overwrite something without prompting first.
>
> But existing prompts will remain as they are as they are correct.
>
> Regards
>
> Zdenek
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-10-27 2:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-10 10:39 [PATCH] lvcreate: support --force option Lidong Zhong
2015-10-10 13:17 ` Zdenek Kabelac
2015-10-12 2:26 ` Lidong Zhong
2015-10-12 9:02 ` Zdenek Kabelac
2015-10-26 10:07 ` Lidong Zhong
2015-10-26 13:42 ` Zdenek Kabelac
2015-10-27 2:29 ` Lidong Zhong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.