summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd/clvmd.c
Commit message (Collapse)AuthorAgeFilesLines
* clvmd: release excl_uuid hashZdenek Kabelac2012-08-231-1/+2
| | | | Release allocated hash before exit.
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-10/+15
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* Avoid closing clvmd socket twice.Milan Broz2012-03-271-0/+2
|
* Make sure namelen fits into buffer allocated on stackZdenek Kabelac2012-03-231-0/+3
|
* Correct enum typeZdenek Kabelac2012-03-011-3/+3
| | | | Using debug_t and some forgetten alloc_policy_t, force_t from past commit.
* Few more close and dev_close traceZdenek Kabelac2012-03-011-7/+9
| | | | Adding (void) where we cannot really report an error.
* Ensure clvmd message is always \0 terminatedZdenek Kabelac2012-02-281-3/+3
| | | | | | 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).
* Missed to properly merge patch for definition of MAX_MISSING_LENZdenek Kabelac2012-02-281-1/+1
| | | | (fix previous commit)
* Add log_sys_error for closeZdenek Kabelac2012-02-281-2/+3
|
* Limit max size of clvmd messageZdenek Kabelac2012-02-281-1/+3
| | | | | | | | | | 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.
* Do not send uninitilised bytesZdenek Kabelac2012-02-281-31/+27
| | | | | Use struct initalizers to fill struct members and at the same time have all unspecified members set to 0.
* Add some log_sys_errors to close() callZdenek Kabelac2012-02-271-1/+2
|
* Nicer cleanup of excl_uuid hashZdenek Kabelac2012-02-271-3/+7
| | | | | Since it on exit path, it's not a big difference, but makes less noise in analyzer and valgrind.
* A bit more safe version of sprintfZdenek Kabelac2012-02-271-1/+1
| | | | Use just buffer size limit (it's used for debug only)
* Drop uname call, it's not used from gulm era.Zdenek Kabelac2012-02-271-2/+0
|
* A bit more readable codeZdenek Kabelac2012-02-081-16/+9
| | | | Just a minor readability conversion.
* Oops missed braces in previous commitZdenek Kabelac2012-01-261-1/+2
| | | | | This has disabled clvmd for being executed. (FIXME improve testing part to catch this fault)
* Fix leak of hash tableZdenek Kabelac2012-01-251-0/+1
| | | | Minor leak on command initialization.
* Add CLVMD_FLAG_REMOTE to skip processing on local node.Alasdair Kergon2012-01-211-4/+15
|
* Remove unused variablesZdenek Kabelac2011-10-111-1/+0
|
* Add some fixme lockingZdenek Kabelac2011-10-111-0/+4
| | | | | | Code here is using thread write protected variable without locking. So add locking, for proper synchronization and a FIXME, since the code needs closer look.
* Simplify worker loopZdenek Kabelac2011-10-111-11/+10
| | | | | Do not reacquire mutex several times without a real reason. Code readability is also better.
* Use barrier instead of mutexZdenek Kabelac2011-10-111-9/+7
| | | | | | Barrier is supposed to be used in situation like this and replace tricky mutex usage, where mutex has been unlocked by a different thread than the locking thread.
* Add FIXMEs for init_testZdenek Kabelac2011-10-111-3/+5
| | | | | | Usage of thread unprotected init_test is not correct and needs probably lvm lock since it part of lvm library. Current implementation may probably fail with test mode and actually create something unexpectedly (and vice versa).
* Limit thread stackZdenek Kabelac2011-10-111-4/+12
| | | | | | | | | | Since default thread stack size is around 8MB and clvmd creates for now thread for message, clvmd may easily reach multi GB size of in-memory locked pages (runs with mlockall()). This patch significantly reduces memory usage to just tens of MB, and now different reasons are the cause of server overloading. Now we are running out of free file descriptors mostly.
* CLVMD bugfix support for args -S -EZdenek Kabelac2011-09-241-3/+16
| | | | | | | | | | | | | | | | | | Bugfix: Add (most probably unfinished) support for -E arg with list of exclusive locks. (During clvmd restart all exclusive locks would have been lost and in fact, if there would have been an exclusive lock, usage text would be printed and clvmd exits.) Instead of parsing list options multiple times every time some lock UUID is checked - put them straight into the hash table - make the code easier to understand as well. Remove was_ex_lock() function (replaced with dm_hash_lookup()). Swap return value for get_initial_state() (1 means success). Update man pages and usage info for -E option.
* Fix clvmd processing of invalid request on local socket. (rommer)Milan Broz2011-09-161-5/+27
| | | | | | | Code now detects small packet and wrong arglen and reply with error intead of infinite loop. https://bugzilla.redhat.com/show_bug.cgi?id=738484
* more pre-release fixesAlasdair Kergon2011-08-121-1/+1
|
* Never ever use uninitialised descriptors if pipe() failsMilan Broz2011-08-111-2/+12
| | | | | | | | | | | | | | (because of maximum open count fd exceeded or so). Better return busy message, so even clients fail in more controlled way. Without patch, clvmd crashes with various strange backtraces if under heavy load of connection requests. https://bugzilla.redhat.com/show_bug.cgi?id=698393 https://bugzilla.redhat.com/show_bug.cgi?id=697945 (It still can OOM but that's different issue.)
* Remove obsoleted GULM clvmd cluster locking support.Milan Broz2011-08-091-25/+4
|
* Annotate CLVMD_CMD_SYNC_NAMES in decode_cmdZdenek Kabelac2011-06-281-0/+3
|
* Fix some unmatching sign comparation gcc warningsZdenek Kabelac2011-04-081-1/+1
| | | | Simple replacement for unsigned type - usually in for() loops.
* Keep noreturn attribute for lvm_thread_fnZdenek Kabelac2011-03-301-1/+1
| | | | | Even thought my gcc seems to not need it, as it's deduced from pthread_exit(), keep it here for older compiler to avoid getting warnings.
* Better shutdown for clvmdZdenek Kabelac2011-03-301-8/+25
| | | | | | | | | | | | | | | 'a small step' towards cleaner shutdown sequence. Normally clvmd doens't care about unreleased memory on exit - but for valgrind testing it's better to have them cleaned all. So - few things are left on exit path - this patch starts to remove just some of them. 1. lvm_thread_fs is made as a thread which could be joined on exit() 2. memory allocated to local_clien_head list is released. (this part is somewhat more complex if the proper reaction is needed - and as it requires some heavier code moving - it will be resolved later.
* Fix -Wold-style-definition gcc warningsZdenek Kabelac2011-03-291-5/+6
|
* Do not send random bytes in messageZdenek Kabelac2011-03-081-3/+8
| | | | | | | | | | | | | Fixing few issues: struct clvm_header contains 'char args[1]' - so adding '+ 1' here for message length calculation is 1 byte off. Message with last byte uninitialized is then passed to write function. Update also related arglen. Initialise xid and clintid to 0. Memory allocation is checked for NULL
* Fix clvmd return code for bad options.Milan Broz2011-03-081-6/+12
| | | | | | | | We should return exit code 2 for unknown option. Patch also adds standard --help option instead. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=666991
* Lower severity of selabel_lookup and matchpathcon failure to log_debug.Peter Rajnoha2011-03-031-1/+1
|
* Fix some compile warnings on RHEL5Milan Broz2011-03-011-2/+7
| | | | | | - returned char not needed to be explicitly const - warn if pipe() fails in clvmd (more fixes here needed for error paths...) - assign (and ignore) read() output in drain buffer
* Remove dead codeZdenek Kabelac2011-02-281-5/+0
| | | | | Remove code which is no longer used. Code which has been using msg_malloced was removed in 2007.
* Const fixingZdenek Kabelac2011-02-181-1/+1
| | | | | | | | | | | | | | | | Fixing some const warnings - with API change in: int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names, Change is needed - as lvm2api expects const behaviour here. So vg_extend() is doing local strdup for unescaping. skip_dev_dir return const char* from const char* vg_name. Rest of the patch is cleanup of related warnings. Also using dm_report_filed_string() API change to simplify casting in _string_disp and _lvname_disp.
* Void* arithmetic replaced with char*Zdenek Kabelac2011-02-181-1/+1
|
* Add -f (don't fork) option to clvmd and fix clvmd -d<num> description.Milan Broz2011-01-171-24/+43
|
* Remove dead assignment to thisfdZdenek Kabelac2011-01-051-2/+0
| | | | Value of 'thisfd' is not read again after its assigment
* Fix last pthread_join fix commitZdenek Kabelac2010-12-221-4/+6
| | | | | | | | Call for pthread_join() does not set errno value even though return values looks like that. For now assign errno from return value and still use strerror() to print some error message as this seems to be commonly used. Add also log_sys_error() message for error close of local pipe.
* Log error state from pthread_join operationZdenek Kabelac2010-12-221-6/+7
| | | | Value jstat is unused - so replace it with logging via log_sys_error().
* Replace multiple fprintf calls with one large string parameterZdenek Kabelac2010-12-201-21/+20
|
* Create /var/run/lvm directory during clvmd initialisation if missing.Peter Rajnoha2010-12-131-0/+11
| | | | | | We need to be sure that /var/run and /var/lock is always there. (E.g. these two directories could be using tmpfs which then loose all the content after reboot.)
* Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.Peter Rajnoha2010-12-131-0/+7
| | | | | | | | | | | Detect existence of new SELinux selabel interface during configure. Use new dm_prepare_selinux_context instead of dm_set_selinux_context. We should set the SELinux context before the actual file system object creation. The new dm_prepare_selinux_context function sets this using the selabel_lookup fn in conjuction with the setfscreatecon fn. If selinux/label.h interface (that should be a part of the selinux library) is not found during configure, we fallback to the original matchpathcon function instead.
* Log error from unlink failureZdenek Kabelac2010-12-011-1/+2
|