diff options
Diffstat (limited to 'tools/pvresize.c')
-rw-r--r-- | tools/pvresize.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/pvresize.c b/tools/pvresize.c index 3b5f1493..82c79368 100644 --- a/tools/pvresize.c +++ b/tools/pvresize.c @@ -29,7 +29,6 @@ static int _pv_resize_single(struct cmd_context *cmd, const uint64_t new_size) { struct pv_list *pvl; - int consistent = 1; uint64_t size = 0; uint32_t new_pe_count = 0; int r = 0; @@ -59,19 +58,9 @@ static int _pv_resize_single(struct cmd_context *cmd, } else { vg_name = pv_vg_name(pv); - if (!lock_vol(cmd, vg_name, LCK_VG_WRITE)) { - log_error("Can't get lock for %s", pv_vg_name(pv)); - return 0; - } - - if (!(vg = vg_read_internal(cmd, vg_name, NULL, &consistent))) { - unlock_vg(cmd, vg_name); - log_error("Unable to find volume group of \"%s\"", - pv_name); - return 0; - } + vg = vg_read_for_update(cmd, vg_name, NULL, 0); - if (!vg_check_status(vg, CLUSTERED | EXPORTED_VG | LVM_WRITE)) + if (vg_read_error(vg)) goto bad; if (!(pvl = find_pv_in_vg(vg, pv_name))) { |