dev-dct-process-latest - memlock: ensure memory is allocation before locking
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b0bd8ce4086531f4f83ce417ddb988d8b4e0907a Commit: b0bd8ce4086531f4f83ce417ddb988d8b4e0907a Parent: 2263a3bcf559ef1eba68a6ef6216aca4deaf4d3e Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Sep 19 01:07:32 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Sep 19 01:12:03 2014 +0200
memlock: ensure memory is allocation before locking
strerror may mmap ram if it was not yet used. dm_udev_get_sync_support may initilize udev if it was still not used.
--- lib/mm/memlock.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
lib/mm/memlock.c +3 -3
@@ -266,9 +266,6 @@ 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 ;
@@ -442,6 +439,9 @@ static void _lock_mem(struct cmd_context *cmd) stack; } + (void )strerror (0 );/* Force libc.mo load */ + (void )dm_udev_get_sync_support ();/* udev is initialized */ +log_very_verbose ("Locking memory" );if (!_memlock_maps (cmd,LVM_MLOCK , &_mstats)) stack;