summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2012-10-04 20:55:30 +0530
committerAnand Avati <avati@redhat.com>2012-10-11 18:12:11 -0700
commit7413b50220779d185efdb1d259c379a119a30a77 (patch)
tree62d11b22bc9b41b0596577b1da320df833d4722e /xlators
parent68433db9ba07267c72d169b3ed4892e052e2eae2 (diff)
performance/write-behind: use try lock while taking statedumps
Change-Id: I690e8bf650d6e6e50899c2e17a79f42789e701eb BUG: 843792 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4036 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/write-behind/src/write-behind.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 53506d948ba..ee533db2012 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1734,6 +1734,7 @@ wb_inode_dump (xlator_t *this, inode_t *inode)
int32_t ret = -1;
char *path = NULL;
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
+ char uuid_str[64] = {0,};
if ((inode == NULL) || (this == NULL)) {
ret = 0;
@@ -1769,14 +1770,20 @@ wb_inode_dump (xlator_t *this, inode_t *inode)
gf_proc_dump_write ("op_errno", "%d", wb_inode->op_errno);
- LOCK (&wb_inode->lock);
+ ret = TRY_LOCK (&wb_inode->lock);
+ if (!ret)
{
if (!list_empty (&wb_inode->all)) {
__wb_dump_requests (&wb_inode->all, key_prefix);
}
+ UNLOCK (&wb_inode->lock);
}
- UNLOCK (&wb_inode->lock);
+ if (ret && wb_inode)
+ gf_proc_dump_write ("Unable to dump the inode information",
+ "(Lock acquisition failed) %p (gfid: %s)",
+ wb_inode,
+ uuid_utoa_r (inode->gfid, uuid_str));
ret = 0;
out:
return ret;