summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-05-02 11:38:33 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-02 22:59:11 -0700
commit170a3a411c88f6ce1662c55440a372f512e901d1 (patch)
tree43fc3af043a30f0ddb75e2ade29a68d9e0826e64 /xlators/protocol/client
parent7ee1c22353e3af4153d1716a5f3629615de4510e (diff)
log cleanup: in setxattr() path
* in posix we log occassionally if errno is ENOTSUP, added a suggestion to mount with 'user_xattr' option. * changed server's *etxattr_cbk to log ENOTSUP in debug level. * changed client's *etxattr_cbk to log ENOTSUP in debug level. Change-Id: Icd604050aaa68546011f2c950ecd7883ac6ee820 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 811957 Reviewed-on: http://review.gluster.com/3140 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/protocol/client')
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index 35e90c72379..be4322f2b3c 100644
--- a/xlators/protocol/client/src/client3_1-fops.c
+++ b/xlators/protocol/client/src/client3_1-fops.c
@@ -955,12 +955,12 @@ int
client3_1_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
void *myframe)
{
- call_frame_t *frame = NULL;
- gf_common_rsp rsp = {0,};
- int ret = 0;
- xlator_t *this = NULL;
- dict_t *xdata = NULL;
-
+ call_frame_t *frame = NULL;
+ gf_common_rsp rsp = {0,};
+ int ret = 0;
+ xlator_t *this = NULL;
+ dict_t *xdata = NULL;
+ int op_errno = EINVAL;
this = THIS;
@@ -985,12 +985,14 @@ client3_1_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
rsp.op_errno, out);
out:
+ op_errno = gf_error_to_errno (rsp.op_errno);
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ gf_log (this->name, ((op_errno == ENOTSUP) ?
+ GF_LOG_DEBUG : GF_LOG_WARNING),
+ "remote operation failed: %s",
+ strerror (op_errno));
}
- CLIENT_STACK_UNWIND (setxattr, frame, rsp.op_ret,
- gf_error_to_errno (rsp.op_errno), xdata);
+ CLIENT_STACK_UNWIND (setxattr, frame, rsp.op_ret, op_errno, xdata);
if (rsp.xdata.xdata_val)
free (rsp.xdata.xdata_val);
@@ -1048,7 +1050,8 @@ client3_1_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_log (this->name, ((op_errno == ENOTSUP) ?
+ GF_LOG_DEBUG : GF_LOG_WARNING),
"remote operation failed: %s. Path: %s",
strerror (op_errno),
(local) ? local->loc.path : "--");
@@ -1117,7 +1120,8 @@ client3_1_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_log (this->name, ((op_errno == ENOTSUP) ?
+ GF_LOG_DEBUG : GF_LOG_WARNING),
"remote operation failed: %s",
strerror (op_errno));
}
@@ -1794,12 +1798,12 @@ int
client3_1_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
void *myframe)
{
- call_frame_t *frame = NULL;
- gf_common_rsp rsp = {0,};
- int ret = 0;
- xlator_t *this = NULL;
- dict_t *xdata = NULL;
-
+ call_frame_t *frame = NULL;
+ gf_common_rsp rsp = {0,};
+ int ret = 0;
+ xlator_t *this = NULL;
+ dict_t *xdata = NULL;
+ int op_errno = EINVAL;
this = THIS;
@@ -1823,12 +1827,15 @@ client3_1_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
rsp.op_errno, out);
out:
+ op_errno = gf_error_to_errno (rsp.op_errno);
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ gf_log (this->name, ((op_errno == ENOTSUP) ?
+ GF_LOG_DEBUG : GF_LOG_WARNING),
+ "remote operation failed: %s",
+ strerror (op_errno));
}
- CLIENT_STACK_UNWIND (fsetxattr, frame, rsp.op_ret,
- gf_error_to_errno (rsp.op_errno), xdata);
+
+ CLIENT_STACK_UNWIND (fsetxattr, frame, rsp.op_ret, op_errno, xdata);
if (rsp.xdata.xdata_val)
free (rsp.xdata.xdata_val);