533 Commits

Author SHA1 Message Date
Pranith Kumar K
11a19ce031 Resolve: Assign correct path while resolving
Change-Id: Ia17ff38a60225dd2e9115aaa298bed42f9e43f56
BUG: 812277
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3248
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-08 13:39:01 -07:00
Kaushal M
44a1857e54 protocol/{client,server} : Log improvements
Make use of gfid in log messages.

Change-Id: I28548be64d19418f99ee9ccdbd3ac4ae67c6c015
BUG: 814666
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3274
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-05-08 04:06:38 -07:00
Raghavendra G
0caffe52b8 protocol/client: hold lock when cancelling ping_timer in
client_ping_cbk.

Change-Id: I2b4e723ef119c62902f8a692a8a1f424da0d08b4
BUG: 816951
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3254
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-05 23:49:02 -07:00
Krishna Srinivas
9bd1b291e3 libglusterfs/inode.c: do not link the inode in the dentry cache for "." and ".."
Change-Id: I18c2e090c1ca64f47ce70dc63c9f73ea7def2f86
BUG: 810828
Signed-off-by: Krishna Srinivas <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/3220
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-05 12:42:31 -07:00
Amar Tumballi
c204e8c271 protocol: fix memory leak of lk-owner buffer in *lk() calls
Change-Id: I7fb0e1757c5e04b1a2609c9822ac79301808f671
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 768330
Reviewed-on: http://review.gluster.com/3244
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-03 13:03:51 -07:00
Amar Tumballi
170a3a411c log cleanup: in setxattr() path
* in posix we log occassionally if errno is ENOTSUP, added a
  suggestion to mount with 'user_xattr' option.

* changed server's *etxattr_cbk to log ENOTSUP in debug level.

* changed client's *etxattr_cbk to log ENOTSUP in debug level.

Change-Id: Icd604050aaa68546011f2c950ecd7883ac6ee820
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 811957
Reviewed-on: http://review.gluster.com/3140
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-05-02 22:59:11 -07:00
Emmanuel Dreyfus
3dd38a4a35 get rid of ZR_PATH_MAX
As suggested by Amar Tumballi

Change-Id: Id1cd74fd7530e8c846f3be4a88b1fa301a728cf1
BUG: 764655
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3243
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-05-01 10:24:26 -07:00
Amar Tumballi
29f2de478c core: coverity issues fixed
this is not a complete set of issues getting fixed. Will
address other issues in another patch.

Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 789278
Reviewed-on: http://review.gluster.com/3145
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-04-23 14:52:57 -07:00
shishir gowda
6b0a44b4df protocol/server: Check if dict arg is NULL in setxattr
Change-Id: I44d199ffa5d08115cc0aa7cb0b99298a9907af60
BUG: 808067
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/3164
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-04-17 01:14:58 -07:00
Mohammed Junaid
754112b7b7 protocol/client,server: Lock self healing off by default.
Also, merged the options client.grace-timeout and server.grace-timeout
into one option "features.grace-timeout".

Change-Id: Icb9f0809f89379de673f8c9f7ca4725bc113797f
BUG: 812760
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/3153
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-16 11:35:49 -07:00
Krishnan Parthasarathi
362c5283ac server: Modified logging information to ease log based analysis
Change-Id: I1bde6505346b5dda37cf88c66f9af8ff48668ed9
BUG: 811864
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3133
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-04-13 00:59:14 -07:00
Kaushal M
28f373d89f xlator/server,xlator/nfs : Fix authentication for address lists
Fixes authentication problems when address lists are given for
auth.{allow,reject} and nfs.rpc-auth-{allow,reject}.

Change-Id: I9959ebfa6820aef52c883372e1085660560e1e73
BUG: 810179
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3104
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-13 00:55:51 -07:00
Amar Tumballi
dde9cfcaf3 protocol/client: in link_cbk() try to print valid information in case of error
currently there is a chance we don't have a source 'loc_t' path information
instead we would have gfid. Need to print destination information too.

Change-Id: I7a5edbdc9abe18fdb330fc7ed49c9946cf7fe382
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 810146
Reviewed-on: http://review.gluster.com/3122
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-11 10:09:58 -07:00
Amar Tumballi
0bfadb56d0 protocol/server: validate connection object before dereferencing
in 'release()' and 'releasedir()' fops the check for 'connection object'
was not done before dereferencing it. the check was in place for all
other fops. handling the missing cases now.

also removed some warnings related to 'set-but-unused'

