summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/performance/quick-read/src/quick-read.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 349ea778902..867900b902c 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -3431,6 +3431,7 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode)
int32_t ret = -1;
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
char buf[256] = {0, };
+
ret = inode_ctx_get (inode, this, &value);
if (ret != 0) {
goto out;
@@ -3470,6 +3471,7 @@ qr_fdctx_dump (xlator_t *this, fd_t *fd)
char key[GF_DUMP_MAX_BUF_LEN] = {0, };
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
call_stub_t *stub = NULL;
+ gf_boolean_t add_section = _gf_false;
ret = fd_ctx_get (fd, this, &value);
if (ret != 0) {
@@ -3484,13 +3486,16 @@ qr_fdctx_dump (xlator_t *this, fd_t *fd)
gf_proc_dump_build_key (key_prefix, "xlator.performance.quick-read",
"fdctx");
gf_proc_dump_add_section (key_prefix);
+ add_section = _gf_true;
gf_proc_dump_write ("fd", "%p", fd);
- gf_proc_dump_write ("path", "%s", fdctx->path);
-
- LOCK (&fdctx->lock);
+ ret = TRY_LOCK (&fdctx->lock);
+ if (ret)
+ goto out;
{
+ gf_proc_dump_write ("path", "%s", fdctx->path);
+
gf_proc_dump_write ("opened", "%s", fdctx->opened ? "yes" : "no");
gf_proc_dump_write ("open-in-progress", "%s", fdctx->open_in_transit ?
@@ -3518,6 +3523,14 @@ qr_fdctx_dump (xlator_t *this, fd_t *fd)
ret = 0;
out:
+ if (ret && fdctx) {
+ if (add_section == _gf_false)
+ gf_proc_dump_add_section (key_prefix);
+
+ gf_proc_dump_write ("Unable to dump the state of fdctx",
+ "(Lock acquistion failed) fd: %p, gfid: %s",
+ fd, uuid_utoa (fd->inode->gfid));
+ }
return ret;
}