diff options
author | Alasdair Kergon <agk@redhat.com> | 2006-04-05 22:24:16 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2006-04-05 22:24:16 +0000 |
commit | 7810d55dfcada3a656574a75587b2d152a369626 (patch) | |
tree | 923a73987403e0324bf52aed869fec2a892e97a9 /tools/pvremove.c | |
parent | 1c8b86c7d5a684f911526753a18bf3b22c6d4513 (diff) | |
download | lvm2-7810d55dfcada3a656574a75587b2d152a369626.tar.gz lvm2-7810d55dfcada3a656574a75587b2d152a369626.tar.xz lvm2-7810d55dfcada3a656574a75587b2d152a369626.zip |
pvremove without -f now fails if there's no PV label.
Diffstat (limited to 'tools/pvremove.c')
-rw-r--r-- | tools/pvremove.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/pvremove.c b/tools/pvremove.c index 1fce587a..75ea7f56 100644 --- a/tools/pvremove.c +++ b/tools/pvremove.c @@ -33,9 +33,14 @@ static int pvremove_check(struct cmd_context *cmd, const char *name) return 0; } - /* is there a pv here already */ - if (!(pv = pv_read(cmd, name, NULL, NULL, 1))) - return 1; + /* Is there a pv here already? */ + /* If not, this is an error unless you used -f. */ + if (!(pv = pv_read(cmd, name, NULL, NULL, 1))) { + if (arg_count(cmd, force_ARG)) + return 1; + else + return 0; + } /* orphan ? */ if (!pv->vg_name[0]) |