Change-Id: I47b95318e8f2f28233179be509ce090b2fb7276d
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 801411
Reviewed-on: http://review.gluster.com/3125
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-11 10:07:52 -07:00
Jeff Darcy
7f5c1e5777 Fix compiler warnings and typos from Debian build.
Mostly to do with "-Werror=format-security" being buggy, but while we're
here we might as well fix some typos and such.  Credit goes to Patrick
Matthäi <pmatthaei@debian.org> for pointing these out.

Change-Id: Ia32d1111d7c10b1f213df85d86b17a1326248ffd
BUG: 811387
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.com/3117
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-10 14:37:29 -07:00
Kaleb KEITHLEY
69f7003817 Replace GPLV3 MD5 with OpenSSL MD5
Ric asked me to look at replacing the GPL licensed MD5 code with
something better, i.e. perhaps faster, and with a less restrictive
license, etc. So I took a couple hour holiday from working on
wrapping up the client_t and did this.

OpenSSL (nee SSLeay) is released under the OpenSSL license, a BSD/MIT
style license. OpenSSL (libcrypto.so) is used on Linux, OS X and *BSD,
Open Solaris, etc. IOW it's universally available on the platforms we
care about. It's written by Eric Young (eay), now at EMC/RSA, and I
can say from experience that the OpenSSL implementation of MD5 (at least)
is every bit as fast as RSA's proprietary implementation (primarily
because the implementations are very, very similar.) The last time I
surveyed MD5 implementations I found they're all pretty much the same
speed.

I changed the APIs (and ABIs) for the strong and weak checksums.
Strictly speaking I didn't need to do that. They're only called on
short strings of data, i.e. pathnames, so using int32_t and uint32_t
is ostensibly okay. My change is arguably a better, more general API
for this sort of thing. It's also what bit me when gerrit/jenkins
validation failed due to glusterfs segv-ing. (I didn't pay close enough
attention to the implementation of the weak checksum. But it forced me
to learn what gerrit/jenkins are doing and going forward I can do better
testing before submitting to gerrit.)

Now resubmitting with a BZ

Change-Id: I545fade1604e74fc68399894550229bd57a5e0df
BUG: 807718
Signed-off-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.com/3019
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-04-04 16:13:21 -07:00
Amar Tumballi
db501c7370 core: fix all the iobuf related refs and unrefs
reviewed the code against all the possible places where
iobuf/iobref ref unref are present, and hopefully fixed most of
the issues around memory leaks with respect to iobuf

Change-Id: I9aa30326962991f8e23acedd389a0e962e097885
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 797875
Reviewed-on: http://review.gluster.com/2994
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-29 07:54:34 -07:00
Kaushal M
3360fca3f3 cli, glusterd: "volume set help" additions
"auth.allow/reject" and "server.statedump" options are included in "volume set
help" now.

Change-Id: I7f9ba89d1782c26792347ffd2cd4042c3c396934
BUG: 783390
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3025
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-28 11:45:22 -07:00
Mohammed Junaid
b8c4da2ce0 protocol/client: Set grace_timer_needed flag to false on a disconnect.
A grace timer is registered on a disconnect, but a reconnect timer sends a
connect request after every 3sec and if the server is down, the client protocol
receives disconnect and a grace timer will be registered which on timeout will
increase the lk-version value. Its enough to register the grace timer once after
the first disconnect and later just ignore other psuedo disconnects until the
next successful reconnect.

Change-Id: I7f34a98a79fdc25370ef15a6712bfa316a9b7c7c
BUG: 807271
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/3020
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-28 02:59:34 -07:00
Amar Tumballi
9d3af972f5 core: adding extra data for fops
with this change, the xlator APIs will have a dictionary as extra
argument, which is passed between all the layers. This can be
utilized for overloading in some of the operations.

Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2960
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-22 16:40:27 -07:00
Raghavendra G
c40b9975d0 protocol/client: memory leak fixes.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Change-Id: I804c934d79ed13ded9d1b741cef6597bc238e476
BUG: 803675
Reviewed-on: http://review.gluster.com/2987
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2012-03-20 22:37:18 -07:00
Raghavendra Bhat
e8f9aabb78 protocol/server: remove the transport from the list irrespective of lock-heal is on/off
Upon getting disconnect, remove the transport from the list of transports that
protocol server maintains irrespective of whether lock-heal is on or off, since
upon reconnect a new transport would be created.

