summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2012-08-02 16:23:08 +0530
committerAnand Avati <avati@redhat.com>2012-08-02 11:42:40 -0700
commitb25eba06d5d50543975d24a0dc0a3a1934faf40b (patch)
tree73772ccfa91ba507148d8334ec2f00052f5cb645 /libglusterfs
parent91bf4e5137b56cf52162e30db92df02ef9964b10 (diff)
protocol/server: use pthread_mutex_trylock while dumping statedumps
Change-Id: Iec6f539ee7d36c25aca3960abc6d2611707617c8 BUG: 843821 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.com/3774 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@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 fede42a7483..246539b75cf 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;
}