Version 2.02.46 -
================================
+ Fix maximal volume count check for snapshots if max_lv set for volume group.
+ Fix lvcreate to remove cow volume if the snapshot creation fails.
Fix error messages when PV uuid or pe_start reading fails.
Rename liblvm.a to liblvm-internal.a and build new application library.
Flush memory pool and fix locking in clvmd refresh and backup command.
r = 0;
}
+ if (vg->max_lv && (vg->max_lv < vg->lv_count)) {
+ log_error("Internal error: Volume group %s contains %u volumes"
+ " but the limit is set to %u.",
+ vg->name, vg->lv_count, vg->max_lv);
+ r = 0;
+ }
+
return r;
}
return 0;
}
+ /*
+ * Set origin lv count in advance to prevent fail because
+ * of temporary violation of LV limits.
+ */
+ origin->vg->lv_count--;
+
if (!(snap = lv_create_empty(name ? name : "snapshot%d",
lvid, LVM_READ | LVM_WRITE | VISIBLE_LV,
- ALLOC_INHERIT, 1, origin->vg)))
+ ALLOC_INHERIT, 1, origin->vg))) {
+ origin->vg->lv_count++;
return_0;
+ }
snap->le_count = extent_count;
origin->origin_count++;
origin->vg->snapshot_count++;
- origin->vg->lv_count--;
cow->snapshot = seg;
cow->status &= ~VISIBLE_LV;
grep "^ Invalid stripe size 3\.00 KB\$" err
case $(lvdisplay $vg) in "") true ;; *) false ;; esac
+# Setting max_lv works. (bz490298)
+vgchange -l 4 $vg
+lvcreate -l1 -n $lv1 $vg
+lvcreate -l1 -s -n $lv2 $vg/$lv1
+lvcreate -l1 -n $lv3 $vg
+not lvcreate -l1 -n $lv4 $vg
+vgs $vg
+lvremove -ff $vg
+vgchange -l 0 $vg
if (!vg_add_snapshot(NULL, org, lv, NULL,
org->le_count, lp->chunk_size)) {
log_error("Couldn't create snapshot.");
- return 0;
+ goto deactivate_and_revert_new_lv;
}
/* store vg on disk(s) */
if (!vg_check_status(vg, EXPORTED_VG))
return ECMD_FAILED;
+ if (!vg_validate(vg))
+ return ECMD_FAILED;
+
return ECMD_PROCESSED;
}