From d301e5917f40edecb561082af49720c220399b87 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 24 Jun 2010 08:29:30 +0000 Subject: [PATCH] Preload libc locale messages. Preload libc.mo file for localized lvm before taking memory lock - this way we prevent disk access for some error paths in libdm, that prints localized errno messages while they are still in memory locked state. --- WHATS_NEW | 1 + lib/mm/memlock.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 09030ae30..1c659c509 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.69 - ================================ + Preload libc locale messages to prevent reading it in memory locked state. Fix handling of simultaneous mirror image and mirrored log image failure. Version 2.02.68 - 23rd June 2010 diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c index 6da5b571e..bc18c0df8 100644 --- a/lib/mm/memlock.c +++ b/lib/mm/memlock.c @@ -216,6 +216,9 @@ static int _memlock_maps(struct cmd_context *cmd, lvmlock_t lock, size_t *mstats #endif } + /* Force libc.mo load */ + if (lock == LVM_MLOCK) + (void)strerror(0); /* Reset statistic counters */ *mstats = 0; rewind(_mapsh);