summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2012-08-09 18:33:37 +0530
committerVijay Bellur <vbellur@redhat.com>2012-08-11 23:29:14 -0700
commitc79690c4cb503a6e6b52998038fd85cdfcf0f7be (patch)
treefe1ea9023ef4823b0a97c87a3f8d24a56fd446e9 /libglusterfs
parenta1d071374365a10ebef508c38c39f61da0a0f855 (diff)
protocol/server: use pthread_mutex_trylock while dumping statedumps
Change-Id: I2b04dc35a51d940915197cf8e26e638f32fa4d7b BUG: 843821 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3802 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/fd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 3a7a592786c..b0b75a5ad3e 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -989,10 +989,8 @@ fdtable_dump (fdtable_t *fdtable, char *prefix)
ret = pthread_mutex_trylock (&fdtable->lock);
- if (ret) {
- gf_log ("fd", GF_LOG_WARNING, "Unable to acquire lock");
- return;
- }
+ if (ret)
+ goto out;
memset(key, 0, sizeof(key));
gf_proc_dump_build_key(key, prefix, "refcount");
@@ -1012,6 +1010,12 @@ fdtable_dump (fdtable_t *fdtable, char *prefix)
}
pthread_mutex_unlock(&fdtable->lock);
+
+out:
+ if (ret != 0)
+ gf_proc_dump_write ("Unable to dump the fdtable",
+ "(Lock acquistion failed) %p", fdtable);
+ return;
}