mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
Prevent PV allocation bit getting changed for format_text orphans.
This commit is contained in:
parent
02ceef1225
commit
6078f63801
@ -530,7 +530,7 @@ struct format_type *init_format(struct cmd_context *cmd)
|
|||||||
fmt->ops = &_format1_ops;
|
fmt->ops = &_format1_ops;
|
||||||
fmt->name = FMT_LVM1_NAME;
|
fmt->name = FMT_LVM1_NAME;
|
||||||
fmt->alias = NULL;
|
fmt->alias = NULL;
|
||||||
fmt->features = FMT_RESTRICTED_LVIDS;
|
fmt->features = FMT_RESTRICTED_LVIDS | FMT_ORPHAN_ALLOCATABLE;
|
||||||
fmt->private = NULL;
|
fmt->private = NULL;
|
||||||
|
|
||||||
if (!(fmt->labeller = lvm1_labeller_create(fmt))) {
|
if (!(fmt->labeller = lvm1_labeller_create(fmt))) {
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#define FMT_TAGS 0x00000004 /* Tagging? */
|
#define FMT_TAGS 0x00000004 /* Tagging? */
|
||||||
#define FMT_UNLIMITED_VOLS 0x00000008 /* Unlimited PVs/LVs? */
|
#define FMT_UNLIMITED_VOLS 0x00000008 /* Unlimited PVs/LVs? */
|
||||||
#define FMT_RESTRICTED_LVIDS 0x00000010 /* LVID <= 255 */
|
#define FMT_RESTRICTED_LVIDS 0x00000010 /* LVID <= 255 */
|
||||||
|
#define FMT_ORPHAN_ALLOCATABLE 0x00000020 /* Orphan PV allocatable? */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ALLOC_DEFAULT,
|
ALLOC_DEFAULT,
|
||||||
|
@ -89,6 +89,14 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!*pv->vg_name &&
|
||||||
|
!(pv->fmt->features & FMT_ORPHAN_ALLOCATABLE)) {
|
||||||
|
log_error("Allocatability not supported by orphan "
|
||||||
|
"%s format PV %s", pv->fmt->name, pv_name);
|
||||||
|
unlock_vg(cmd, ORPHAN);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* change allocatability for a PV */
|
/* change allocatability for a PV */
|
||||||
if (allocatable && (pv->status & ALLOCATABLE_PV)) {
|
if (allocatable && (pv->status & ALLOCATABLE_PV)) {
|
||||||
log_error("Physical volume \"%s\" is already allocatable",
|
log_error("Physical volume \"%s\" is already allocatable",
|
||||||
|
Loading…
Reference in New Issue
Block a user