1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: fix compare function

Check for enough space in preallocated buffer.
Fixes problem, when lvm code started to suddenly allocate
too big memory chunks.

TODO: lvmetad protocol should announce needed size ahead,
so if metadata have 1MB we are not reallocating memory...
This commit is contained in:
Zdenek Kabelac 2013-06-18 21:58:13 +02:00
parent e3d3921779
commit 155841c349
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Fix use of too big chunks of memory when communication with lvmetad.
Fix vgcfgrestore crash when specified incorrect vg name.
Refine lvm.conf and man page documentation for autoactivation feature.
Add support for thin volumes in vgsplit.

View File

@ -41,7 +41,7 @@ int buffer_read(int fd, struct buffer *buffer) {
buffer->used -= 4;
break; /* success, we have the full message now */
}
if (buffer->used - buffer->allocated < 32)
if (buffer->allocated - buffer->used < 32)
if (!buffer_realloc(buffer, 1024))
goto fail;
continue;