1
0
mirror of https://github.com/gluster/gluster-block.git synced 2026-02-05 21:45:39 +01:00
Commit Graph

147 Commits

Author SHA1 Message Date
Vijay Bellur
c18237cacd Update version in INSTALL 2017-10-16 21:19:50 -04:00
Prasanna Kumar Kalever
d459f06acc NEWS: update
Change-Id: I7b1b4ca913dd04b6578423e258d76f9062542b4d
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
v0.3
2017-10-13 20:02:55 +00:00
Prasanna Kumar Kalever
258f30c6d7 cli: defend on minimum block size
From,
$ targetcli /backstores/user:glfs/block get attribute
ATTRIBUTE CONFIG GROUP
======================
hw_block_size=512 [ro]
----------------------

Hence making the min acceptable size to be 1 sector/block i.e. 512 bytes

This patch also, explicitly mention in docs about bytes as default size units.

Change-Id: Iec8797082d02cc9ad51fc17e11f2ba3073aaeda0
Fixes: #35
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-10-09 13:54:57 +00:00
Prasanna Kumar Kalever
e6ed5b53cf delete/rollback: check for matching gbid before deleting a block
Currently we are just checking for blockname in targetcli list output, if it
exist we will delete the backend.

We do not check if block belongs to a given volume (say vol1), because of which
a rollback on a failure to create block with same name, on same node but on a
different volume (say vol2) deletes block backend belonging to vol1.

Solution:
only if blockname + gbid matches continue delete.

Change-Id: I396c228dad3cf4f51cc6676a266b837bdf6040c7
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-10-09 11:13:20 +05:30
Prasanna Kumar Kalever
59572e84b1 spec: fix unclosed %if block
Change-Id: Iab80dd7fea69eb28630ed563fda4db72ceeaadbe
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-09-25 14:42:27 +05:30
Niels de Vos
e364da1148 rpm: include suggested changes from Fedora package review
gluster-block has been packaged for Fedora and reviewing the .spec
showed some areas where improvements could be done. The following
changes are part of the Fedora package, so it would be good to include
them here as well:

- added systemd macros in the scriptlets
- use pkgconfig for BuildRequires
- run setup in quiet mode
- run make_* macros instead of make commands in build/install section
- drop the INSTALL file from the documentation

Change-Id: Ic0d28eb900aabd2199b6a021db3790ec023cdf25
URL: https://src.fedoraproject.org/rpms/gluster-block
BUG: https://bugzilla.redhat.com/1467677
Signed-off-by: Niels de Vos <ndevos@redhat.com>
2017-09-22 11:56:35 +02:00
Ji-Hyeon Gim
feb517ae13 dist: supports initd for non-systemd distros
Problem
    gluster-blockd supports systemd officially but many legacy distros
    want to use initd

Resolve
    includes initd scripts for non-systemd distros

Change-Id: I8495e8d9abbef6d26ac7dc8dbbe6d07e7713f537
Signed-off-by: Ji-Hyeon Gim <potatogim@gluesys.com>
2017-09-21 19:30:27 +09:00
Michael Adam
95db5c36b3 configure: make sysconfig directory configurable
This is currently hard-coded to /etc/sysconfig, which
makes it impossible to entirely install under a prefix.
This patch introduces a new switch --with-sysconfigdir
defaulting to /etc/sysconfig, which lets one reconfiure
the sysconfig directory.

Change-Id: I316f8355c3ddcfece3322f30a45108bdc636637d
Signed-off-by: Michael Adam <obnox@redhat.com>
2017-09-20 15:51:54 +00:00
Niels de Vos
e5c78e1a42 build: do not require 'git' to find the version
While looking into packaging gluster-block for Fedora, I noticed that
'git' is used to determine the version. The downloads from GitHub are
not archives that have been created with 'make dist', and hence
./autogen.sh is still needed to be run.

./autogen.sh generates all the needed bits, including the ./configure
script that tries to figure out the version. If ./configure runs in a
non-git directory, no version can be found.

In order to solve this, I'm adding a VERSION file in the root of the
project. If this file exists, it is used to fetch the version, instead
of trying to run git. The basic usage for RPM packaging in distributions
can then be:

  echo %{version} > VERSION
  ./autogen.sh
  %configure

Note that the VERSION file is not needed for building from a git
repository. However, this file can get packaged in the 'make dist'
tarball so that building from the tarball does not require git.

