mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Add --nosync to lvcreate with LV flag NOTSYNCED.
This commit is contained in:
parent
5240aad22b
commit
b69ba36c2d
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.06 -
|
Version 2.02.06 -
|
||||||
=================================
|
=================================
|
||||||
|
Add --nosync to lvcreate with LV flag NOTSYNCED.
|
||||||
Use mirror's uuid for a core log.
|
Use mirror's uuid for a core log.
|
||||||
Add mirror log fault-handling policy.
|
Add mirror log fault-handling policy.
|
||||||
Improve mirror warning messages and tidy dmeventd syslog output.
|
Improve mirror warning messages and tidy dmeventd syslog output.
|
||||||
|
@ -53,6 +53,7 @@ static struct flag _lv_flags[] = {
|
|||||||
{VISIBLE_LV, "VISIBLE"},
|
{VISIBLE_LV, "VISIBLE"},
|
||||||
{PVMOVE, "PVMOVE"},
|
{PVMOVE, "PVMOVE"},
|
||||||
{LOCKED, "LOCKED"},
|
{LOCKED, "LOCKED"},
|
||||||
|
{MIRROR_NOTSYNCED, "NOTSYNCED"},
|
||||||
{MIRROR_IMAGE, NULL},
|
{MIRROR_IMAGE, NULL},
|
||||||
{MIRROR_LOG, NULL},
|
{MIRROR_LOG, NULL},
|
||||||
{MIRRORED, NULL},
|
{MIRRORED, NULL},
|
||||||
|
@ -58,8 +58,9 @@
|
|||||||
#define VIRTUAL 0x00010000U /* LV - internal use only */
|
#define VIRTUAL 0x00010000U /* LV - internal use only */
|
||||||
#define MIRROR_LOG 0x00020000U /* LV */
|
#define MIRROR_LOG 0x00020000U /* LV */
|
||||||
#define MIRROR_IMAGE 0x00040000U /* LV */
|
#define MIRROR_IMAGE 0x00040000U /* LV */
|
||||||
#define ACTIVATE_EXCL 0x00080000U /* LV - internal use only */
|
#define MIRROR_NOTSYNCED 0x00080000U /* LV */
|
||||||
#define PRECOMMITTED 0x00100000U /* VG - internal use only */
|
#define ACTIVATE_EXCL 0x00100000U /* LV - internal use only */
|
||||||
|
#define PRECOMMITTED 0x00200000U /* VG - internal use only */
|
||||||
|
|
||||||
#define LVM_READ 0x00000100U /* LV VG */
|
#define LVM_READ 0x00000100U /* LV VG */
|
||||||
#define LVM_WRITE 0x00000200U /* LV VG */
|
#define LVM_WRITE 0x00000200U /* LV VG */
|
||||||
|
@ -115,7 +115,7 @@ xx(lvcreate,
|
|||||||
"\t{-l|--extents LogicalExtentsNumber |\n"
|
"\t{-l|--extents LogicalExtentsNumber |\n"
|
||||||
"\t -L|--size LogicalVolumeSize[kKmMgGtT]}\n"
|
"\t -L|--size LogicalVolumeSize[kKmMgGtT]}\n"
|
||||||
"\t[-M|--persistent {y|n}] [--major major] [--minor minor]\n"
|
"\t[-M|--persistent {y|n}] [--major major] [--minor minor]\n"
|
||||||
"\t[-m|--mirrors Mirrors [--corelog]]\n"
|
"\t[-m|--mirrors Mirrors [--nosync] [--corelog]]\n"
|
||||||
"\t[-n|--name LogicalVolumeName]\n"
|
"\t[-n|--name LogicalVolumeName]\n"
|
||||||
"\t[-p|--permission {r|rw}]\n"
|
"\t[-p|--permission {r|rw}]\n"
|
||||||
"\t[-r|--readahead ReadAheadSectors]\n"
|
"\t[-r|--readahead ReadAheadSectors]\n"
|
||||||
@ -149,8 +149,9 @@ xx(lvcreate,
|
|||||||
|
|
||||||
addtag_ARG, alloc_ARG, autobackup_ARG, chunksize_ARG, contiguous_ARG,
|
addtag_ARG, alloc_ARG, autobackup_ARG, chunksize_ARG, contiguous_ARG,
|
||||||
corelog_ARG, extents_ARG, major_ARG, minor_ARG, mirrors_ARG, name_ARG,
|
corelog_ARG, extents_ARG, major_ARG, minor_ARG, mirrors_ARG, name_ARG,
|
||||||
permission_ARG, persistent_ARG, readahead_ARG, regionsize_ARG, size_ARG,
|
nosync_ARG, permission_ARG, persistent_ARG, readahead_ARG, regionsize_ARG,
|
||||||
snapshot_ARG, stripes_ARG, stripesize_ARG, test_ARG, type_ARG, zero_ARG)
|
size_ARG, snapshot_ARG, stripes_ARG, stripesize_ARG, test_ARG, type_ARG,
|
||||||
|
zero_ARG)
|
||||||
|
|
||||||
xx(lvdisplay,
|
xx(lvdisplay,
|
||||||
"Display information about a logical volume",
|
"Display information about a logical volume",
|
||||||
|
@ -308,6 +308,8 @@ static int lvconvert_mirrors(struct cmd_context * cmd, struct logical_volume * l
|
|||||||
|
|
||||||
if (sync_percent >= 100.0)
|
if (sync_percent >= 100.0)
|
||||||
init_mirror_in_sync(1);
|
init_mirror_in_sync(1);
|
||||||
|
else
|
||||||
|
init_mirror_in_sync(0);
|
||||||
|
|
||||||
if (!(log_lv = create_mirror_log(cmd, lv->vg, ah,
|
if (!(log_lv = create_mirror_log(cmd, lv->vg, ah,
|
||||||
lp->alloc, lv->name,
|
lp->alloc, lv->name,
|
||||||
@ -328,6 +330,8 @@ static int lvconvert_mirrors(struct cmd_context * cmd, struct logical_volume * l
|
|||||||
|
|
||||||
if (sync_percent >= 100.0)
|
if (sync_percent >= 100.0)
|
||||||
init_mirror_in_sync(1);
|
init_mirror_in_sync(1);
|
||||||
|
else
|
||||||
|
init_mirror_in_sync(0);
|
||||||
|
|
||||||
if (!remove_mirror_images(seg, lp->mirrors,
|
if (!remove_mirror_images(seg, lp->mirrors,
|
||||||
lp->pv_count ?
|
lp->pv_count ?
|
||||||
|
@ -25,6 +25,7 @@ struct lvcreate_params {
|
|||||||
int major;
|
int major;
|
||||||
int minor;
|
int minor;
|
||||||
int corelog;
|
int corelog;
|
||||||
|
int nosync;
|
||||||
|
|
||||||
char *origin;
|
char *origin;
|
||||||
const char *vg_name;
|
const char *vg_name;
|
||||||
@ -293,6 +294,7 @@ static int _read_mirror_params(struct lvcreate_params *lp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
lp->corelog = arg_count(cmd, corelog_ARG) ? 1 : 0;
|
lp->corelog = arg_count(cmd, corelog_ARG) ? 1 : 0;
|
||||||
|
lp->nosync = arg_count(cmd, nosync_ARG) ? 1 : 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -385,6 +387,11 @@ static int _lvcreate_params(struct lvcreate_params *lp, struct cmd_context *cmd,
|
|||||||
log_error("--corelog is only available with mirrors");
|
log_error("--corelog is only available with mirrors");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arg_count(cmd, nosync_ARG)) {
|
||||||
|
log_error("--nosync is only available with mirrors");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activation() && lp->segtype->ops->target_present &&
|
if (activation() && lp->segtype->ops->target_present &&
|
||||||
@ -653,8 +660,16 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp)
|
|||||||
lp->extents,
|
lp->extents,
|
||||||
lp->region_size);
|
lp->region_size);
|
||||||
|
|
||||||
|
init_mirror_in_sync(lp->nosync);
|
||||||
|
|
||||||
|
if (lp->nosync) {
|
||||||
|
log_print("WARNING: New mirror won't be synchronised. "
|
||||||
|
"Don't read what you didn't write!");
|
||||||
|
status |= MIRROR_NOTSYNCED;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(log_lv = create_mirror_log(cmd, vg, ah, lp->alloc,
|
if (!(log_lv = create_mirror_log(cmd, vg, ah, lp->alloc,
|
||||||
lv_name, 0))) {
|
lv_name, lp->nosync))) {
|
||||||
log_error("Failed to create mirror log.");
|
log_error("Failed to create mirror log.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -713,6 +713,8 @@ static int _get_settings(struct cmd_context *cmd)
|
|||||||
!_merge_synonym(cmd, allocation_ARG, resizeable_ARG))
|
!_merge_synonym(cmd, allocation_ARG, resizeable_ARG))
|
||||||
return EINVALID_CMD_LINE;
|
return EINVALID_CMD_LINE;
|
||||||
|
|
||||||
|
init_mirror_in_sync(0);
|
||||||
|
|
||||||
/* Zero indicates success */
|
/* Zero indicates success */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user