summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-05-15 16:31:55 +0530
committerAnand Avati <avati@redhat.com>2012-05-16 15:51:57 -0700
commit1d02db63ae17788c7ab28ac81dea0675500be845 (patch)
tree3d90529903b709ac77dd9eda28940b812e6da1c5
parentc04fe640f5a0baf146a8530cf012fe35aa9ca588 (diff)
client/protocol : Changes in client3_1_getxattr()
Copy args->loc to local->loc in client3_1_getxattr(). This prevents logs with "(null) (--)" in client3_1_getxattr_cbk(). Also save args->name in local->name and print it in the log as well. Change-Id: I1bfd00c6bbbe9f617744af7acd2f07ceafaadb3a BUG: 812199 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3336 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/protocol/client/src/client-helpers.c4
-rw-r--r--xlators/protocol/client/src/client.h1
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c8
3 files changed, 11 insertions, 2 deletions
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
index 70dfeba8c1a..3efadeae265 100644
--- a/xlators/protocol/client/src/client-helpers.c
+++ b/xlators/protocol/client/src/client-helpers.c
@@ -132,6 +132,10 @@ client_local_wipe (clnt_local_t *local)
iobref_unref (local->iobref);
}
+ if (local->name) {
+ GF_FREE (local->name);
+ }
+
mem_put (local);
}
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index bf04f942a39..64066dd0add 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -155,6 +155,7 @@ typedef struct client_local {
int32_t cmd;
struct list_head lock_list;
pthread_mutex_t mutex;
+ char *name;
} clnt_local_t;
typedef struct client_args {
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index dcf688a0e9f..1129aebc04d 100644
--- a/xlators/protocol/client/src/client3_1-fops.c
+++ b/xlators/protocol/client/src/client3_1-fops.c
@@ -1051,11 +1051,12 @@ out:
if (rsp.op_ret == -1) {
gf_log (this->name, ((op_errno == ENOTSUP) ?
GF_LOG_DEBUG : GF_LOG_WARNING),
- "remote operation failed: %s. Path: %s (%s)",
+ "remote operation failed: %s. Path: %s (%s). Key: %s",
strerror (op_errno),
(local) ? local->loc.path : "--",
(local && local->loc.inode) ?
- uuid_utoa (local->loc.inode->gfid) : "--");
+ uuid_utoa (local->loc.inode->gfid) : "--",
+ (local) ? local->name : "(null)");
}
CLIENT_STACK_UNWIND (getxattr, frame, rsp.op_ret, op_errno, dict, xdata);
@@ -4635,6 +4636,9 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this,
op_errno = ENOMEM;
goto unwind;
}
+
+ loc_copy (&local->loc, args->loc);
+ local->name = gf_strdup (args->name);
frame->local = local;
rsp_iobref = iobref_new ();