params->total++;
+ if (vg && vg_is_exported(vg)) {
+ log_error("Volume group %s is exported", vg->name);
+ goto bad;
+ }
+
/* If in a VG, must change using volume group. */
if (!is_orphan(pv)) {
if (tagargs && !(vg->fid->fmt->features & FMT_TAGS)) {
set_pv_notify(cmd);
- ret = process_each_pv(cmd, argc, argv, NULL, 0, READ_FOR_UPDATE, handle, _pvchange_single);
+ ret = process_each_pv(cmd, argc, argv, NULL, 0, READ_FOR_UPDATE | READ_ALLOW_EXPORTED, handle, _pvchange_single);
if (!argc)
unlock_vg(cmd, VG_GLOBAL);
}
params->total++;
+ if (vg && vg_is_exported(vg)) {
+ log_error("Volume group %s is exported", vg->name);
+ return ECMD_FAILED;
+ }
+
/*
* Needed to change a property on an orphan PV.
* i.e. the global lock is only needed for orphans.
handle->custom_handle = ¶ms;
- ret = process_each_pv(cmd, argc, argv, NULL, 0, READ_FOR_UPDATE, handle,
- _pvresize_single);
+ ret = process_each_pv(cmd, argc, argv, NULL, 0, READ_FOR_UPDATE | READ_ALLOW_EXPORTED, handle, _pvresize_single);
log_print_unless_silent("%d physical volume(s) resized / %d physical volume(s) "
"not resized", params.done, params.total - params.done);