Change-Id: I18a269a93487d6e2cb11c345b6dde813d089809c
BUG: 803815
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2980
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-03-20 07:49:01 -07:00
Mohammed Junaid
2ffefd720a protocol/client: Handle failures in lock self healing gracefully (part2).
During reopening of fd's and reacquiring of locks on the fd (after a
reconnect), a release on a fd on which reacquiring of locks is in progress
will free up fdctx. This patch will keep fdctx valid until the reacquiring
of locks is in progress.

Change-Id: I0fae27544a7f8ddaa26def4ee4d41a8a2b322521
BUG: 795386
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2819
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-19 09:16:23 -07:00
Amar Tumballi
d98c3e1934 rpc-clnt: separate out connection_cleanup() from destroy()
noticed that there are possibilities where one would like to do a
connection_cleanup() before destroying a RPC connection itself, also
current code is such that, rpc_clnt_connection_cleanup() does
rpc_clnt_ref() and unref(), creating a race window/double unref
possibilities in the code.

by separating out the functions, this race window/double fault can be
prevented.

Change-Id: I7ebd3392efa891232857b6db9108b0b19e40fc12
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 802403
Reviewed-on: http://review.gluster.com/2979
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-19 09:14:40 -07:00
Mohammed Junaid
55c22fbfae protocol/client: Handle failures in lock self healing gracefully (part 1).
During reopening of fd's and reacquiring of locks on the fd (after a
reconnect), a release on a fd on which reacquiring of locks is in progress
will free up fdctx. This patch will keep fdctx valid until the reacquiring
of locks is in progress.

Change-Id: I0464c751a5aa986abac0b72b48b261fceeba24e8
BUG: 795386
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2937
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-19 09:05:58 -07:00
Mohammed Junaid
83277598bd protocol/server: Handle server send reply failure gracefully.
Server send reply failure should not call server connection cleanup because
if a reconnection happens with in the grace-timeout the connection object is
reused. We must cleanup only on grace-timeout.

Change-Id: I7d171a863382646ff392031c2b845fe4f0d3d5dc
BUG: 803365
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2947
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-19 08:11:43 -07:00
Vijay Bellur
f076c23f38 protocol/client: Avoid STACK_DESTROYing more than once in RELEASE fops.
Change-Id: I435327c6133aa6739731dabddde860b0b43c1497
BUG: 804607
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Reviewed-on: http://review.gluster.com/2978
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2012-03-19 05:58:30 -07:00
Rahul C S
b315c42344 print bound_xl only once in server statedump
since, currently there is only one bound_xl for
all connection objects, it does not make sense
to print the bound_xl for every conn object.

Change-Id: Iaf4a170fe63fb7e80133c449a20f298f0e86364c
BUG: 765495
Signed-off-by: Rahul C S <rahulcs@redhat.com>
Reviewed-on: http://review.gluster.com/2975
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-19 05:51:28 -07:00
Pranith Kumar K
1477fe376a Logs: Improved logs in lock/unlock execution path
Statedump will now start showing the lk-owner of the stack.

Change-Id: I9f650ce9a8b528cd626c8bb595c1bd1050462c86
BUG: 803209
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2968
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 01:53:41 -07:00
Raghavendra G
dfc481bf2d protocol/client: replace STACK_UNWIND_STRICT macro with CLIENT_STACK_UNWIND,
which does appropraite cleanup before unwinding.

Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Change-Id: Ic49d6e21c5fc56e747afec35be2bebbbbd2a6583
BUG: 767359
Reviewed-on: http://review.gluster.com/2897
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 01:52:37 -07:00
Raghavendra G
4d4a1e0801 rpc: don't unwind the fop in caller if client_submit_request fails
client_submit_request guarantees that the cbkfn - which we pass to
it as argument - is called whenever there is a failure.

Change-Id: I0e8ce5a6b320246dc13ce4318b04739d38d183a3
BUG: 767359
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2896
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 01:52:04 -07:00
Pranith Kumar K
9fd44bd90e protocol/server: Clear internal locks on disconnect
If there is a disconnect observed on the client when the
inode/entry unlock is issued, but the reconnection to server
happens with in the grace-time period the inode/entry lk will
live and the unlock will never come from that client.
The internal locks should be cleared on disconnect.

Change-Id: Ib45b1035cfe3b1de381ef3b331c930011e7403be
BUG: 803209
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2966
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2012-03-18 01:09:43 -07:00
Raghavendra Bhat
6bf0a809c9 protocol/server: send forget on the renamed inode
If rename is given on a file "a" to "b" ("b" is already existing file),
then after rename, the inode for "b" would still be in the inode table
and would not get forget (for fuse client, the fuse kernel module would
send, but on server forget will not come on that inode), thus leading
to inode leak even when the mount point is empty.

