summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-09-24 00:49:49 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-24 01:19:01 -0700
commit881e5f243d3c56dcaf54595378beb91c45f1ded5 (patch)
tree0be1be3c8f42fe42b65a36afdb131d21dfeab0a6 /libglusterfsclient/src
parent7398c0a694343c15292f076dbb0ae8508004d003 (diff)
libglusterfsclient: Clean up fini and umount code paths
This patch cleans up the umount and fini paths in preparation to support waiting for unwind of all pending call frames. Two misc fixes are: 1. Fix to avoid deadlock in _libgf_umount by using _libgf_vmp_search_entry instead of libgf_vmp_search_exact_entry since the latter tries to take a lock already help by _libgf_umount. 2. Avoid a crash in _libgf_umount by deleting the vmp entry from the list before it gets freed. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 279 (File written with booster results in self-heal after dd exits) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=279
Diffstat (limited to 'libglusterfsclient/src')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 651f02c0b02..0f2c2dd80a6 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -67,7 +67,6 @@ int
libgf_realpath_loc_fill (libglusterfs_client_ctx_t *ctx, char *link,
loc_t *targetloc);
static int first_init = 1;
-static int first_fini = 1;
/* The global list of virtual mount points */
struct {
@@ -1712,7 +1711,7 @@ _libgf_umount (char *vmp)
struct vmp_entry *entry= NULL;
int ret = -1;
- entry = libgf_vmp_search_exact_entry (vmp);
+ entry = _libgf_vmp_search_entry (vmp, LIBGF_VMP_EXACT);
if (entry == NULL) {
gf_log ("libglusterfsclient", GF_LOG_ERROR,
"path (%s) not mounted", vmp);
@@ -1727,9 +1726,9 @@ _libgf_umount (char *vmp)
}
ret = glusterfs_fini (entry->handle);
+ list_del_init (&entry->list);
libgf_free_vmp_entry (entry);
- list_del_init (&entry->list);
vmplist.entries--;
out:
@@ -1801,7 +1800,7 @@ glusterfs_reset (void)
memset (&vmplock, 0, sizeof (vmplock));
pthread_mutex_init (&vmplock, NULL);
- first_fini = first_init = 1;
+ first_init = 1;
}
void
@@ -1827,29 +1826,16 @@ glusterfs_fini (glusterfs_handle_t handle)
FREE (ctx->gf_ctx.cmd_args.volume_name);
FREE (ctx->gf_ctx.pool);
FREE (ctx->gf_ctx.event_pool);
+ iobuf_pool_destroy (ctx->gf_ctx.iobuf_pool);
((gf_timer_registry_t *)ctx->gf_ctx.timer)->fin = 1;
- /* inode_table_destroy (ctx->itable); */
xlator_graph_fini (ctx->gf_ctx.graph);
xlator_tree_free (ctx->gf_ctx.graph);
ctx->gf_ctx.graph = NULL;
-
- /* FREE (ctx->gf_ctx.specfile); */
-
- /* TODO complete cleanup of timer */
- /*TODO
- * destroy the reply thread
- * destroy inode table
- * FREE (ctx)
- */
+ pthread_cancel (ctx->reply_thread);
FREE (ctx);
- if (first_fini) {
- ;
- //gf_log_cleanup ();
- }
-
return 0;
}
ath on wire, the xdr size on wire most of the time can remain constant, which helps in allocating RDMA buffers. Change-Id: Ie0d36a670be60b02fd1e925c6f977b1a71def5cd BUG: 790298 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/2744 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
client was sending 'path' on wire, which gets ignored on server
side, and also doesn't get freed up, which causes memory leak.

also with not having path on wire, the xdr size on wire most of the
time can remain constant, which helps in allocating RDMA buffers.

Change-Id: Ie0d36a670be60b02fd1e925c6f977b1a71def5cd
BUG: 790298
Signed-off-by: Amar Tumballi <amar@gluster.com>
Reviewed-on: http://review.gluster.com/2744
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
core: add an extra flag to readv()/writev() API 2012-02-14T09:09:02+00:00 Amar Tumballi amar@gluster.com 2012-02-06T12:19:14+00:00 0e6df0100e13123fe38f28c5a090777e894d8f52 needed to implement a proper handling of open flag alterations using fcntl() on fd. Change-Id: Ic280d5db6f1dc0418d5c439abb8db1d3ac21ced0 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 782265 Reviewed-on: http://review.gluster.com/2723 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
needed to implement a proper handling of open flag alterations
using fcntl() on fd.

Change-Id: Ic280d5db6f1dc0418d5c439abb8db1d3ac21ced0
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2723
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
protocol: allow extra data in all the 'fops' over wire 2012-01-25T10:28:07+00:00 Amar Tumballi amar@gluster.com 2011-12-23T04:30:28+00:00 e98752525706fd6d9989367eb84f1a7fc1b81fa4 Change-Id: I3920c68b5b317fc4a4acfd26d64d900bf7bd59d1 BUG: 782265 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/2511 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Change-Id: I3920c68b5b317fc4a4acfd26d64d900bf7bd59d1
BUG: 782265
Signed-off-by: Amar Tumballi <amar@gluster.com>
Reviewed-on: http://review.gluster.com/2511
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
core: add 'fremovexattr()' fop 2012-01-25T10:24:20+00:00 Amar Tumballi amar@gluster.com 2012-01-17T00:27:24+00:00 d7ecaaa1ed0f88869812ea17cb64a102a74c8c1c so operations can be done on fd for extended attribute removal Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 766571 Reviewed-on: http://review.gluster.com/778 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
so operations can be done on fd for extended attribute removal

Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 766571
Reviewed-on: http://review.gluster.com/778
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>