diff options
author | Alasdair Kergon <agk@redhat.com> | 2012-02-28 18:08:08 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2012-02-28 18:08:08 +0000 |
commit | dc9ef7a028241cf85d62fb1a9fe27927b8e305bd (patch) | |
tree | af778ca749c3f02c3b4895f72a6e7b4ea5fbabed /tools/pvremove.c | |
parent | ebf5552754bdf0d4c04f45bef334799775776ad7 (diff) | |
download | lvm2-dc9ef7a028241cf85d62fb1a9fe27927b8e305bd.tar.gz lvm2-dc9ef7a028241cf85d62fb1a9fe27927b8e305bd.tar.xz lvm2-dc9ef7a028241cf85d62fb1a9fe27927b8e305bd.zip |
Check return values after calling new lvmetad fns
(Haven't checked error path handling though)
Diffstat (limited to 'tools/pvremove.c')
-rw-r--r-- | tools/pvremove.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/pvremove.c b/tools/pvremove.c index 655214e0..4c3628b7 100644 --- a/tools/pvremove.c +++ b/tools/pvremove.c @@ -107,35 +107,36 @@ static int pvremove_single(struct cmd_context *cmd, const char *pv_name, } if (!pvremove_check(cmd, pv_name)) - goto error; + goto out; if (!(dev = dev_cache_get(pv_name, cmd->filter))) { log_error("%s: Couldn't find device. Check your filters?", pv_name); - goto error; + goto out; } if (!dev_test_excl(dev)) { /* FIXME Detect whether device-mapper is still using the device */ log_error("Can't open %s exclusively - not removing. " "Mounted filesystem?", dev_name(dev)); - goto error; + goto out; } /* Wipe existing label(s) */ if (!label_remove(dev)) { log_error("Failed to wipe existing label(s) on %s", pv_name); - goto error; + goto out; } - lvmetad_pv_gone(dev->dev); + if (!lvmetad_pv_gone(dev->dev)) + goto_out; log_print("Labels on physical volume \"%s\" successfully wiped", pv_name); ret = ECMD_PROCESSED; - error: +out: unlock_vg(cmd, VG_ORPHANS); return ret; |