From 199fa12a3bc54b5e6990b79bee6ec0cd6f823645 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 24 May 2004 14:14:10 +0000 Subject: [PATCH] Fix a pvs error path. --- WHATS_NEW | 1 + tools/reporter.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 922e0b53a..6f36154e8 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.00.16 - ============================= + Fix a pvs error path. xxchange -ae for exclusive activation. Don't return non-zero status if there aren't any volume groups. Add --alloc argument to tools. diff --git a/tools/reporter.c b/tools/reporter.c index 443cf5d85..e45574baf 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -58,11 +58,13 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg, struct physical_volume *pv, void *handle) { int consistent = 0; + int ret = ECMD_PROCESSED; if (!lock_vol(cmd, pv->vg_name, LCK_VG_READ)) { log_error("Can't lock %s: skipping", pv->vg_name); return ECMD_FAILED; } + if (!(vg = vg_read(cmd, pv->vg_name, &consistent))) { log_error("Can't read %s: skipping", pv->vg_name); unlock_vg(cmd, pv->vg_name); @@ -70,11 +72,10 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg, } if (!report_object(handle, vg, NULL, pv, NULL)) - return ECMD_FAILED; + ret = ECMD_FAILED; unlock_vg(cmd, pv->vg_name); - - return ECMD_PROCESSED; + return ret; } static int _report(struct cmd_context *cmd, int argc, char **argv,