diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 59f544d61..eb14d38fc 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.64 - =================================== + Use word alignment for dm_pool_strdup() and dm_pool_strndup(). Use dm_snprintf() to fix signess warning in dm_set_dev_dir(). Use unsigned loop counter to fix signess warning in _other_node_ops(). Fix const cast in dmsetup calls of dm_report_field_string(). diff --git a/libdm/mm/pool-debug.c b/libdm/mm/pool-debug.c index 7cf2bac89..af1a912fc 100644 --- a/libdm/mm/pool-debug.c +++ b/libdm/mm/pool-debug.c @@ -136,7 +136,7 @@ static struct block *_new_block(size_t s, unsigned alignment) * I don't think LVM will use anything but default * align. */ - assert(alignment == DEFAULT_ALIGNMENT); + assert(alignment <= DEFAULT_ALIGNMENT); if (!b) { log_error("Out of memory"); diff --git a/libdm/mm/pool.c b/libdm/mm/pool.c index 825f7cad8..608826b47 100644 --- a/libdm/mm/pool.c +++ b/libdm/mm/pool.c @@ -27,7 +27,7 @@ void dm_pools_check_leaks(void); char *dm_pool_strdup(struct dm_pool *p, const char *str) { - char *ret = dm_pool_alloc(p, strlen(str) + 1); + char *ret = dm_pool_alloc_aligned(p, strlen(str) + 1, 2); if (ret) strcpy(ret, str); @@ -37,7 +37,7 @@ char *dm_pool_strdup(struct dm_pool *p, const char *str) char *dm_pool_strndup(struct dm_pool *p, const char *str, size_t n) { - char *ret = dm_pool_alloc(p, n + 1); + char *ret = dm_pool_alloc_aligned(p, n + 1, 2); if (ret) { strncpy(ret, str, n);