1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Fix a pvs error path.

This commit is contained in:
Alasdair Kergon 2004-05-24 14:14:10 +00:00
parent 36cfd88743
commit 199fa12a3b
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.00.16 - Version 2.00.16 -
============================= =============================
Fix a pvs error path.
xxchange -ae for exclusive activation. xxchange -ae for exclusive activation.
Don't return non-zero status if there aren't any volume groups. Don't return non-zero status if there aren't any volume groups.
Add --alloc argument to tools. Add --alloc argument to tools.

View File

@ -58,11 +58,13 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
struct physical_volume *pv, void *handle) struct physical_volume *pv, void *handle)
{ {
int consistent = 0; int consistent = 0;
int ret = ECMD_PROCESSED;
if (!lock_vol(cmd, pv->vg_name, LCK_VG_READ)) { if (!lock_vol(cmd, pv->vg_name, LCK_VG_READ)) {
log_error("Can't lock %s: skipping", pv->vg_name); log_error("Can't lock %s: skipping", pv->vg_name);
return ECMD_FAILED; return ECMD_FAILED;
} }
if (!(vg = vg_read(cmd, pv->vg_name, &consistent))) { if (!(vg = vg_read(cmd, pv->vg_name, &consistent))) {
log_error("Can't read %s: skipping", pv->vg_name); log_error("Can't read %s: skipping", pv->vg_name);
unlock_vg(cmd, 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)) if (!report_object(handle, vg, NULL, pv, NULL))
return ECMD_FAILED; ret = ECMD_FAILED;
unlock_vg(cmd, pv->vg_name); unlock_vg(cmd, pv->vg_name);
return ret;
return ECMD_PROCESSED;
} }
static int _report(struct cmd_context *cmd, int argc, char **argv, static int _report(struct cmd_context *cmd, int argc, char **argv,