devicemapper: remove 256 character limit of libdm logs
This limit is unecessary and can lead to the truncation of long libdm
logs (which is quite annoying).
Fixes: ("device-mapper: Move all devicemapper spew to log through utils.Debugf().")
@@ -4,6 +4,7 @@ package devicemapper
/*
#cgo LDFLAGS: -L. -ldevmapper
+#define _GNU_SOURCE
#include <libdevmapper.h>
#include <linux/fs.h> // FIXME: present only for BLKGETSIZE64, maybe we can remove it?
@@ -12,14 +13,15 @@ extern void DevmapperLogCallback(int level, char *file, int line, int dm_errno_o
static void log_cb(int level, const char *file, int line, int dm_errno_or_class, const char *f, ...)
{
- char buffer[256];
+ char *buffer = NULL;
va_list ap;
va_start(ap, f);
- vsnprintf(buffer, 256, f, ap);
+ vasprintf(&buffer, f, ap);
va_end(ap);
DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);
+ free(buffer);
}
static void log_with_errno_init()
