1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-06 09:48:44 +01:00
Commit Graph

418 Commits

Author SHA1 Message Date
mohit84
2936241ea9 Revert "libglusterfs: drop core infrastructure of memory pools (#2675)" (#2777)
In case of glibc_pool it is good to use glusterfs mempool so revert
the commit 9cd6735ff5.

Change-Id: I780f0a1b7dae815becfd8c072735b6fdecb936f8
Updates: #1000
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2021-09-10 07:26:04 +05:30
Dmitry Antipov
9cd6735ff5 libglusterfs: drop core infrastructure of memory pools (#2675)
Separate memory allocation type tracking from core infrastructure of
memory pools and drop the latter alongside with '--disable-mempool'
configuration option, provide '--disable-allocation-tracking' to control
the former instead.

Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Updates: #1000
2021-09-04 12:02:48 +05:30
Xavi Hernandez
dc9bab7959 afr: fix directory entry count (#2233)
AFR may hide some existing entries from a directory when reading it
because they are generated internally for private management. However
the returned number of entries from readdir() function is not updated
accordingly. So it may return a number higher than the real entries
present in the gf_dirent list.

This may cause unexpected behavior of clients, including gfapi which
incorrectly assumes that there was an entry when the list was actually
empty.

This patch also makes the check in gfapi more robust to avoid similar
issues that could appear in the future.

Fixes: #2232
Change-Id: I81ba3699248a53ebb0ee4e6e6231a4301436f763
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2021-03-09 04:54:07 +05:30
Aravinda Vishwanathapura
72a9fc8ca1 api: Fix a function name in the API doc
Wrong function name was mentioned in API doc
for `glfs_get_volfile`.

Change-Id: Id2251837f53270f1f03b8a5501ea335b7995873b
Updates: #1000
Signed-off-by: Aravinda Vishwanathapura <aravinda@kadalu.io>
2021-03-01 11:51:18 +01:00
Rinku Kothiya
6fcff3901d gfapi: avoid crash while logging message. (#2139)
Breaking parameter into two different parameter
to avoid a crash.

fixes: #2138

Change-Id: Idd5f3631488c1d892748f83e6847fb6fd2d0802a
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
2021-02-09 06:44:49 +05:30
Ravishankar N
b9a4120b2b all: change 'primary' to 'root' where it makes sense
As a part of offensive language removal, we changed 'master' to 'primary' in
some parts of the code that are *not* related to geo-replication via
commits e4c9a14429 and
0fd9246533.

But it is better to use 'root' in some places to distinguish it from the
geo-rep changes which use 'primary/secondary' instead of 'master/slave'.

This patch mainly changes glusterfs_ctx_t->primary to
glusterfs_ctx_t->root. Other places like meta xlator is also changed.
gf-changelog.c is not changed since it is related to geo-rep.

Updates: #1000
Change-Id: I3cd610f7bea06c7a28ae2c0104f34291023d1daf
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2020-12-02 13:24:13 +01:00
Ravishankar N
9d6c316f35 api: conscious language changes (#1737)
-Removed the occurences of 'master' in api.
-Some changes threw up clang-format errors, so fixed them as well.
-Renamed api/src/{glfs-master.c => glfs-primary.c}

Fixes: #1733
Change-Id: I57aea9d93e219305e87985bc2f81ac47cdebb72f
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2020-11-04 09:39:12 +05:30
Rinku Kothiya
7ccb1f1878 gfapi: give appropriate error when size exceeds
This patch help generate appropriate error message
when the gfapi tries to write data equal to or
greater than 1 Gb due to the limitation at the
socket layer.

fixes: #1518

Change-Id: I1234a0b5a6e675a0b20c6b1afe0f4390fd721f6f
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
2020-11-03 09:48:06 +01:00
Ravishankar N
e4c9a14429 xlators: misc conscious language changes (#1715)
core:change xlator_t->ctx->master to xlator_t->ctx->primary
afr: just changed comments.
meta: change .meta/master to .meta/primary. Might break scripts.
changelog: variable/function name changes only.

These are unrelated to geo-rep.
Fixes: #1713

Change-Id: I58eb5fcd75d65fc8269633acc41313503dccf5ff
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2020-11-02 18:03:01 +05:30
mohit84
ecdc77ceb9 core: configure optimum inode table hash_size for shd (#1576)
In brick_mux environment a shd process consume high memory.
After print the statedump i have found it allocates 1M per afr xlator
for all bricks.In case of configure 4k volumes it consumes almost total
6G RSS size in which 4G consumes by inode_tables

[cluster/replicate.test1-replicate-0 - usage-type gf_common_mt_list_head memusage]
size=1273488
num_allocs=2
max_size=1273488
max_num_allocs=2
total_allocs=2

inode_new_table function allocates memory(1M) for a list of inode and dentry hash.
For shd lru_limit size is 1 so we don't need to create a big hash table so to reduce
RSS size for shd process pass optimum bucket count at the time of creating inode_table.

Change-Id: I039716d42321a232fdee1ee8fd50295e638715bb
Fixes: #1538
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
2020-10-11 10:56:57 +05:30
Môshe van der Sterre
8f0dc56556 gfapi: Move the SECURE_ACCESS_FILE check out of glfs_mgmt_init
glfs_mgmt_init is only called for glfs_set_volfile_server, but
secure_mgmt is also required to use glfs_set_volfile with SSL.

fixes: #829
Change-Id: Ibc769fe634d805e085232f85ce6e1c48bf4acc66
2020-09-28 06:12:32 +02:00
Xavi Hernandez
0b512035e3 gfapi: Check the fd argument before accessing it
Some public GFAPI functions did access the fd object without verifying
that it wasn't NULL, causing crashes in some cases.

This patch returns an error code in case it's NULL.

Updates: #1009
Change-Id: I8cadde87ae8d542e0af9b55aa866fe763f97d4fb
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2020-09-23 12:50:07 +02:00
Kaleb S. KEITHLEY
aed59161bd api: libgfapi symbol versions break LTO in Fedora rawhide/f33
The way symbol versions are implemented is incompatible with gcc-10 and LTO.

Fedora provenpackager Jeff Law (law [at] redhat.com) writes in the
Fedora dist-git glusterfs.spec:
  This package uses top level ASM constructs which are incompatible with LTO.
  Top level ASMs are often used to implement symbol versioning. gcc-10
  introduces a new mechanism for symbol versioning which works with LTO.
  Converting packages to use that mechanism instead of toplevel ASMs is
  recommended.

In particular, note that the version of gluster in Fedora rawhide/f33 is
glusterfs-8.0RC0. Once this fix is merged it will be necessary to backport
it to the release-8 branch.

At the time that gfapi symbol versions were first implemented we copied
the GNU libc (glibc) symbol version implementation following Uli Drepper's
symbol versioning HOWTO.

Now gcc-10 has a symver attribute that can be used instead. (Maybe it
has been there all along?)

Both the original implemenation and this implemenation yield the same
symbol versions. This can be seen by running
  `nm -D --with-symbol-versions libgfapi.so`
on the libgfapi.so built before and after applying this fix.

Change-Id: I05fda580afacfff1bfc07be810dd1afc08a92fb8
Fixes: #1352
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2020-07-02 15:52:15 -04:00
Pranith Kumar K
bd540db1e7 cluster/afr: Delay post-op for fsync
Problem:
AFR doesn't delay post-op for fsync fop. For fsync heavy workloads
this leads to un-necessary fxattrop/finodelk for every fsync leading
to bad performance.

Fix:
Have delayed post-op for fsync. Add special flag in xdata to indicate
that afr shouldn't delay post-op in cases where either the
process will terminate or graph-switch would happen. Otherwise it leads
to un-necessary heals when the graph-switch/process-termination
happens before delayed-post-op completes.

Fixes: #1253
Change-Id: I531940d13269a111c49e0510d49514dc169f4577
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
2020-05-29 14:24:53 +05:30
Xavi Hernandez
6f79c28cf0 syncop: improve scaling and implement more tools
The current scaling of the syncop thread pool is not working properly
and can leave some tasks in the run queue more time than necessary
when the maximum number of threads is not reached.

This patch provides a better scaling condition to react faster to
pending work.

Condition variables and sleep in the context of a synctask have also
been implemented. Their purpose is to replace regular condition
variables and sleeps that block synctask threads and prevent other
tasks to be executed.

The new features have been applied to several places in glusterd.

Change-Id: Ic50b7c73c104f9e41f08101a357d30b95efccfbf
Fixes: #1116
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2020-04-30 11:19:01 +02:00
Soumya Koduri
4bff77920d gfapi: Suspend synctasks instead of blocking them
There are certain conditions which blocks the current
execution thread (like waiting on mutex lock or condition
variable or I/O response). In such cases, if it is a
synctask thread, we should suspend the task instead
of blocking it (like done in SYNCOP using synctask_yield)

This is to avoid deadlock like the one mentioned below -

1) synctaskA sets fs->migration_in_progress to 1 and
   does I/O (LOOKUP)
2) Other synctask threads wait for fs->migration_in_progress
  to be reset to 0 by synctaskA and hence blocked
3) but synctaskA cannot resume as all synctask threads are blocked
   on (2).

Note: this same approach is already used by few other components
like syncbarrier etc.

Change-Id: If90f870d663bb242c702a5b86ac52eeda67c6f0d
Fixes: #1146
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2020-04-06 12:36:44 +05:30
Sunny Kumar
4a29d61734 libgfapi: fix resource leak
This patch fixes resource leak in glfs-fops.c.
CID : 1403873 : Resource leak

updates: bz#789278

Change-Id: I589d4d65d2b074801f7b4b0afd7dc4607d79420e
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2020-01-31 15:27:46 +00:00
Yaniv Kaul
89c88e45bb multiple xlators: reduce key length
In many cases, we were freely allocating long keys with no need.
Smaller char arrays are just fine almost anywhere, so just went ahead
and looked where they we can use smaller ones.

In some cases, annotated the functions as static and the prefixes
passed as const as it was easier to read and understand.

Where relevant, converted the dict functions to use known key length.

Change-Id: I882ab33ea20d90b63278336cd1370c09ffdab7f2
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2019-12-09 21:28:00 +02:00
yatipadia
29634da262 api-glfs-fops: structure logging
Convert gf_msg() to gf_smsg()

Change-Id: Iceb40d60a75106c7b4b0a2487b611f7376bccc46
Updates: #657
Signed-off-by: yatipadia <ypadia@redhat.com>
2019-11-25 19:57:09 +05:30
Niklas Hambüchen
aeb0081996 api: Fix documentation path in README
Ref: #84
Updates: bz#1193929
Change-Id: If346dbe421d3e301ae035165b2e01ee0a7176d36
Signed-off-by: Amar Tumballi <amarts@gmail.com>
2019-11-13 12:19:54 +05:30
Yaniv Kaul
d3a0a5c28c rpc: align structs
squash tens of warnings on padding of structs in afr structures.
The warnings were found by manually added '-Wpadded' to the GCC
command line.

Also made relevant structs and definitions static, where it
was applicable.

Change-Id: Ib71a7e9c6179378f072d796d11172d086c343e53
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2019-09-13 21:27:44 +03:00
Purna Pavan Chandra Aekkaladevi
5c40a1a648 libgfapi : Dereference after null check - coverity fix
This patch fixes coverity issue with CID 1405581

A pointer 'volname' is being deferenced (by passing it as an argument to strncmp), even when it points to NULL, leading to segmentation fault.

fix : Adding a NULL check condition beforehand and returning NULL

Change-Id: I18685fa1cb251253996051b83b6790a5d5f0aff9
Updates: bz#789278
Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkala@redhat.com>
2019-09-16 11:05:23 +05:30
Soumya Koduri
4531bd6733 gfapi: Update the version of 'glfs_h_creat_open'
Change-Id: I43eaa53a7b8d876640d225e011b56192bba57eed
Fixes: bz#1753569
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2019-09-18 16:32:08 +05:30
Soumya Koduri
64ac883534 gfapi: 'glfs_h_creat_open' - new API to create handle and open fd
Right now we have two separate APIs, one
- 'glfs_h_creat_handle' to create handle & another
- 'glfs_h_open' to create a glfd to return to application

Having two separate routines can result in access errors
while trying to create and write into a read-only file.

Since a fd is opened even during file/directory creation,
introducing a new API to make these two operations atomic i.e,
which can create both handle & fd and pass them to application

Change-Id: Ibf513fcfcdad175f4d7eb6fa7a61b8feec6d33b5
Fixes: bz#1753569
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2019-09-18 16:32:08 +05:30
Sheetal Pamecha
4993c88679 libgfapi: return correct errno on invalid volume name
glfs_init when called with volume name prefixed by '/'
sets errno to 0. Setting errno to EINVAL to resolve the issue.
Also volname is a parameter to glfs_new.
Thus, validating volname in glfs_new itself and
returning EINVAL from that function

fixes: bz#1507896

Change-Id: I0d4d2423e26cc07644d50ec8cce788ecc639203d
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
2019-08-19 15:27:57 +05:30
Barak Sason
0a7731f65c api: fixing a coverity issue
Added a null pointer check to avoid seg-fault

CID:1403874
Updates: bz#789278

Change-Id: Ia8ff992c9f06d79647089f296afe77519fb5af2a
Signed-off-by: Barak Sason <bsasonro@redhat.com>
2019-08-18 15:36:40 +03:00
Amar Tumballi
d48138460c gfapi: provide version for statedump path
Updates: bz#1689097
Change-Id: I2e3c2a3aef17fda67d04fa9e604ea3f8335a2b0b
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2019-07-25 13:43:37 +05:30
Soumya Koduri
f3edd8743f gfapi: Fix deadlock while processing upcall
As mentioned in bug1733166, there could be potential deadlock
while processing upcalls depending on how each xlator choose
to act on it. The right way of fixing such issues
is to change rpc callback communication process.
- https://github.com/gluster/glusterfs/issues/697

Till then, making changes in gfapi layer to avoid any I/O
processing.

Change-Id: I2079e95339e5d761d5060707f4555cfacab95c83
fixes: bz#1733166
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2019-07-25 12:56:12 +05:30
Amar Tumballi
709a344688 gfapi: increase function-coverage
* Add few more mgmt functions to the coverage
* While testing mgmt function, found an issue, where if the
  'glfs_set_volfile_server()' is not called before calling
  'glfs_unset_volfile_server()', unset would cause a crash.
  Null check of few variables fixes the issue, which is handled
  in this patch itself.
* Added a test for volfile API

Updates: bz#1693692
Change-Id: Iba151f8da1b64107e2f436ddbfef9da45b1c1588
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2019-07-25 11:00:29 +05:30
Xiubo Li
2b3786e446 event: rename event_XXX with gf_ prefixed
I hit one crash issue when using the libgfapi.

In the libgfapi it will call glfs_poller() --> event_dispatch()
in file api/src/glfs.c:721, and the event_dispatch() is defined
by libgluster locally, the problem is the name of event_dispatch()
is the extremly the same with the one from libevent package form
the OS.

For example, if a executable program Foo, which will also use and
link the libevent and the libgfapi at the same time, I can hit the
crash, like:

kernel: glfs_glfspoll[68486]: segfault at 1c0 ip 00007fef006fd2b8 sp
00007feeeaffce30 error 4 in libevent-2.0.so.5.1.9[7fef006ed000+46000]

The link for Foo is:
lib_foo_LADD = -levent $(GFAPI_LIBS)
It will crash.

This is because the glfs_poller() is calling the event_dispatch() from
the libevent, not the libglsuter.

The gfapi link info :
GFAPI_LIBS = -lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid

If I link Foo like:
lib_foo_LADD = $(GFAPI_LIBS) -levent
It will works well without any problem.

And if Foo call one private lib, such as handler_glfs.so, and the
handler_glfs.so will link the GFAPI_LIBS directly, while the Foo won't
and it will dlopen(handler_glfs.so), then the crash will be hit everytime.

The link info will be:
foo_LADD = -levent
libhandler_glfs_LIBADD = $(GFAPI_LIBS)

I can avoid the crash temporarily by linking the GFAPI_LIBS in Foo too like:
foo_LADD = $(GFAPI_LIBS) -levent
libhandler_glfs_LIBADD = $(GFAPI_LIBS)

But this is ugly since the Foo won't use any APIs from the GFAPI_LIBS.

And in some cases when the --as-needed link option is added(on many dists
it is added as default), then the crash is back again, the above workaround
won't work.

Fixes: #699

Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2019-07-26 12:34:52 +08:00
Yaniv Kaul
6e08269e59 cli: defer create_frame() (and dict creation) to later stages.
Where possible, defer create_frame() - whenever possible, after
command line verification, for example.

Change-Id: Id6606e90e7ea6190f30b225c4733b229c519bb2f
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2019-06-05 20:16:40 +03:00
Vijay Bellur
4ef26f1519 Replace usleep() with nanosleep()
As usleep has been obsoleted, changed all invocations of usleep
to nanosleep. From man 3 usleep:

"4.3BSD, POSIX.1-2001.  POSIX.1-2001 declares this function
 obsolete; use nanosleep(2) instead. POSIX.1-2008 removes the
 specification of usleep()."

Added a helper function gf_nanosleep() to have a single place
for handling edge cases that might arise from the conversion of
usleep to nanosleep and allow the sleep to resume with right
remaining value upon being interrupted.

Fixes: bz#1721686

Change-Id: Ia39ab82c9e0f4669d2c00d4cdf25e38d94ef9f62
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
2019-06-20 15:50:01 -07:00
Kinglong Mee
a4f8c34e7c gfapi: set right pargfid according to parent's inode
EC updates parent's inode from loc, when pargfid is not the parent's inode's,
a warnning message is print, and an error is returned to up xlator.

[ec-helpers.c:400:ec_loc_gfid_check] 0-openfs1-disperse-0: Mismatching GFID's in loc

Change-Id: Ie8036be91f039083a1e3fe17ec235a222df84b97
fixes: bz#1723280
Signed-off-by: Kinglong Mee <mijinlong@horiscale.com>
2019-05-13 16:42:01 +08:00
Amar Tumballi
5a1d28c1b5 glfs: add syscall.h after header cleanup
in one of the recent patches, we cleaned-up the unneccesary header
file includes. In the order of merging the patches, there cropped
up an compile error.

updates: bz#1193929
Change-Id: I2ad52aa918f9c698d5273bb293838de6dd50ac31
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2019-06-14 22:38:10 +05:30
Yaniv Kaul
1ccf7b423d multiple files: another attempt to remove includes
There are many include statements that are not needed.
A previous more ambitious attempt failed because of *BSD plafrom
(see https://review.gluster.org/#/c/glusterfs/+/21929/ )

Now trying a more conservative reduction.
It does not solve all circular deps that we have, but it
does reduce some of them. There is just too much to handle
reasonably (dht-common.h includes dht-lock.h which includes
dht-common.h ...), but it does reduce the overall number of lines
of include we need to look at in the future to understand and fix
the mess later one.

Change-Id: I550cd001bdefb8be0fe67632f783c0ef6bee3f9f
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
2019-06-09 13:31:31 +03:00
Amar Tumballi
48bda317b8 gfapi: provide an api for setting statedump path
Currently for an application using glfsapi to use glusterfs, when a
statedump is taken, it uses /var/run/gluster dir to dump info.

There can be concerns as this directory may be owned by some other
user, and hence it may fail taking statedump. Such applications
should have an option to use different path.

This patch provides an API to do so.

Updates: bz#1689097
Change-Id: I8918e002bc823d83614c972b6c738baa04681b23
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2019-03-14 10:04:28 +05:30
Soumya Koduri
8cab5e6288 gfapi: fix incorrect initialization of upcall syncop arguments
While sending upcall notifications via synctasks, the argument used to
carry relevant data for these tasks is not initialized properly. This patch
is to fix the same.

Change-Id: I9fa8f841e71d3c37d3819fbd430382928c07176c
fixes: bz#1718316
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2019-06-07 17:20:15 +05:30
Amar Tumballi
c1a1d125e9 across: clang-scan: fix NULL dereferencing warnings
All these checks are done after analyzing clang-scan report produced
by the CI job @ https://build.gluster.org/job/clang-scan

updates: bz#1622665
Change-Id: I590305af4ceb779be952974b2a36066ffc4865ca
Signed-off-by: Amar Tumballi <amarts@redhat.com>
2019-05-20 11:11:39 +05:30
Sheetal Pamecha
27245a89e5 api/glfsxmp.c: minor fixes
* add more fops: f{get,set,list,remove}xattr(), access(), fstat(), fsetattr(),
getxattr(), lgetxattr(), llistxattr(), lsetxattr(), fgetxattr()
* handle some error cases (like volume not found)

Updates: #655
Change-Id: I3334bdf3090eafd83a54e1be12036ea01b181089
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
2019-04-15 14:59:37 +05:30
Xavi Hernandez
dae78d39bf core: avoid dynamic TLS allocation when possible
Some interdependencies between logging and memory management functions
make it impossible to use the logging framework before initializing
memory subsystem because they both depend on Thread Local Storage
allocated through pthread_key_create() during initialization.

This causes a crash when we try to log something very early in the
initialization phase.

To prevent this, several dynamically allocated TLS structures have
been replaced by static TLS reserved at compile time using '__thread'
keyword. This also reduces the number of error sources, making
initialization simpler.

Updates: bz#1193929
Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
2019-03-05 18:58:20 +01:00
Soumya Koduri
dbba52d858 gfapi: Unblock epoll thread for upcall processing
With commit#ad35193,we have made changes to offload
processing upcall notifications to synctask so as not
to block epoll threads. However seems like the issue wasnt
fully addressed.

In "glfs_cbk_upcall_data" -> "synctask_new1" after creating synctask
if there is no callback defined, the thread waits on synctask_join
till the syncfn is finished. So that way even with those changes,
epoll threads are blocked till the upcalls are processed.

Hence the right fix now is to define a callback function for that
synctask "glfs_cbk_upcall_syncop" so as to unblock epoll/notify threads
completely and the upcall processing can happen in parallel by synctask
threads.

Change-Id: I4d8645e3588fab2c3ca534e0112773aaab68a5dd
fixes: bz#1693575
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2019-03-28 14:59:00 +05:30
Ravishankar N
e8c7592fed gfapi: add function to set client-pid
This api offers the ability to set the pid of a client to a particular
value, identical to how gluster fuse clients provide the --client-pid
option. This is an internal API to be used by gluster processes only. See
https://lists.gluster.org/pipermail/gluster-devel/2019-March/055925.html
for more details. Currently glfsheal is the only proposed consumer.

updates: bz#1689250
Change-Id: I0620be2127d79d69cdd57cffb29bba44e6e5da1f
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2019-03-14 18:41:11 +05:30
Mohammed Rafi KC
c1b3de38ef rpc/transport: Missing a ref on dict while creating transport object
while creating rpc_tranpsort object, we store a dictionary without
taking a ref on dict but it does an unref during the cleaning of the
transport object.

So the rpc layer expect the caller to take a ref on the dictionary
before passing dict to rpc layer. This leads to a lot of confusion
across the code base and leads to ref leaks.

Semantically, this is not correct. It is the rpc layer responsibility
to take a ref when storing it, and free during the cleanup.

I'm listing down the total issues or leaks across the code base because
of this confusion. These issues are currently present in the upstream
master.

1) changelog_rpc_client_init

2) quota_enforcer_init

3) rpcsvc_create_listeners : when there are two transport, like tcp,rdma.

4) quotad_aggregator_init

5) glusterd: init

