summaryrefslogtreecommitdiffstats
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* replace strcat and strcpy with their secure versionsPrasanna Kumar Kalever2018-02-081-1/+1
| | | | | Change-Id: If98ce7b7e50901ee130bbe190a12664ec0adb8c2 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: set configshell file loglevel to infoPrasanna Kumar Kalever2017-09-191-3/+3
| | | | | Change-Id: I64fa708bacff138423a490853e7c50c046a0ad28 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: missing to include signal.hJi-Hyeon Gim2017-09-181-0/+1
| | | | | | | | Problem gluster-blockd using POSIX signal handling but it not includes signal.h Change-Id: Iecb3a17d70226a894bfe9a6fb5b8382d87afde7f Signed-off-by: Ji-Hyeon Gim <potatogim@potatogim.net>
* fix GB_TGCLI_GLOBALS macroPrasanna Kumar Kalever2017-09-011-2/+2
| | | | | | | | change in GB_TGCLI_GLOBALS macro: 's/set global/targetcli set global/' followed by a saveconfig Change-Id: I634f9ecbd7171828cb0da01314deeec99c4dfced Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: use targetcli interactive modePrasanna Kumar Kalever2017-08-281-1/+51
| | | | | | | | | | | | | | | | | | Currently, on each targetcli create call, rtslib will rebuild its bs_cache, so as the /sys/kernel/config/target/core dir gets more entries this takes longer and longer to scan. Hence using repetitive targetcli in the block create for creating iqn, backend, setting acls, setting globals will induce too much delay in block create. As the number of blocks on the node increases, the delay will be too longer. This does not happen if we open targetcli in interactive mode and just do multiple create commands form it, since the bs_cache is build once. Read More: https://goo.gl/8aYT38 Change-Id: I2be78a748e013f253ce8f99746989a1cf735a56f Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* logger: support logdir choosing via Environment variablePrasanna Kumar Kalever2017-08-171-30/+6
| | | | | | | | | | | | Currently the default logdir is DATADIR /log/gluster-block/ This patch will provide a way to change this default logdir via Env variable $ export GB_LOGDIR=/var/log/gluster-block-new-path/ Note: make sure to restart the processes (cli & daemon) after you set GB_LOGDIR Change-Id: Id142e4a4dfe7b6ebc9cf8296b8ceb8bff37691b8 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* Terminate gracefully when svc_register failsPranith Kumar K2017-06-141-14/+18
| | | | | | | | | In cases when svc_register fails, gluster-blockd will print the reason and terminate gracefully. Fixes: #26 Change-Id: Ia243771d99fbaa674f317e7c8e64174f4d8d6234 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* Fix compiler warningsPranith Kumar K2017-06-061-1/+0
| | | | | Change-Id: I9dd396737a6719fe3828ec3e9c26bfd8aa1da238 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* logger: filter log messages based on severity levelPrasanna Kumar Kalever2017-06-051-23/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds '--log-level' options supported log levels: { "NONE", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE" } TRACE being max logging $ gluster-blockd --help [...] --log-level <LOGLEVEL> Logging severity. Valid options are, TRACE, DEBUG, INFO, WARNING, ERROR and NONE [default: INFO] [...] Change-Id: I5a387eea3e7e7be10a0b56102a61eb81b4ebf2fa Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: make glfs lru cache capacity configurablePrasanna Kumar Kalever2017-06-052-3/+68
| | | | | | | | | | | | | | | | | | $ gluster-blockd --help gluster-blockd (0.2) usage: gluster-blockd [--glfs-lru-count <count>] commands: --glfs-lru-count <count> glfs objects cache capacity [max: 512] (default: 5) --help show this message and exit. --version show version info and exit. Change-Id: I00a9277690a1c5ace51e223e9e4ed9ce61ae2428 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cache: implement LRU cache to hold glfs objectsPrasanna Kumar Kalever2017-06-052-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ------- 1. Currently, each cli command take ~5 secs for execution. The Maximum latency is due to initializing a glfs object (glfs_init() and friends). 2. OOM kills due to glfs_fini() leaks (~10MB per object) Solution: -------- Caching bipasses glfs_init() calls from the very next command, as in the first command it goes via the glfs_init route, since there will be cache miss. Hence with caching cli command on a local machine should take ~1 sec. ATM, the cache query looks at the volume name only, as the host name will be localhost in our case and transport will be tcp 24007 always. The default cache capacity is 5 i.e there can be a max of five glfs entries in the cache, anything more will lead to release of least recently used object. This way, if there are <= 5 volume in use for block, there will be no glfs_fini() calls, hence no leaks, no OOM's. The next patch will help in making cache capacity configurable. Change-Id: Ia891451cb92cf09959c1aff85976d78302ec7014 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> [ndevos: correct compiling+linking against libgfapi.so]
* gluster-blockd: handle SIGPIPEPrasanna Kumar Kalever2017-05-241-0/+3
| | | | | Change-Id: I2e0dd64ea1b07d09fa28151a46b703af1d05eed9 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: use SO_REUSEADDR on bindVijay Bellur2017-05-191-0/+7
| | | | | | | | | | | | | | Currently immediate restarts of gluster-blockd failsi with: [1495181620] ERROR: bind on port 24006 failed (Address already in use) Since the closed socket connection is still in TIME_WAIT on 24006 This patch sets socket option SO_REUSEADDR, which allows gluster-blockd to bind even if socket is in a TIME_WAIT state. Change-Id: I4e6b3c5d3930e6fca222b11c34b35f883d9be730 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* build: use rpcgen to generate all XDR codeNiels de Vos2017-03-172-3/+5
| | | | | | | | | | | | | | | | | | | | | Remove all generated files and have them generated when needed. This build a libgbrpcxdr.la archive with the .o files that gets linked into the libgbrpc.la archive. 'rpcgen' generates .c code that triggers warnings for various compilers. This is not something that can easily be fixed, so add rpc-pragmas.h (like GlusterFS does) to prevent these warnings. There are some functions used by gluster-blockd.c that are not part of the header and were manually added to block.h. Because block.h get regenerated now, these functions have been added to a new file block_svc.h. Note that generated and compiled files land in $(top_builddir). This directory does not need to be the same as $(top_srcdir). Change-Id: I0e764d159d6d785699537eed4e24b16883218038 Fixes: #2 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* lockfile: don't allow multiple instances of daemon to runPrasanna Kumar Kalever2017-02-211-6/+36
| | | | | | | | | | | | | | until now there is no check to defend on multiple runs of daemon within the same node. This patch takes a non blocking lock on 'gluster-blockd.lock' file, if it succeeds only then daemon is allowed to run, if there is already a lock on lock-file (taken by some other instance of gluster-blockd) we will exit. This patch also renames GB_UNIX_ADDRESS from gluster-block.socket to gluster-blockd.socket, as that makes better sense. Change-Id: I43b285f9da15d078fe3df4d231d0ef8d44272d8f Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: refactor return valuesPrasanna Kumar Kalever2017-02-191-1/+1
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: fix minor bugsPrasanna Kumar Kalever2017-02-161-9/+26
| | | | | Reported-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: cart off unwanted output from create commandPrasanna Kumar Kalever2017-02-151-1/+1
| | | | | | | | | | | | | | The response of below sub-operations as part of create are undesired $ targetcli set global auto_add_default_portal=false $ targetcli / saveconfig $ targetcli set attributes generate_node_acls=1 demo_mode_write_protect=0 Hence redirecting them to '/dev/null' This patch also fix a bug in the previous patch i.e. missed inverting [!] function return in if() Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: create logging directoriesPrasanna Kumar Kalever2017-02-152-2/+26
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: redirect logs to logdirPrasanna Kumar Kalever2017-02-141-27/+61
| | | | | | replace fprintf calls with LOG() Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: review fixes in gluster-blockPrasanna Kumar Kalever2017-02-111-5/+5
| | | | | | Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* build: add uuid and pthread libraries to dependency listPrasanna Kumar Kalever2017-02-071-1/+1
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: migrate build to libtoolz and create rpmPrasanna Kumar Kalever2017-02-072-0/+132
Till now we had simple makefile for checking dependencies and building. Using libtoolz will give more control on dependency checks and flexibility. This patch also introduce rpm build feature. Compiling: $ ./autogen.sh $ ./configure $ make -j $ make install Building RPMS: $ make rpms Running: $ systemctl start gluster-blockd.service Using CLI: $ gluster-block help Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>