1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

6586 Commits

Author SHA1 Message Date
Alasdair Kergon
d7ca49059f Define LVMETAD_SUPPORT in source code 2012-02-28 18:18:48 +00:00
Alasdair Kergon
830057e338 spacing 2012-02-28 18:17:37 +00:00
Alasdair Kergon
98711b45c7 I don't think -u is meant to be used with lvmetad 2012-02-28 18:16:23 +00:00
Alasdair Kergon
b009e2235e Check return values after calling new lvmetad fns
(Haven't checked error path handling though)
2012-02-28 18:08:08 +00:00
Alasdair Kergon
7a3de26248 Fix empty string warning logic in _find_config_str. (1.02.68)
pvcreate gives
WARNING: Ignoring unsupported value for metadata/pvmetadataignore.

It was warning if there is no config file entry instead of only if the node
exists but is empty.
2012-02-28 17:46:47 +00:00
Zdenek Kabelac
505c0cbb2e Check for failing dm_asprintf 2012-02-28 14:25:37 +00:00
Zdenek Kabelac
f2cbcb027e Using enum types for enums
alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
2012-02-28 14:24:57 +00:00
Zdenek Kabelac
7ed8790301 Revert free of allocated segtype
lvm_register_segtype takes ownership of segtype and call destructor
for it in error path.
2012-02-28 14:23:41 +00:00
Peter Rajnoha
3db3d4d895 LVMetaD socket operates in non-blocking mode. 2012-02-28 13:07:03 +00:00
Peter Rajnoha
41d8247b51 Add support for systemd socket handover for common daemon-server code and also add support for new OOM killer adjustment interface.
This code is already a part of dmeventd, but it's modified slightly to check
sockets instead of FIFOs.
2012-02-28 13:05:21 +00:00
Zdenek Kabelac
a22be5e2e9 Test dm_hash_insert() failures mem failures 2012-02-28 11:12:58 +00:00
Zdenek Kabelac
0098904026 Check error from _lv_each_dependency
_lv_mark_if_partial_collect cannot fail, however it's good to keep
checking here as we do in all other cases.
2012-02-28 11:10:45 +00:00
Zdenek Kabelac
c0d7975bb2 Check result of export_vg_to_buffer
and avoid usage of failed buffer.
2012-02-28 11:09:06 +00:00
Zdenek Kabelac
22266ea325 Add stacktrace for init_lvmcache_orphans fail path 2012-02-28 11:08:04 +00:00
Zdenek Kabelac
77e9346a06 Ensure clvmd message is always \0 terminated
Drop whole buffer clearing (most messages at <100 bytes).
Just make sure we have always \0 terminated string for strlen() operations.
(before for PIPE_BUF sized messages this was not set).
2012-02-28 11:06:56 +00:00
Zdenek Kabelac
c998f7d27a Better detection of missing dmeventd fifo connection 2012-02-28 11:03:24 +00:00
Zdenek Kabelac
c9d0627af6 Missed to properly merge patch for definition of MAX_MISSING_LEN
(fix previous commit)
2012-02-28 10:42:20 +00:00
Zdenek Kabelac
49d8753caf Add log_sys_error for close 2012-02-28 10:14:06 +00:00
Zdenek Kabelac
fdc31c7a8a Add some stack traces for dev_close error paths 2012-02-28 10:11:35 +00:00
Zdenek Kabelac
535fbc2256 Explicitely ignore errors in label_read iteration.
We don't want stack traces here, so mark as void.
2012-02-28 10:10:07 +00:00
Zdenek Kabelac
9cdfa9e854 Explicitely check list size of segments
instead of checking for NULL from last_seg and first_seg.
2012-02-28 10:08:20 +00:00
Zdenek Kabelac
c3cb4bb872 Duplicate standard in/out descriptors for daemon
Addressing somewhat tricky bug here.
Since stdin,stdout,stderr were closed it's been occasionally possible to
see some unexpected messages to be flowing into a clvmd and generating some
randomly sized allocation of many megabytes. Since the message was not
being generated by standard send_message() construction, after some more
testing it apperead to be a debug log message - thus something has flown
to local socket opened on strandard out descriptor.

To fix the issue - use standard file descriptor duplication code for daemons.

For making easier debugging of polling daemon - developer might want to recompile
without modifition of standard file descriptors.
2012-02-28 10:06:53 +00:00
Zdenek Kabelac
da0f745cb6 Limit max size of clvmd message
This could be seen as some sort of simple validation - it's not easy to
recognize a valid message for now - but we definitely do not want to
allocate a lot of megabytes in  clvmd memory locked daemon when broken
message gets in.

Size of 8000 is just selected for now - possibly there could be much
lower value put in.
2012-02-28 09:58:19 +00:00
Zdenek Kabelac
9ef8d6617e Do not send uninitilised bytes
Use struct initalizers to fill struct members and at the same time have
all unspecified members set to 0.
2012-02-28 09:53:55 +00:00
Peter Rajnoha
0fd3ed18f1 Fix dm_task_set_name to properly resolve path to dm name.
Wrong variable was checked in _dm_task_set_name_from_path.
2012-02-28 08:36:51 +00:00
Peter Rajnoha
60d0b63380 lvmetad.socket 2012-02-27 15:45:49 +00:00
Zdenek Kabelac
889007ee2c Do not hide deallocation of buffer
As API is passing structures by value, do not leave
the function which created buffer and keeps valid pointer
look like it would be some memory leak and move
free of buffer from inner function - makes more obvious,
how is the memory management handled.
2012-02-27 11:49:16 +00:00
Zdenek Kabelac
95ad3abc76 Add FIXME for misuse in case of dm_event_mask enum.
Using enum for bitmask is not proper solution here.
2012-02-27 11:46:25 +00:00
Zdenek Kabelac
cd1f056f20 Use unsigned type for bitmask
Using report_type_t for bitmask is not correct, since we have not defined types
for all  bit combinations - so switching to unsigned type, since values of
report_type_t enum are unsigned.
2012-02-27 11:45:05 +00:00
Zdenek Kabelac
faf8ad30f1 Just code move of hash initialization in front of function
Make sure both hash tables are initialized before _read_sections() call.
Presents no functional change (since PV scan phase was not adding LV hashes),
but makes the code easier to handle mem failing case, and static analyzer is
hapier as well.
2012-02-27 11:40:58 +00:00
Zdenek Kabelac
4960a3c7f3 Add stack traces for lock_vol failures
Adding at least stack traces with some FIXMEs for cases,
where we might want to do something cleaver - maybe fail command
or give user hints something is not going well ?

For remote_backup is stack probably 'good' enough for now.
2012-02-27 11:35:59 +00:00
Zdenek Kabelac
3b45ebe86b Check id_write_format result
Currently we never fail with 64byte uuid buffer,
but just stay consitent with rest of the code and check for result.
2012-02-27 11:32:48 +00:00
Zdenek Kabelac
d7bb0d77aa Explicitely ignore fail error on hash_insert
We cannot do anything better here anyway - we are already in logging function,
so just ignore this issue here - it will most likely stop application later.
2012-02-27 11:31:30 +00:00
Zdenek Kabelac
125456bb3e Add some log_sys_errors to close() call 2012-02-27 11:28:47 +00:00
Zdenek Kabelac
e51cc452d2 Nicer cleanup of excl_uuid hash
Since it on exit path, it's not a big difference,
but makes less noise in analyzer and valgrind.
2012-02-27 11:26:25 +00:00
Zdenek Kabelac
4f443a0d0c Check for vg_name existance
Since vg_read() mda ops could be called with NULL vg_name,
check it before derefence also for pool and format1.
2012-02-27 11:23:15 +00:00
Peter Rajnoha
7ed9336202 Systemd is linux-specific - move the supporting code under the 'ifdef linux'.
Some 'defines' used in this specific code were already under an ifdef so this
patch just completes it.
2012-02-27 11:13:51 +00:00
Zdenek Kabelac
0027de97c9 Fix missing break
Bug introduced with addition of internal error default case.
Seem like this code is not used.
TODO: add coverage test.
2012-02-27 11:13:48 +00:00
Zdenek Kabelac
6ddd3f5d4c Add assert for oldname
Code cannot proceed if oldname would be NULL.
Since lvmetad currently doesn't use logging mechanism of lvm to report
internal errors - stay with current code style of lvmetad which uses
plain asserts for cases like this.
2012-02-27 10:19:00 +00:00
Zdenek Kabelac
90f31fc31c A bit more safe version of sprintf
Use just buffer size limit (it's used for debug only)
2012-02-27 10:17:06 +00:00
Zdenek Kabelac
061b3169f9 Test seg pointer for non-null
As the function accepts NULL for 'seg' parameter,
check for it before dereference.
2012-02-27 10:15:08 +00:00
Zdenek Kabelac
e2b77ed33c Move allocation after check for vgid
so there is no mem leak on this error path.
Also actually check if the hash exists.
2012-02-27 10:10:43 +00:00
Zdenek Kabelac
b85b9ce4b7 Make force_t enum usage obvious 2012-02-27 10:06:58 +00:00
Zdenek Kabelac
edb0de6539 Test result of _init_tags. 2012-02-27 10:05:35 +00:00
Zdenek Kabelac
1b197085b3 Explicitely ignore result from sync_unlock()
Make it obvious to analyzer - we can't do anything better here anyway.
2012-02-27 10:02:17 +00:00
Zdenek Kabelac
61a6481305 Always check result of _set_vg_name() 2012-02-27 10:00:23 +00:00
Zdenek Kabelac
dc92528f10 Drop uname call, it's not used from gulm era. 2012-02-27 09:58:18 +00:00
Zdenek Kabelac
fe84afbbab Check allocation result 2012-02-27 09:56:27 +00:00
Zdenek Kabelac
9b0c352a57 Remove test for pvid
Since pvid is char buffer[] and not pointer,
there is no point to check it for NULL.
2012-02-27 09:54:25 +00:00
Zdenek Kabelac
c1a04f0fe3 Ignore result of unlock explicitely 2012-02-27 09:52:37 +00:00