6) nfs3_init_state

7) server: init

8) client:init

This patch does the cleanup according to the semantics.

Change-Id: I46373af9630373eb375ee6de0e6f2bbe2a677425
updates: bz#1659708
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2019-02-26 18:04:18 +05:30
Arjun Sharma
cf48224a3a Updating the glfs_setattr and glfs_fsetattr public APIs to use glfs_stat
Change-Id: I0e86c8222c88b4c71087ec287ba81f8353d70822
updates: #389
Signed-off-by: Arjun <arjsharm@redhat.com>
2019-02-21 18:09:50 +05:30
ShyamsundarR
10016c55fe api: Update all future API versions to rel-6
As release 6 is branched, all future APIs now become 6.0

This change implements the same.

Change-Id: I6db368b4dc8585278ec11d4a411adcd04635de53
Updates: bz#1193929
Signed-off-by: ShyamsundarR <srangana@redhat.com>
2019-02-05 20:44:28 -05:00
Kaleb S. KEITHLEY
739e846ebc api: bad GFAPI_4.1.6 block
missing global: line, tabs not spaces

Change-Id: Icdbc23b4e4cd608da1d764e81757201c4b1269a6
updates: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2019-01-29 03:16:16 -05:00
Milind Changire
51f4a48384 rpc: use address-family option from vol file
This patch helps enable IPv6 connections in the cluster.
The default address-family is IPv4 without using this option explicitly.