Change-Id: Ied378c7071ee4a108a1e946dccbb7f223b7aeb9f
Updates: #25
Signed-off-by: Niels de Vos <ndevos@redhat.com>
2017-09-19 12:15:30 +00:00
Prasanna Kumar Kalever
ffebf6c2c5 daemon: set configshell file loglevel to info
Change-Id: I64fa708bacff138423a490853e7c50c046a0ad28
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-09-19 17:04:47 +05:30
Prasanna Kumar Kalever
149c72ca06 socket: switch to MT-safe get host addr info
This was fixed in an attempt to clean the sockfd leaks

Change-Id: Icd82635134050c83167a48b451b347f5c2b9bf39
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2017-09-19 11:20:32 +05:30
Prasanna Kumar Kalever
3d0953aa99 rpc: switch to MT-safe block RPC routines
blockResponse *
block_delete_1(blockDelete *argp, CLIENT *clnt)
{
        static blockResponse clnt_res; <<<<<<-------- Same memory is used by everyone

        memset((char *)&clnt_res, 0, sizeof(clnt_res)); <<<<<---- Here memset is happening
        if (clnt_call (clnt, BLOCK_DELETE,
                (xdrproc_t) xdr_blockDelete, (caddr_t) argp,
                (xdrproc_t) xdr_blockResponse, (caddr_t) &clnt_res,
                TIMEOUT) != RPC_SUCCESS) {
                return (NULL);
        }
        return (&clnt_res); <<<<<---- ptr to this memory is returned.
}

So while Thread-1 is returned "return (&clnt_res);" another thread could be
doing "memset((char *)&clnt_res, 0, sizeof(clnt_res));"

This seem to be a day-1 gluster-blockd bug from the looks of it.

Change-Id: I3fc76d7814c4fe5b286577586ec44d752dcc73f0
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2017-09-19 04:07:48 +00:00
Ji-Hyeon Gim
2ab382593a gluster-block: missing to include signal.h
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>
2017-09-18 14:56:47 +00:00
Prasanna Kumar Kalever
def66b1cae configure: add gluster-block-target.service to AC_CONFIG_FILES list
Change-Id: I9ab049253c013fd23e9065e5a35451aea4ef4e52
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-09-15 22:10:57 +05:30
Prasanna Kumar Kalever
f20605d853 systemd: fix systemd dependency list
This patch brings a wrapper target service unit 'gluster-block-target.service'
which ensures tcmu-runner gets activated.

To fix this properly we need a change in tcmu-runner [1] unit which has to define
precedence of glusterd service.

[1] https://github.com/open-iscsi/tcmu-runner/pull/296

Change-Id: I32d7d82eec03e0cc9111eb58241190af30244a3c
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-09-15 13:56:25 +00:00
Michael Adam
9d76a57dc9 docs: fix error in gluster-blockd manpage
Examples used --glfs-cache-count instead of --glfs-lru-count.

Change-Id: Ia45cb32d91ff4f4490a64ab014212c0e7aa9fb7c
Signed-off-by: Michael Adam <obnox@redhat.com>
2017-09-15 12:03:07 +00:00
Prasanna Kumar Kalever
f45ef68512 fix GB_TGCLI_GLOBALS macro
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>
2017-09-01 14:52:09 +05:30
Prasanna Kumar Kalever
1a0e590851 misc: fix warnings
Change-Id: I11274ad59925ec3d034baefc2cc2e307afa45479
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-08-29 23:00:13 +05:30
Prasanna Kumar Kalever
64ba10f397 gluster-block: parse remote command outputs
Change-Id: Ic2317843a8bd882fc26233373a4b4c35b13f24c6
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-08-28 20:56:04 +05:30
Prasanna Kumar Kalever
1316624066 gluster-block: use targetcli interactive mode
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>
2017-08-28 09:36:00 +00:00
Prasanna Kumar Kalever
91d9da62ce rpc: use port 24010 for all gluster-blockd management
It looks like 24006 port is already registered by some other service,
and from [1] it looks like 24007 - 24241 are unassigned.

Currently,
24007 -> glusterd (tcp)
24008 -> glusterd (rdma)
24009 -> glustereventsd

so for gluster-blockd communications lets choose port 24010

[1] https://goo.gl/B2A4RU

Change-Id: I7d9f14b9897e479cececd2271ebf8a975d26ef71
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-08-24 12:13:39 +05:30
Michael Adam
5194949db2 configure: fix indentation of --with-systemddir
by using AC_HELP_STRING