To avoid that before doing inode rename, unlink the previous inode that
"b" is pointing to and send forget on that, if "b" is the last dentry
for that inode.

Change-Id: Ie4dcc39ea190ee8f28029b4d7661df576d9cf319
BUG: 799833
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2874
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 01:00:01 -07:00
Kaushal M
93022c0cc6 mgmt/glusterd : volume set validation fixes
This is the new version of the patch by Kaushik at review.gluster.com/699

The following new option types have been introduced:
 * GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
 * GF_OPTION_TYPE_PRIORITY_LIST
 * GF_OPTION_TYPE_SIZE_LIST
and option types of several options in translators have been updated to use the
new types.

valid_internet_address(), valid_ipv4_address() & valid_ipv6_address() functions
has been updated for * wildcard matching. Previously used standalone wildcard
address checking functions have been removed.

Changes have been done to stripe translator to correctly set, update and use
stripe-blocksize. Also minimum value for block-size has been set to 16KB.

Change-Id: I2aa484ff695f6a915a8fc9a9f965cf0344f41d59
BUG: 765248
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/2899
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 00:52:40 -07:00
Raghavendra G
3823d7ee14 protocol/server: memory leak fixes.
Change-Id: I203832d9d52373f068f90e30dc7672329d65bbea
BUG: 803675
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2954
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-17 23:39:07 -07:00
Raghavendra Bhat
fb406f942b protocol/server: add and remove the transports from the list, inside the lock
Till now for graph changes, glusterfs client used to remember the old graph
also. Hence the transport object on the server corresponding the old graph
never received disconnect. But now since the graph cleanup is happening,
transport on the server side gets disconnect for the cleaned up graph.

Server maintains, all the transports in a list. But addition of the new
transport to the list, or removal of the transport from the list is not
happening within the lock. Thus if a thread is accessing a transport
(in cases of statedump, where each transprt's information is dumped),
and the server gets a disconnect on that transport, then it leads to
segfault of the process.

To avoid it do the list (of transports) manipulation inside the lock.

Change-Id: I50e8389d5ec8f1c52b8d401ef8c8ddd262e82548
BUG: 803815
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2958
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-17 23:27:26 -07:00
Pranith Kumar K
6aab9d9602 protocol/server: Avoid race in add/del locker, connection_cleanup
conn->ltable address keeps changing in
server_connection_cleanup every time it is called.
i.e. New ltable is created every time it is called.
Here is the race that happened:
---------------------------------------------------
thread-1                        | thread-2
add_locker is called with       |
conn->ltable. lets call the     |
ltable address lt1              |
                                | connection cleanup is called
                                | and do_lock_table_cleanup is
                                | triggered for lt1. locker
                                | lists are splice_inited under
                                | the lt1->lock
lt1 adds the locker under       |
lt1->lock (lets call this l1)   |
                                | GF_FREE(lt1) happens in
                                | do_lock_table_cleanup

The locker l1 that is added just before lt1 is freed will never
be cleared in the subsequent server_connection_cleanups as there
does not exist a reference to the locker. The stale lock remains
in the locks xlator even though the transport on which it was
issued is destroyed.

Change-Id: I0a02f16c703d1e7598b083aa1057cda9624eb3fe
BUG: 787601
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2957
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-17 23:22:24 -07:00
Pranith Kumar K
fa5b034719 protocol/server: Remove connection from conf->conns w.o. race
1) Adding the connection to conf->conns used to
happen in conf->mutex, but removing happened under conn->lock.
Fixed that as below.
When the connection object is created conn's ref, bind_ref count
is set to '1'. For bind_ref ref/unref happens under conf->mutex
whenever server_connection_get, put is called.
When bind_ref goes to '0' connection object is removed from
conf->conns under conf->mutex.  After it is removed from the list,
conn_unref is called outside the conf->mutex.
conn_ref/unref still happens under conn->lock.

2) Fixed races in server_connection_cleaup in grace_timer_handler
and server_setvolume.

Change-Id: Ie7b63b10f658af909a11c3327066667f5b7bd114
BUG: 801675
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2911
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-13 04:58:45 -07:00
Amar Tumballi
c8e7ec5e24 protocol/client: remove unused variables from 'priv/conf'
'last_sent', and 'last_recieved' variables were not used anymore
after having RPC layer. Hence removed it from the code.

