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

28 Commits

Author SHA1 Message Date
Zdenek Kabelac
8545621d39 cov: replace strcpy with memcpy
When we know the size we can avoid using strcpy.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
0b19387dae headers: use configure.h as 1st. header
Ensure configure.h is always 1st. included header.
Maybe we could eventually introduce gcc -include option, but for now
this better uses dependency tracking.

Also move _REENTRANT and _GNU_SOURCE into configure.h so it
doesn't need to be present in various source files.
This ensures consistent compilation of headers like stdio.h since
it may produce different declaration.
2018-12-14 15:09:13 +01:00
Joe Thornber
d5da55ed85 device_mapper: remove dbg_malloc.
I wrote dbg_malloc before we had valgrind.  These days there's just
no need.
2018-06-08 13:40:53 +01:00
Joe Thornber
ccc35e2647 device-mapper: Fork libdm internally.
The device-mapper directory now holds a copy of libdm source.  At
the moment this code is identical to libdm.  Over time code will
migrate out to appropriate places (see doc/refactoring.txt).

The libdm directory still exists, and contains the source for the
libdevmapper shared library, which we will continue to ship (though
not neccessarily update).

All code using libdm should now use the version in device-mapper.
2018-05-16 13:00:50 +01:00
Joe Thornber
7f97c7ea9a build: Don't generate symlinks in include/ dir
As we start refactoring the code to break dependencies (see doc/refactoring.txt),
I want us to use full paths in the includes (eg, #include "base/data-struct/list.h").
This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in
metadata/ from base/
2018-05-14 10:30:20 +01:00
Alasdair G Kergon
f1cc5b12fd tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
Christian Brauner
46b735c937 lvmetad: fix segfault on i386
Sending %d as format argument in lvmetad_vg_remove_pending() will cause
segfaults in config_make_nodes_v() when va_arg() casts to int64_t. Also, it is
clearly advertised in the lvm source code that using plain %d is prohibited, so
let's switch to FMTd64.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-03-13 13:37:07 -05:00
Peter Rajnoha
045772aa30 config: add config_tree_from_string_without_dup_node_check to replace dm_config_from_string where needed 2016-09-21 18:18:15 +02:00
Zdenek Kabelac
2988fa3c21 coverity: helping coverity with NULL pointer
Helping with understanding we will not try to deref NULL pointer,
as if the sizes are initialized to NULL it also means 'mem' would
be NULL, but thats too hard to model so make it obvious.
2016-02-26 10:21:36 +01:00
Zdenek Kabelac
fcbef05aae doc: change fsf address
Hmm rpmlint suggest fsf is using a different address these days,
so lets keep it up-to-date
2016-01-21 12:11:37 +01:00
Zdenek Kabelac
36ee367343 libdaemon: prohibit use of %d for 64bit numbres
Do not let pass %d and print internal error when found one.
Require all users to use  FMTd64 - it's seriously confusing.
2015-11-09 14:03:25 +01:00
David Teigland
c805fa7c40 lockd: add debug logging for metadata error
When lvmetad_pvscan_vg() reads VG metadata from each PV,
it compares it to the last one to verify it matches.
If the VG metadata does not match on the PVs, an error
is printed and it fails to read the VG.  In this error
case, use log_debug to show the differences between
the two unmatching copies of the metadata.
2015-09-29 13:51:24 -05:00
Peter Rajnoha
1481125042 libdaemon: config_make_nodes_v needs fixing
Put the change from commit #10d27998b3d2f6100e9e29e83d1d99948c55875f
back so we have working tree again for now. This code needs a bit of
a cleanup to return proper return value to check...
2015-07-09 16:34:08 +02:00
Alasdair G Kergon
dfe3eb12d0 include: Standardise around new tool.h. 2015-07-06 17:30:18 +01:00
Alasdair G Kergon
810ab095e6 macros: Wrap PRI with FMT.
Create a set of wrappers with embedded % such as
  #define FMTu64 "%" PRIu64
2015-07-06 15:09:17 +01:00
David Teigland
fd1376ebef libdaemon: move compare_config to lib
so it can be used elsewhere.
2015-06-17 13:07:52 -05:00
Petr Rockai
2ebb4f4ca3 libdaemon: Export chain_node from config-utils.c. 2015-04-14 20:16:53 +02:00
Zdenek Kabelac
b7741f0a83 libdaemon: header cleanup
Ensure  daemon-io.h is used as a generic header included
with configure defines before other headers.
(In future all lvm2 libraries should settle on a single lib.h header)
Rename couple defines to better match header file names.
2014-04-18 16:38:49 +02:00
Zdenek Kabelac
e3d3921779 lvmetad: use dm_ malloc wrappers
Use matching dm_ functions for internally used buffers.
2013-06-18 22:11:31 +02:00
Zdenek Kabelac
788ac7fa54 libdaemon: check for strdup result
Detect failure of dm_pool_strdup() and print error in fail path.
Save one extra strchr call - since we already know the distance
for the '=' character.

Drop stack trace from return after log_error().
2012-12-15 17:23:26 +01:00
Zdenek Kabelac
920352da70 lvmetad: fix leak of append on error path 2012-10-14 23:14:48 +02:00
Zdenek Kabelac
88c547d1ca lvmetad: move initialization in the inner loop
Set append to NULL in the front of cycle, so the INTERNAL error path
is not leading to double-free of append pointer.
2012-10-13 19:15:15 +02:00
Zdenek Kabelac
5a958655dd lvmetad: fix test for dm_asprintf 2012-10-12 11:36:01 +02:00
Zdenek Kabelac
f2a5d3ae3a lvmetad: validate dm_asprintf in buffer_append_vf
Check result of dm_asprintf
Check buffer_append result
Declare vars in front
2012-10-12 10:59:10 +02:00
Zdenek Kabelac
5c792f620b lvmetad: check result of buffer_realloc 2012-10-12 10:59:10 +02:00
Zdenek Kabelac
9ee071705b cleanup: fix compiler warnings
remove unused vars
move var declarations into the front of functions.
fix some sign warnings
2012-10-12 10:25:07 +02:00
Petr Rockai
b07df8850a libdaemon: Make buffer handling asymptotically more efficient. 2012-10-11 18:09:41 +02:00
Petr Rockai
662a2122f6 libdaemon: Split daemon-shared.[hc] into daemon-io.[hc] and config-util.[hc]. 2012-09-26 17:26:23 +02:00