When address-family is set to "inet6" in the /etc/glusterfs/glusterd.vol
file, the mount command-line also needs to have
-o xlator-option="transport.address-family=inet6" added to it.

This option also gets added to the brick command-line.
Snapshot and gfapi use-cases should also use this option to pass in the
inet6 address-family.

Change-Id: I97db91021af27bacb6d7578e33ea4817f66d7270
fixes: bz#1635863
Signed-off-by: Milind Changire <mchangir@redhat.com>
2019-01-22 12:10:59 +05:30
Arjun
866f554ec6 gfapi : making glfs_setattr/glfs_fsetattr as public
Initially glfs_fsetattr and glfs_setattr, both functions accepted iatt as arguements
but now they accept stat and later in the function the stat is being converted to iatt
so that it can be passed to syncop_fsetattr/syncop_setattr.

Change-Id: I41a9e0124785a32ca19ef4d492c5ed5002e66ede
updates: #389
Signed-off-by: Arjun Sharma <arjsharm@redhat.com>
2018-12-04 11:02:37 +05:30
Mohit Agrawal
2ea320984c core: Resolve dict_leak at the time of destroying graph
Problem: In gluster code some of the places it call's get_new_dict
         to create a dictionary without taking reference so at the time
         of dict_unref it has become a leak

Solution: To resolve the same call dict_new instead of get_new_dict

updates bz#1650403
Change-Id: I3ccbbf5af07079a4fa09aad2cd0458c8625b2f06
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
2018-11-30 16:07:39 +05:30
ShyamsundarR
46bfc0c53c gfapi: update returned/callback pre/post attributes to glfs_stat
Change-Id: Ie0fe971e694101aa011d66aa496d0644669c2c5a
Updates: #389
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Signed-off-by: ShyamsundarR <srangana@redhat.com>
2018-12-20 15:28:37 -05:00