Change-Id: I07130e15e2689d6c2ea9a21dfb7e8e2511838976
Signed-off-by: Michael Adam <obnox@redhat.com>
2017-08-21 10:34:22 +00:00
Prasanna Kumar Kalever
b535c44fdd logger: support logdir choosing via Environment variable
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>
2017-08-17 14:22:55 +05:30
Prasanna Kumar Kalever
d723907c8e gluster-block: support force delete option
$ gluster-block help
gluster-block (0.2.1)
usage:
  gluster-block <command> <volname[/blockname]> [<args>] [--json*]

commands:
[...]
  delete  <volname/blockname> [force]
        delete block device.
[...]

Change-Id: I64ac01ec148e2e1d4d0ba0d4c5560df9334d58f5
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-08-08 15:44:32 +05:30
Prasanna Kumar Kalever
44f732d877 gluster-block: do not allow delete if any node is down
Change-Id: If729b80a8139add989170d3b590e92706128c37e
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-08-03 18:16:05 +05:30
Prasanna Kumar Kalever
c6295a4e56 create: move saveconfig out of the loop
In the previous patch,

`commit f2e46779c0
  Author: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
  Date:   Fri Jul 7 15:51:38 2017 +0530

  tcmu: backstore attribute set cmd_time_out=0
  [...]`

unintentionally saveconfig was left inside the loop. Hence fixing this by
pushing it outside.

Problem:
Currently, while populating 'exec' variable the following line after saveconfig
i.e. at line GB_FREE(tmp); the 'tmp' variable is made NULL; Hence in each
loop, condition if(!tmp) is always true, and the 'else' set of statements will
never be executed.

Impact:
On block create with HA > 1, only for Nth(last) node portal gets created for
rest of the nodes portal and their attr will never be created/set. As a
result block is not exported correctly.

Also, remove duplicated DEVNULLPATH redirection with attr setting

Change-Id: I1f77461de6b89af4e4af098e0444ea3526669030
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-07-13 00:31:54 +05:30
Prasanna Kumar Kalever
f2e46779c0 tcmu: backstore attribute set cmd_time_out=0
currently, runner is not supporting the non-zero cmd timeouts (cmd_time_out !=0)

The tcmu cmd timer just fails the kernel command after cmd_time_out seconds,
leaving the runner command running. When it is zero, it means do not run the
timer, so both the kernel and runner wait for the command to complete.

This patch sets the backstore attribute cmd_time_out=0

Change-Id: Ib7a80c82d0aafe345ff4e79ce88dc92848306f4e
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-07-07 11:47:36 +00:00
Prasanna Kumar Kalever
ac7674554e cli: show 'prealloc' option in the hint msg
$ gluster-block create
Inadequate arguments for create:
gluster-block create <volname/blockname> [ha <count>] [auth<enable|disable>] \
    [prealloc <full|no>] <HOST1[,HOST2,...]> <size> [--json*]

Change-Id: Ib089598fd9b386bd3475dd421b41c45ebb01c9d2
Fixes: #33
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-07-07 16:55:24 +05:30
Prasanna Kumar Kalever
70c4e2281f create: clean metafile along with storage when EntryCreate fails
As of now, if an EntryCreate (backend storage create) fails for some reasons
like no space left, we only clean storage, leaving metafile.

This patch will delete metafile along with backend storage from the volume.

