master - libdm: report: compact output applicable only if report is buffered
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f867dc6b294c43...
Commit: f867dc6b294c434e69499e38e66a67812361d8c9
Parent: f3bd9a2797816e1d21003914c4bfa6c19eb3be62
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Dec 5 14:18:32 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Dec 5 14:18:51 2014 +0100
libdm: report: compact output applicable only if report is buffered
---
conf/example.conf.in | 3 ++-
libdm/libdevmapper.h | 2 ++
libdm/libdm-report.c | 3 +++
3 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 5ed2b92..70d3e6b 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1105,7 +1105,8 @@ activation {
#
# report {
# If compact output is enabled, fields which don't have value
- # set for any of the rows reported are skipped on output.
+ # set for any of the rows reported are skipped on output. Compact
+ # output is applicable only if report is buffered (report/buffered=1).
# compact_output=0
# Align columns on report output.
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index fef0351..f18fba9 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1757,6 +1757,8 @@ int dm_report_object(struct dm_report *rh, void *object);
/*
* Compact report output so that if field value is empty for all rows in
* the report, drop the field from output completely (including headers).
+ * Compact output is applicable only if report is buffered, otherwise
+ * this function has no effect.
*/
int dm_report_compact_fields(struct dm_report *rh);
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 7dd52d4..f81d964 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -1696,6 +1696,9 @@ int dm_report_compact_fields(struct dm_report *rh)
struct field_properties *fp;
struct row *row;
+ if (!(rh->flags & DM_REPORT_OUTPUT_BUFFERED))
+ return 1;
+
if (!rh || dm_list_empty(&rh->rows)) {
log_error("dm_report_enable_compact_output: no report fields to compact");
return 0;
9 years, 4 months
master - raid: properly rename split image
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f3bd9a2797816e...
Commit: f3bd9a2797816e1d21003914c4bfa6c19eb3be62
Parent: 00d53d5fc172ee396ea835a110126f83202724d5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 4 14:24:44 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Dec 5 13:39:42 2014 +0100
raid: properly rename split image
When we split leg from raid - we take a proper new lock for a new LV.
However for now activation checks only 'existince' of device UUID,
but it's not validating device has a proper name.
As a quick fix call suspend()/resume() to rename after split mirror.
---
WHATS_NEW | 1 +
lib/metadata/raid_manip.c | 16 ++++++++++++++++
test/shell/lvconvert-raid.sh | 2 ++
3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 11fa6e1..213cc31 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.115 -
=====================================
+ Correctly rename active split LV with -splitmirrors for raid1.
Add report/compact_output to lvm.conf to enable/disable compact report output.
Still restrict mirror region size to power of 2 when VG extent size is not.
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 5eab551..59d3adb 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1164,6 +1164,22 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,
if (!activate_lv_excl_local(cmd, lvl->lv))
return_0;
+ /*
+ * Since newly split LV is typically already active - we need to call
+ * suspend() and resume() to also rename it.
+ *
+ * TODO: activate should recognize it and avoid these 2 calls
+ */
+ if (!suspend_lv(cmd, lvl->lv)) {
+ log_error("Failed to suspend %s.", lvl->lv->name);
+ return 0;
+ }
+
+ if (!resume_lv(cmd, lvl->lv)) {
+ log_error("Failed to reactivate %s.", lvl->lv->name);
+ return 0;
+ }
+
dm_list_iterate_items(lvl, &removal_list)
if (!activate_lv_excl_local(cmd, lvl->lv))
return_0;
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index bcf3874..8621311 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -107,6 +107,7 @@ aux wait_for_sync $vg $lv1
lvconvert --splitmirrors 1 -n $lv2 $vg/$lv1
check lv_exists $vg $lv1
check linear $vg $lv2
+check active $vg $lv2
# FIXME: ensure no residual devices
lvremove -ff $vg
@@ -116,6 +117,7 @@ aux wait_for_sync $vg $lv1
lvconvert --splitmirrors 1 -n $lv2 $vg/$lv1
check linear $vg $lv1
check linear $vg $lv2
+check active $vg $lv2
# FIXME: ensure no residual devices
lvremove -ff $vg
9 years, 4 months
master - config: add report/compact_output lvm.conf setting to enable or isable field compacting
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00d53d5fc172ee...
Commit: 00d53d5fc172ee396ea835a110126f83202724d5
Parent: 5edf6a56c4077edd238bf08bf369e7d82bca4ecf
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Dec 5 11:46:26 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Dec 5 12:00:28 2014 +0100
config: add report/compact_output lvm.conf setting to enable or isable field compacting
$ lvm dumpconfig report/compact_output
compact_output=0
$ lvs vg
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol0 vg owi-a-s--- 4.00m
lvol1 vg -wi-a----- 4.00m
lvol2 vg swi-a-s--- 4.00m lvol0 0.00
$ lvm dumpconfig report/compact_output
compact_output=1
$ lvs vg
LV VG Attr LSize Origin Data%
lvol0 vg owi-a-s--- 4.00m
lvol1 vg -wi-a----- 4.00m
lvol2 vg swi-a-s--- 4.00m lvol0 0.00
---
WHATS_NEW | 1 +
conf/example.conf.in | 4 ++++
lib/config/config_settings.h | 1 +
lib/config/defaults.h | 1 +
tools/reporter.c | 5 +++++
5 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 54e46d9..11fa6e1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.115 -
=====================================
+ Add report/compact_output to lvm.conf to enable/disable compact report output.
Still restrict mirror region size to power of 2 when VG extent size is not.
Version 2.02.114 - 28th November 2014
diff --git a/conf/example.conf.in b/conf/example.conf.in
index d1a1397..5ed2b92 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1104,6 +1104,10 @@ activation {
# Report settings.
#
# report {
+ # If compact output is enabled, fields which don't have value
+ # set for any of the rows reported are skipped on output.
+ # compact_output=0
+
# Align columns on report output.
# aligned=1
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index e944b81..6de948e 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -234,6 +234,7 @@ cfg(disk_area_start_sector_CFG, "start_sector", disk_area_CFG_SUBSECTION, CFG_AD
cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL)
cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL)
+cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL)
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL)
cfg(report_buffered_CFG, "buffered", report_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_REP_BUFFERED, vsn(1, 0, 0), NULL)
cfg(report_headings_CFG, "headings", report_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_REP_HEADINGS, vsn(1, 0, 0), NULL)
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index cbc95fb..e15926c 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -176,6 +176,7 @@
#define DEFAULT_MAX_ERROR_COUNT NO_DEV_ERROR_COUNT_LIMIT
+#define DEFAULT_REP_COMPACT_OUTPUT 0
#define DEFAULT_REP_ALIGNED 1
#define DEFAULT_REP_BUFFERED 1
#define DEFAULT_REP_COLUMNS_AS_ROWS 0
diff --git a/tools/reporter.c b/tools/reporter.c
index eec9948..b312568 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -410,6 +410,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
args_are_pvs = (report_type == PVS ||
report_type == LABEL ||
+
report_type == PVSEGS) ? 1 : 0;
/*
@@ -614,6 +615,10 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
break;
}
+ if (find_config_tree_bool(cmd, report_compact_output_CFG, NULL) &&
+ !dm_report_compact_fields(report_handle))
+ log_error("Failed to compact report output.");
+
dm_report_output(report_handle);
dm_report_free(report_handle);
9 years, 4 months
master - libdm: report: add dm_report_compact_fields
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5edf6a56c4077e...
Commit: 5edf6a56c4077edd238bf08bf369e7d82bca4ecf
Parent: 44394cd246dceec20dd404e3d39ba5867176d54b
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Dec 5 11:42:43 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Dec 5 12:00:28 2014 +0100
libdm: report: add dm_report_compact_fields
Add new dm_report_compact_fields function to cause report outout
(dm_report_output) to ignore fields which don't have any value set
in any of the rows reported. This provides support for compact report
output where only fields which have something to report are displayed.
---
WHATS_NEW_DM | 1 +
libdm/libdevmapper.h | 7 +++++
libdm/libdm-report.c | 67 +++++++++++++++++++++++++++++++++++++++++++------
3 files changed, 66 insertions(+), 9 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 98b0a5c..dcd35fa 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.93 -
====================================
+ Add dm_report_compact_fields to remove empty fields from report output.
Remove unimplemented dm_report_set_output_selection from libdevmapper.h.
Version 1.02.92 - 24th November 2014
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 3c93dfd..fef0351 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1753,6 +1753,13 @@ struct dm_report *dm_report_init_with_selection(uint32_t *report_types,
const struct dm_report_reserved_value reserved_values[],
void *private_data);
int dm_report_object(struct dm_report *rh, void *object);
+
+/*
+ * Compact report output so that if field value is empty for all rows in
+ * the report, drop the field from output completely (including headers).
+ */
+int dm_report_compact_fields(struct dm_report *rh);
+
int dm_report_output(struct dm_report *rh);
void dm_report_free(struct dm_report *rh);
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index a1bab05..7dd52d4 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -64,6 +64,7 @@ struct dm_report {
#define FLD_SORT_KEY 0x00002000
#define FLD_ASCENDING 0x00004000
#define FLD_DESCENDING 0x00008000
+#define FLD_COMPACTED 0x00010000
struct field_properties {
struct dm_list list;
@@ -84,16 +85,16 @@ struct op_def {
const char *desc;
};
-#define FLD_CMP_MASK 0x00FF0000
-#define FLD_CMP_UNCOMPARABLE 0x00010000
-#define FLD_CMP_EQUAL 0x00020000
-#define FLD_CMP_NOT 0x00040000
-#define FLD_CMP_GT 0x00080000
-#define FLD_CMP_LT 0x00100000
-#define FLD_CMP_REGEX 0x00200000
-#define FLD_CMP_NUMBER 0x00400000
+#define FLD_CMP_MASK 0x0FF00000
+#define FLD_CMP_UNCOMPARABLE 0x00100000
+#define FLD_CMP_EQUAL 0x00200000
+#define FLD_CMP_NOT 0x00400000
+#define FLD_CMP_GT 0x00800000
+#define FLD_CMP_LT 0x01000000
+#define FLD_CMP_REGEX 0x02000000
+#define FLD_CMP_NUMBER 0x04000000
/*
- * #define FLD_CMP_STRING 0x00400000
+ * #define FLD_CMP_STRING 0x08000000
* We could defined FLD_CMP_STRING here for completeness here,
* but it's not needed - we can check operator compatibility with
* field type by using FLD_CMP_REGEX and FLD_CMP_NUMBER flags only.
@@ -1689,6 +1690,54 @@ out:
return r;
}
+int dm_report_compact_fields(struct dm_report *rh)
+{
+ struct dm_report_field *field;
+ struct field_properties *fp;
+ struct row *row;
+
+ if (!rh || dm_list_empty(&rh->rows)) {
+ log_error("dm_report_enable_compact_output: no report fields to compact");
+ return 0;
+ }
+
+ /*
+ * At first, mark all fields with FLD_HIDDEN flag.
+ * Also, mark field with FLD_COMPACTED flag, but only
+ * the ones that didn't have FLD_HIDDEN set before.
+ * This prevents losing the original FLD_HIDDEN flag
+ * in next step...
+ */
+ dm_list_iterate_items(fp, &rh->field_props) {
+ if (!(fp->flags & FLD_HIDDEN))
+ fp->flags |= (FLD_COMPACTED | FLD_HIDDEN);
+ }
+
+ /*
+ * ...check each field in a row and if its report value
+ * is not empty, drop the FLD_COMPACTED and FLD_HIDDEN
+ * flag if FLD_COMPACTED flag is set. It's important
+ * to keep FLD_HIDDEN flag for the fields that were
+ * already marked with FLD_HIDDEN before - these don't
+ * have FLD_COMPACTED set - check this condition!
+ */
+ dm_list_iterate_items(row, &rh->rows) {
+ dm_list_iterate_items(field, &row->fields) {
+ if ((field->report_string && *field->report_string) &&
+ field->props->flags & FLD_COMPACTED)
+ field->props->flags &= ~(FLD_COMPACTED | FLD_HIDDEN);
+ }
+ }
+
+ /*
+ * The fields left with FLD_COMPACTED and FLD_HIDDEN flag are
+ * the ones which have blank value in all rows. The FLD_HIDDEN
+ * will cause such field to not be reported on output at all.
+ */
+
+ return 1;
+}
+
/*
* Selection parsing
*/
9 years, 4 months
master - libdm: remove unimplemented dm_report_set_output_selection fn
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=44394cd246dcee...
Commit: 44394cd246dceec20dd404e3d39ba5867176d54b
Parent: a5baf13a06fc509833803ee4c778bdf9b7f07399
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Dec 5 11:38:51 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Dec 5 11:54:25 2014 +0100
libdm: remove unimplemented dm_report_set_output_selection fn
The dm_report_set_output_selection was not implemented in the end -
we have dm_report_init_with_selection instead. This is just a remnant
from development code that got into libdevmapper.h by mistake.
---
WHATS_NEW_DM | 1 +
libdm/libdevmapper.h | 2 --
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 8d1f648..98b0a5c 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.93 -
====================================
+ Remove unimplemented dm_report_set_output_selection from libdevmapper.h.
Version 1.02.92 - 24th November 2014
====================================
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 895ad48..3c93dfd 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1753,8 +1753,6 @@ struct dm_report *dm_report_init_with_selection(uint32_t *report_types,
const struct dm_report_reserved_value reserved_values[],
void *private_data);
int dm_report_object(struct dm_report *rh, void *object);
-int dm_report_set_output_selection(struct dm_report *rh, uint32_t *report_types,
- const char *selection);
int dm_report_output(struct dm_report *rh);
void dm_report_free(struct dm_report *rh);
9 years, 4 months
master - pool: fix typo in error message: then -> than
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a5baf13a06fc50...
Commit: a5baf13a06fc509833803ee4c778bdf9b7f07399
Parent: a057f40155b415be40dac31bb138ee66761ce999
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Dec 4 09:17:48 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Dec 4 09:18:16 2014 +0100
pool: fix typo in error message: then -> than
---
lib/metadata/pool_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
index ee32a3b..95b5867 100644
--- a/lib/metadata/pool_manip.c
+++ b/lib/metadata/pool_manip.c
@@ -402,7 +402,7 @@ int update_pool_params(const struct segment_type *segtype,
return_0;
if ((uint64_t) *chunk_size > (uint64_t) pool_data_extents * vg->extent_size) {
- log_error("Size of %s data volume cannot be smaller then chunk size %s.",
+ log_error("Size of %s data volume cannot be smaller than chunk size %s.",
segtype->name, display_size(vg->cmd, *chunk_size));
return 0;
}
9 years, 4 months
master - mirror: Validate raid region size config setting.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a057f40155b415...
Commit: a057f40155b415be40dac31bb138ee66761ce999
Parent: de53e0955dc43d5f069604553b038fa672463da9
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Dec 3 22:47:08 2014 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Dec 3 22:47:08 2014 +0000
mirror: Validate raid region size config setting.
If necessary, round down to a power of 2 the raid/mirror region size
taken from the config files.
---
lib/metadata/lv_manip.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index b00e11b..4483fba 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -731,7 +731,7 @@ int get_pv_list_for_lv(struct dm_pool *mem,
*
* Returns: default region_size in sectors
*/
-int get_default_region_size(struct cmd_context *cmd)
+static int _get_default_region_size(struct cmd_context *cmd)
{
int mrs, rrs;
@@ -759,6 +759,35 @@ int get_default_region_size(struct cmd_context *cmd)
return rrs;
}
+static int _round_down_pow2(int r)
+{
+ /* Set all bits to the right of the leftmost set bit */
+ r |= (r >> 1);
+ r |= (r >> 2);
+ r |= (r >> 4);
+ r |= (r >> 8);
+ r |= (r >> 16);
+
+ /* Pull out the leftmost set bit */
+ return r & ~(r >> 1);
+}
+
+int get_default_region_size(struct cmd_context *cmd)
+{
+ int region_size = _get_default_region_size(cmd);
+
+ if (region_size > INT32_MAX)
+ region_size = INT32_MAX;
+
+ if (region_size & (region_size - 1)) {
+ region_size = _round_down_pow2(region_size);
+ log_verbose("Reducing mirror region size to %u kiB (power of 2).",
+ region_size / 2);
+ }
+
+ return region_size;
+}
+
int add_seg_to_segs_using_this_lv(struct logical_volume *lv,
struct lv_segment *seg)
{
9 years, 4 months
master - mirror: Restrict region size to power of 2.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=de53e0955dc43d...
Commit: de53e0955dc43d5f069604553b038fa672463da9
Parent: 9258e57a50451fbbabd72a197e6a78a2a5d898db
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Dec 2 14:24:21 2014 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Dec 2 14:24:21 2014 +0000
mirror: Restrict region size to power of 2.
---
WHATS_NEW | 1 +
lib/metadata/mirror.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 645450c..54e46d9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.115 -
=====================================
+ Still restrict mirror region size to power of 2 when VG extent size is not.
Version 2.02.114 - 28th November 2014
=====================================
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index ba3ff6b..d0b1ebf 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -164,7 +164,7 @@ uint32_t adjusted_mirror_region_size(uint32_t extent_size, uint32_t extents,
{
uint64_t region_max;
- region_max = (1 << (ffs((int)extents) - 1)) * (uint64_t) extent_size;
+ region_max = (1 << (ffs((int)extents) - 1)) * (uint64_t) (1 << (ffs((int)extent_size) - 1));
if (region_max < UINT32_MAX && region_size > region_max) {
region_size = (uint32_t) region_max;
9 years, 4 months