1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

Do not allow creating mirrors of more than 8 images.

This is kernel limitation in all kernel versions,
so better detect this early.
This commit is contained in:
Milan Broz 2009-11-27 14:35:38 +00:00
parent 16e033b91a
commit 5800aa5c07
4 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.57 -
====================================
Do not allow creating mirrors of more than 8 images.
Use locking_type 3 (compiled in cluster locking) in lvmconf.
Remove duplicate dm_list macros and functions.
Log failure type and recognise type 'F' (flush) in dmeventd mirror plugin.

View File

@ -47,6 +47,7 @@
#define DEFAULT_MIRRORLOG "disk"
#define DEFAULT_MIRROR_LOG_FAULT_POLICY "allocate"
#define DEFAULT_MIRROR_DEV_FAULT_POLICY "remove"
#define DEFAULT_MIRROR_MAX_IMAGES 8 /* limited by kernel DM_KCOPYD_MAX_REGIONS */
#define DEFAULT_DMEVENTD_MIRROR_LIB "libdevmapper-event-lvm2mirror.so"
#define DEFAULT_DMEVENTD_MONITOR 1

View File

@ -571,6 +571,12 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, struct logical_volume *lv
else
lp->mirrors += 1;
if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
log_error("Only up to %d images in mirror supported currently.",
DEFAULT_MIRROR_MAX_IMAGES);
return 0;
}
if (repair) {
cmd->handles_missing_pvs = 1;
cmd->partial_activation = 1;

View File

@ -500,6 +500,12 @@ static int _lvcreate_params(struct lvcreate_params *lp,
return 0;
}
if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
log_error("Only up to %d images in mirror supported currently.",
DEFAULT_MIRROR_MAX_IMAGES);
return 0;
}
/*
* Read ahead.
*/