Change-Id: I1ba74d47f909406ebde43476ccfed724e6c7e77f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 801721
Reviewed-on: http://review.gluster.com/2916
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-12 05:27:33 -07:00
Mohammed Junaid
ef108d4fa7 protocol/client: Register a timer(grace-timer) conditionally.
A grace timer is registered on a disconnect, but a reconnect timer sends a
connect request after every 3sec and if the server is down, the client protocol
receives disconnect and a grace timer will be registered which on timeout will
increase the lk-version value. Its enough to register the grace timer once after
the disconnect and later just ignore other psuedo disconnects.

Change-Id: I36a153aa86b350d87fe50d014ee0297f558a7fb6
BUG: 795386
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2906
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-10 05:27:56 -08:00
Krishnan Parthasarathi
63281d7eeb protocol/client: Added lk_ctx info in fdctx dump
- Added a brief explanation as to why we can't use gf_log
  when in statedump.

- Removed gf_log messages from client_priv_dump since
  it can cause a 'deadlock' - See statedump.c for explanation

- Added try-lock based accessors for fd_lk_list for dump purposes.

Change-Id: I1d755a4ef2c568acf22fb8c4ab0a33a4f5fd07b4
BUG: 789858
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2882
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-07 10:17:41 -08:00
Pranith Kumar K
ebbc6e802b protocol/client: Free readdirp xdr leak
Change-Id: I5e46deedd93e852a483693de42e4bec0082bc08b
BUG: 796186
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2886
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-03-07 09:20:06 -08:00
Rajesh Amaravathi
6756245b15 fops/removexattr: prevent users from removing glusterfs xattrs
* Each xlator prevents the user from removing xlator-specific
  xattrs like trusted.gfid by handling it in respective removexattr
  functions.

* For xlators which did not define remove and fremovexattr,
  the functions have been implemented with appropriate checks.

xlator         |     fops-added
_______________|__________________________
               |
1. stripe      |     removexattr and fremovexattr
2. quota       |     removexattr and fremovexattr

Change-Id: I98e22109717978134378bc75b2eca83fefb2abba
BUG: 783525
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2836
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-03-05 09:17:47 -08:00
Vijay Bellur
71cffc0b66 Fix memory leaks found in readdir
Change-Id: I0e221e4de9ee12586b09cd8bf7f394e9d4b88a11
BUG: 765785
Reviewed-on: http://review.gluster.com/2853
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-01 11:42:56 -08:00
Mohammed Junaid
0d62b3e4cd protocol/client: Calling GF_FREE on memory allocated via GF_CALLOC.
This is a temporary fix. A clean fix would be to allocate memory using mem_get0
and free via mem_put.

Change-Id: I6351ab22c2f05ba8fa4aaad67f375027df873807
BUG: 796656
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2852
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2012-03-01 10:02:42 -08:00
Pranith Kumar K
86f631f428 protocol/server: Make conn object ref-counted
Change-Id: I992a7f8a75edfe7d75afaa1abe0ad45e8f351c8b
BUG: 796581
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2806
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-01 09:12:10 -08:00
Amar Tumballi
15141a7660 protocol/client: send unique key to server during handshake
utilize the graph->id for making the key unique.

Change-Id: I0c1b355aa901af88e65fd12cb9e0535318856867
BUG: 783982
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.com/2831
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
2012-02-29 02:16:07 -08:00
Rajesh Amaravathi
2da18b6724 transport/socket: configuring tcp window-size
Till now, send and recieve buffer window sizes for sockets
were set to a default glusterfs-specific value.
Linux's default window sizes have been found to be better
w.r.t performance, and hence, no more setting it to any
default value.

However, if one wishes, there's the new configuration option:
   network.tcp-window-size <sane_size>
which takes a size value (int or human readable) and will set
the window size of sockets for both clients and servers.
Nfs clients will also be updated with the same.

Change-Id: I841479bbaea791b01086c42f58401ed297ff16ea
BUG: 795635
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2821
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-29 02:10:44 -08:00
Raghavendra Bhat
85471322df glusterfsd: unref the dict and free the memory to avoid memleak
Change-Id: Ib7a1f8cbab039fefb73dc35560a035d5688b0e32
BUG: 796186
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2808
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-27 02:17:34 -08:00
shishir gowda
7820f7563a protocol/client: Pass correct dict in client_readdirp
Also, alloc entry->dict before calling unserialize to it.

Change-Id: I8a9db93afd6e95e75307467cd654805780d7b467
BUG: 796534
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/2803
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-22 23:19:10 -08:00