1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

fix: use 64bit math for reserved memory

If the user specifies number in the range of [4G/1024, 4G>,
the used value would wrap around (32bit math).
So keep the math 64bit.

Note, using such large lvm.conf values is pointless with lvm2.
This commit is contained in:
Zdenek Kabelac 2012-06-21 12:59:14 +02:00
parent 6f3cd63551
commit 192fa11dab
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.97 -
===============================
Use 64bit math for reserved memory and stack.
Add tests for kernel_send() errors in cmirrod.
Print clean_bits in pull_state, fix cut&paste typo in cmirrord.
Add tests for errors from closedir(), close() in cmirrord.

View File

@ -446,12 +446,12 @@ void memlock_dec_daemon(struct cmd_context *cmd)
void memlock_init(struct cmd_context *cmd)
{
/* When threaded, caller already limited stack size so just use the default. */
_size_stack = 1024 * (cmd->threaded ? DEFAULT_RESERVED_STACK :
_size_stack = 1024ULL * (cmd->threaded ? DEFAULT_RESERVED_STACK :
find_config_tree_int(cmd, "activation/reserved_stack",
DEFAULT_RESERVED_STACK));
_size_malloc_tmp = find_config_tree_int(cmd,
"activation/reserved_memory",
DEFAULT_RESERVED_MEMORY) * 1024;
DEFAULT_RESERVED_MEMORY) * 1024ULL;
_default_priority = find_config_tree_int(cmd,
"activation/process_priority",
DEFAULT_PROCESS_PRIORITY);