Change-Id: I89247b98602c5b991367f671134de496c294f984
Fixes: #32
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-07-06 18:02:26 +05:30
Niels de Vos
0a21a55652 utils: fix trivial compile warning
The following warning is reported with Fedora Rawhide (F-27) that comes
with an updated gcc version (7.1.1):

  utils.c:217:21: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
     if (!tmp && (size * count)) {
                 ~~~~~~^~~~~~~~

Change-Id: If1645e0e1cc1eaa1d8261914918c5a5be13d6dd8
Signed-off-by: Niels de Vos <ndevos@redhat.com>
2017-07-04 18:28:59 +00:00
Pranith Kumar K
244cd8fe21 Show error message when response contains failure
Change-Id: If7a232e4a1d550b3912402282c21d0d033aa00d2
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2017-06-30 10:46:04 +00:00
Prasanna Kumar Kalever
89b6971641 gluster-block: update systemd unit and spec file
systemd-unit:
iscsid.service is needed by initiator not target

spec:
update with missing dependencies

Change-Id: I58bd3d8b60fac10eeb2a7d5cd4fc6f827da1d7b4
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-27 15:17:17 +00:00
Prasanna Kumar Kalever
e9907120fa dist: do not package the rpcgen generated files
This patch fixes rpcgen file stat issue.

rpcgen, before generating a file, it first stats the file, in case if file
already exists, it do not try to override, instead bails out.

[...]
Making all in rpcl
make[3]: Entering directory
`/builddir/build/BUILD/gluster-block-0.2.1/rpc/rpcl'
rpcgen -h -o ../../rpc/rpcl/block.h block.x
file `../../rpc/rpcl/block.h' already exists and may be overwritten
make[3]: Leaving directory
`/builddir/build/BUILD/gluster-block-0.2.1/rpc/rpcl'
make[3]: *** [block.h] Error 1
[...]

So the fix will be not to package the rpcgen generated file in the
source tarball.

Change-Id: I1d136a25c49aeea2d84e96bf065fe46bf0214a13
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-24 01:18:57 +05:30
Michael Adam
a2dff3381a Don't let LOG segfault if log dir does not exist - fall back to stderr.
Change-Id: I65ad54381362280d9a5596e48aa3242f1160fd2d
Signed-off-by: Michael Adam <obnox@redhat.com>
2017-06-22 18:51:59 +02:00
Vijay Bellur
fd2732b979 runner: check for all non-zero exit status values
Change-Id: I4fc56e3fdcbccfde3a70a98f2697744444797e06
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
2017-06-22 16:09:10 +00:00
Prasanna Kumar Kalever
b5cdd05c8b cli: fix missing newline characters
Change-Id: I06f20a355453d81955d4308ecad68358fa1f99cc
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-22 13:03:26 +00:00
Prasanna Kumar Kalever
a9d9be9774 README: update initiator dependency list
added 'device-mapper-multipath' package in the initiator install dependency list,
which provides 'mpathconf'

Change-Id: I8ff5ed1e10cb3cac93511afa2eec51c9401bd32f
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-22 11:10:20 +00:00
Prasanna Kumar Kalever
94c79620db block: add support to prealloc = full | no option
currently we allocate sparse files for block backends in the gluster
volume, with 'prealloc = full' option introduced by this patch we should
be able to fully preallocate the backend block file.

Change-Id: Ibf32df5f978f732a3fd248693170463da6d08268
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-22 16:30:46 +05:30
Prasanna Kumar Kalever
8bb5dd787e logger: fix (null) prints while trying to log volname
Change-Id: I266e081dc318c1ccf29751059992beeadb9d8665
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-14 19:08:22 +05:30
Prasanna Kumar Kalever
5822e70b8c runner: check for WIFEXITED before WEXITSTATUS
check if the child terminated normally before checking for exit status
of the child.

Change-Id: I00357f636f4ee55c10052b4e6071cb08493d32e2
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-14 10:25:17 +00:00
Pranith Kumar K
ea8b04706d Terminate gracefully when svc_register fails
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>
2017-06-14 10:32:21 +05:30
Prasanna Kumar Kalever
f632a4b124 info: show size in human readable format
Also s/BLOCK CONFIG NODE(S)/EXPORTED NODE(S)/ in the info output

$ gluster-block info sample/block
NAME: block
VOLUME: sample
GBID: 6bd70984-be2c-43ac-9e9d-bad04010e42f
SIZE: 1.0 GiB
HA: 1
PASSWORD:
EXPORTED NODE(S): 192.168.0.105

Change-Id: I473b854b939c96b99be8e0b172ac6957b8bc6006
Fixes: #23
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2017-06-13 06:28:42 +00:00
Prasanna Kumar Kalever
e87f76a172 NEWS: update
Change-Id: Ic6fcb5cc6585fb66099d56175aa80da9275356ae
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
v0.2.1
2017-06-07 21:29:19 +05:30
Prasanna Kumar Kalever
a1815c023e sysconfig: add log-level option details
set default log-level environment variable in daemon systemd unit, also
added required comment lines in the sysconfig file.

Change-Id: I9f61842ba95ae278367692eba8e62cc54c1b5cd3
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-07 18:27:54 +05:30
Prasanna Kumar Kalever
8cb4991d74 systemd: add gluster-blockd.sysconfig template
one can edit various input options to gluster-blockd daemon via
/etc/sysconfig/gluster-blockd

Change-Id: I720130d6b6599a79d193c5cbfff18921ffb07156
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-07 18:27:36 +05:30
Prasanna Kumar Kalever
75d6827b8b daemon: narrow down the failure reason due to dependency service
With this change, we can further narrow down the reason for command
failure on remote node.

We get to know if:
* targetcli is installed
* tcmu-runner is running
* user:glfs is listed

Change-Id: Ib39ec525f951ca510008327b59ab99d8f7645ced
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-06 17:26:02 +00:00
Prasanna Kumar Kalever
40d1fffb98 docs: add manual for gluster-blockd
Change-Id: Ic8a7d584274f48dcef5ea2356cf317352a3d48ef
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-06 17:20:05 +00:00
Prasanna Kumar Kalever
6fbe6ea223 docs: update ReadMe with gluster-blockd options
Change-Id: I7c78ab124705d77c8dc5edbf7ca7829dbf0f07b2
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-06-06 18:23:02 +05:30
Pranith Kumar K
4c68b2f814 Fix heap-buffer-overflow
This is the asan trace:
==26769==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000007b60 at pc 0x7ffff6e9429b bp 0x7ffff1afd800 sp 0x7ffff1afcfa8
WRITE of size 2 at 0x602000007b60 thread T1
    #0 0x7ffff6e9429a  (/lib64/libasan.so.3+0x5f29a)
    #1 0x406b64 in removeDuplicateSubstr /root/gluster-block/rpc/block_svc_routines.c:147
    #2 0x41ad4c in blockCreateCliFormatResponse /root/gluster-block/rpc/block_svc_routines.c:1570
    #3 0x41ff91 in block_create_cli_1_svc /root/gluster-block/rpc/block_svc_routines.c:1826
    #4 0x405e63 in gluster_block_cli_1 /root/gluster-block/rpc/rpcl/block_svc.c:132
    #5 0x7ffff57d62a0 in svc_getreq_common (/lib64/libc.so.6+0x13a2a0)
    #6 0x7ffff57d63e6 in svc_getreq_poll (/lib64/libc.so.6+0x13a3e6)
    #7 0x7ffff57d9d00 in svc_run (/lib64/libc.so.6+0x13dd00)
    #8 0x403c61 in glusterBlockCliThreadProc /root/gluster-block/daemon/gluster-blockd.c:130
    #9 0x7ffff6c1e6c9 in start_thread (/lib64/libpthread.so.0+0x76c9)
    #10 0x7ffff57a3f6e in clone (/lib64/libc.so.6+0x107f6e)

0x602000007b60 is located 0 bytes to the right of 16-byte region [0x602000007b50,0x602000007b60)
allocated by thread T1 here:
    #0 0x7ffff6efc020 in calloc (/lib64/libasan.so.3+0xc7020)
    #1 0x42d2c3 in gbAllocN /root/gluster-block/utils/utils.c:194
    #2 0x406ae9 in removeDuplicateSubstr /root/gluster-block/rpc/block_svc_routines.c:138
    #3 0x41ad4c in blockCreateCliFormatResponse /root/gluster-block/rpc/block_svc_routines.c:1570
    #4 0x41ff91 in block_create_cli_1_svc /root/gluster-block/rpc/block_svc_routines.c:1826
    #5 0x405e63 in gluster_block_cli_1 /root/gluster-block/rpc/rpcl/block_svc.c:132
    #6 0x7ffff57d62a0 in svc_getreq_common (/lib64/libc.so.6+0x13a2a0)
    #7 0x7ffff5a60a5f  (/lib64/libc.so.6+0x3c4a5f)

Thread T1 created by T0 here:
    #0 0x7ffff6e66488 in __interceptor_pthread_create (/lib64/libasan.so.3+0x31488)
    #1 0x40545f in main /root/gluster-block/daemon/gluster-blockd.c:325
    #2 0x7ffff56bc400 in __libc_start_main (/lib64/libc.so.6+0x20400)

Change-Id: Id16fa0c00223f7272c3c977efb268ba5d72bd04b
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2017-06-06 17:46:22 +05:30
Pranith Kumar K
e9a7f90b29 Prevent crashes when errMsg is not set
When reply->out is NULL, gluster-blockd is crashing in serializing the response.
Unfortunately the function where we can handle this error is auto-generated, so
I added catch-all errors with a generic-message if errMsg is not set.

Also improved errMsg in somecases where it is not setting by collecting the
error messages from all the config-nodes.

Change-Id: I706d8af9e8e6140d21c0d1268ae57dd5f364aa54
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2017-06-06 17:46:22 +05:30