mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Fix lvcreate --nosync not to wait for non-happening sync.
This commit is contained in:
parent
34d22f7047
commit
94563b6017
@ -1,5 +1,6 @@
|
||||
Version 2.02.31 -
|
||||
===================================
|
||||
Fix lvcreate --nosync not to wait for non-happening sync. (2.02.30)
|
||||
Add very_verbose lvconvert messages.
|
||||
Avoid error message when using default setting of lvcreate -M1. (2.02.30)
|
||||
|
||||
|
@ -95,6 +95,7 @@ struct pv_segment;
|
||||
/* Mirror conversion type flags */
|
||||
#define MIRROR_BY_SEG 0x00000001U /* segment-by-segment mirror */
|
||||
#define MIRROR_BY_LV 0x00000002U /* mirror using whole mimage LVs */
|
||||
#define MIRROR_SKIP_INIT_SYNC 0x00000010U /* skip initial sync */
|
||||
|
||||
/* Ordered list - see lv_manip.c */
|
||||
typedef enum {
|
||||
|
@ -1356,8 +1356,8 @@ int add_mirror_images(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
* create and initialize mirror log
|
||||
*/
|
||||
if (log_count &&
|
||||
!(log_lv = _set_up_mirror_log(cmd, ah, lv, log_count,
|
||||
region_size, alloc, 0)))
|
||||
!(log_lv = _set_up_mirror_log(cmd, ah, lv, log_count, region_size,
|
||||
alloc, mirror_in_sync())))
|
||||
return_0;
|
||||
|
||||
/* The log initialization involves vg metadata commit.
|
||||
@ -1427,7 +1427,10 @@ int lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
* the global mirror_in_sync status. As we are adding
|
||||
* a new mirror, it should be set as 'out-of-sync'
|
||||
* so that the sync starts. */
|
||||
if (!log_count)
|
||||
/* However, MIRROR_SKIP_INIT_SYNC even overrides it. */
|
||||
if (flags & MIRROR_SKIP_INIT_SYNC)
|
||||
init_mirror_in_sync(1);
|
||||
else if (!log_count)
|
||||
init_mirror_in_sync(0);
|
||||
|
||||
if (flags & MIRROR_BY_SEG) {
|
||||
|
@ -789,7 +789,8 @@ static int _lvcreate(struct cmd_context *cmd, struct volume_group *vg,
|
||||
lv->le_count,
|
||||
lp->region_size),
|
||||
lp->corelog ? 0U : 1U, pvh, lp->alloc,
|
||||
MIRROR_BY_LV)) {
|
||||
MIRROR_BY_LV |
|
||||
(lp->nosync ? MIRROR_SKIP_INIT_SYNC : 0))) {
|
||||
stack;
|
||||
goto revert_new_lv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user