From 0f39192ef6bc7b1c74cfaeb04ed21305996d67e9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 16 Mar 2011 09:43:33 +0000 Subject: protocol/client: log enhancement Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346 --- xlators/protocol/client/src/client-callback.c | 7 +- xlators/protocol/client/src/client-handshake.c | 230 ++++++---- xlators/protocol/client/src/client-helpers.c | 14 +- xlators/protocol/client/src/client-lk.c | 87 ++-- xlators/protocol/client/src/client.c | 413 +++++++++++++++--- xlators/protocol/client/src/client.h | 29 +- xlators/protocol/client/src/client3_1-fops.c | 579 ++++++++++++++++++------- 7 files changed, 1001 insertions(+), 358 deletions(-) diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c index 947b43f5052..bfc8641129c 100644 --- a/xlators/protocol/client/src/client-callback.c +++ b/xlators/protocol/client/src/client-callback.c @@ -28,19 +28,24 @@ int client_cbk_null (void *data) { + gf_log (THIS->name, GF_LOG_WARNING, + "this function should not be called"); return 0; } int client_cbk_fetchspec (void *data) { - gf_log ("", 1, "here i am"); + gf_log (THIS->name, GF_LOG_WARNING, + "this function should not be called"); return 0; } int client_cbk_ino_flush (void *data) { + gf_log (THIS->name, GF_LOG_WARNING, + "this function should not be called"); return 0; } diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 4577dda5d65..b5c894fdcff 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -56,20 +56,25 @@ rpc_client_ping_timer_expired (void *data) this = data; if (!this || !this->private) { + gf_log ("", GF_LOG_WARNING, "xlator initialization not done"); goto out; } conf = this->private; clnt = conf->rpc; - if (!clnt) + if (!clnt) { + gf_log (this->name, GF_LOG_WARNING, "rpc not initialized"); goto out; + } conn = &clnt->conn; trans = conn->trans; - if (!trans) + if (!trans) { + gf_log (this->name, GF_LOG_WARNING, "transport not initialized"); goto out; + } pthread_mutex_lock (&conn->lock); { @@ -97,8 +102,8 @@ rpc_client_ping_timer_expired (void *data) rpc_client_ping_timer_expired, (void *) this); if (conn->ping_timer == NULL) - gf_log (trans->name, GF_LOG_DEBUG, - "unable to setup timer"); + gf_log (trans->name, GF_LOG_WARNING, + "unable to setup ping timer"); } else { conn->ping_started = 0; @@ -109,8 +114,8 @@ rpc_client_ping_timer_expired (void *data) pthread_mutex_unlock (&conn->lock); if (disconnect) { - gf_log (trans->name, GF_LOG_ERROR, - "Server %s has not responded in the last %d " + gf_log (trans->name, GF_LOG_CRITICAL, + "server %s has not responded in the last %d " "seconds, disconnecting.", conn->trans->peerinfo.identifier, conf->opt.ping_timeout); @@ -134,17 +139,22 @@ client_start_ping (void *data) int frame_count = 0; this = data; - if (!this || !this->private) + if (!this || !this->private) { + gf_log ("", GF_LOG_WARNING, "xlator not initialized"); goto fail; + } conf = this->private; - if (!conf->rpc) + if (!conf->rpc) { + gf_log (this->name, GF_LOG_WARNING, "rpc not initialized"); goto fail; - + } conn = &conf->rpc->conn; - if (conf->opt.ping_timeout == 0) + if (conf->opt.ping_timeout == 0) { + gf_log (this->name, GF_LOG_INFO, "ping timeout is 0, returning"); return; + } pthread_mutex_lock (&conn->lock); { @@ -163,12 +173,17 @@ client_start_ping (void *data) /* using goto looked ugly here, * hence getting out this way */ /* unlock */ + gf_log (this->name, GF_LOG_DEBUG, + "returning as transport is already disconnected" + " OR there are no frames (%d || %d)", + frame_count, !conn->connected); + pthread_mutex_unlock (&conn->lock); return; } if (frame_count < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "saved_frames->count is %"PRId64, conn->saved_frames->count); conn->saved_frames->count = 0; @@ -183,8 +198,8 @@ client_start_ping (void *data) (void *) this); if (conn->ping_timer == NULL) { - gf_log (this->name, GF_LOG_DEBUG, - "unable to setup timer"); + gf_log (this->name, GF_LOG_WARNING, + "unable to setup ping timer"); } else { conn->ping_started = 1; } @@ -203,6 +218,7 @@ client_start_ping (void *data) return; fail: + gf_log ("", GF_LOG_ERROR, "failed to start ping timer"); if (frame) { STACK_DESTROY (frame->root); @@ -222,28 +238,31 @@ client_ping_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; clnt_conf_t *conf = NULL; - if (!myframe) + if (!myframe) { + gf_log ("", GF_LOG_WARNING, "frame with the request is NULL"); goto out; - + } frame = myframe; this = frame->this; - if (!this || !this->private) + if (!this || !this->private) { + gf_log ("", GF_LOG_WARNING, "xlator private is not set"); goto out; + } conf = this->private; conn = &conf->rpc->conn; if (req->rpc_status == -1) { - if (conn->ping_timer != NULL) { - gf_log (this->name, GF_LOG_DEBUG, "socket or ib" - " related error"); - gf_timer_call_cancel (this->ctx, conn->ping_timer); - conn->ping_timer = NULL; - } else { - /* timer expired and transport bailed out */ - gf_log (this->name, GF_LOG_DEBUG, "timer must have " - "expired"); - } + if (conn->ping_timer != NULL) { + gf_log (this->name, GF_LOG_WARNING, "socket or ib" + " related error"); + gf_timer_call_cancel (this->ctx, conn->ping_timer); + conn->ping_timer = NULL; + } else { + /* timer expired and transport bailed out */ + gf_log (this->name, GF_LOG_WARNING, "timer must have " + "expired"); + } goto out; } @@ -260,8 +279,8 @@ client_ping_cbk (struct rpc_req *req, struct iovec *iov, int count, client_start_ping, (void *)this); if (conn->ping_timer == NULL) - gf_log (this->name, GF_LOG_DEBUG, - "gf_timer_call_after() returned NULL"); + gf_log (this->name, GF_LOG_WARNING, + "failed to set the ping timer"); } pthread_mutex_unlock (&conn->lock); out: @@ -281,22 +300,32 @@ client3_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, frame = myframe; - if (-1 == req->rpc_status) { + if (!frame || !frame->this) { + gf_log ("", GF_LOG_ERROR, "frame not found with the request, " + "returning EINVAL"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } + if (-1 == req->rpc_status) { + gf_log (frame->this->name, GF_LOG_WARNING, + "received RPC status error, returning ENOTCONN"); + rsp.op_ret = -1; + rsp.op_errno = ENOTCONN; + goto out; + } ret = xdr_to_getspec_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (frame->this->name, GF_LOG_ERROR, + "XDR decoding failed, returning EINVAL"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } if (-1 == rsp.op_ret) { - gf_log (frame->this->name, GF_LOG_ERROR, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to get the 'volume file' from server"); goto out; } @@ -337,6 +366,7 @@ int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the request"); STACK_UNWIND_STRICT (getspec, frame, -1, op_errno, NULL); return 0; @@ -380,10 +410,15 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; frame = myframe; + if (!frame || !frame->this) + goto out; + local = frame->local; conf = frame->this->private; if (-1 == req->rpc_status) { + gf_log (frame->this->name, GF_LOG_WARNING, + "received RPC status error, returning ENOTCONN"); rsp.op_ret = -1; rsp.op_errno = ENOTCONN; goto out; @@ -391,18 +426,18 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_open_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } if (rsp.op_ret < 0) { - gf_log (frame->this->name, GF_LOG_NORMAL, + gf_log (frame->this->name, GF_LOG_WARNING, "reopen on %s failed (%s)", local->loc.path, strerror (rsp.op_errno)); } else { - gf_log (frame->this->name, GF_LOG_NORMAL, + gf_log (frame->this->name, GF_LOG_DEBUG, "reopen on %s succeeded (remote-fd = %"PRId64")", local->loc.path, rsp.fd); } @@ -415,6 +450,7 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, fdctx = local->fdctx; if (!fdctx) { + gf_log (frame->this->name, GF_LOG_WARNING, "fdctx not found"); ret = -1; goto out; } @@ -437,18 +473,18 @@ client3_1_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = client_attempt_lock_recovery (frame->this, local->fdctx); if (ret < 0) { gf_log (frame->this->name, GF_LOG_DEBUG, - "No locks on fd to recover"); + "lock recovery not attempted on fd"); } else { - gf_log (frame->this->name, GF_LOG_DEBUG, - "Need to attempt lock recovery on %lld open fds", - (unsigned long long) fd_count); + gf_log (frame->this->name, GF_LOG_INFO, + "need to attempt lock recovery on %"PRIu64 + " open fds", fd_count); } - } else { - fd_count = decrement_reopen_fd_count (frame->this, conf); } - out: + if (!attempt_lock_recovery) + fd_count = decrement_reopen_fd_count (frame->this, conf); + if (fdctx) client_fdctx_destroy (frame->this, fdctx); @@ -479,10 +515,11 @@ client3_1_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; local = frame->local; - frame->local = NULL; conf = frame->this->private; if (-1 == req->rpc_status) { + gf_log (frame->this->name, GF_LOG_WARNING, + "received RPC status error, returning ENOTCONN"); rsp.op_ret = -1; rsp.op_errno = ENOTCONN; goto out; @@ -490,14 +527,14 @@ client3_1_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_opendir_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } if (rsp.op_ret < 0) { - gf_log (frame->this->name, GF_LOG_NORMAL, + gf_log (frame->this->name, GF_LOG_WARNING, "reopendir on %s failed (%s)", local->loc.path, strerror (rsp.op_errno)); } else { @@ -506,23 +543,29 @@ client3_1_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count, local->loc.path, rsp.fd); } - if (-1 != rsp.op_ret) { - fdctx = local->fdctx; - if (fdctx) { - pthread_mutex_lock (&conf->lock); - { - fdctx->remote_fd = rsp.fd; + if (-1 == rsp.op_ret) { + ret = -1; + goto out; + } - if (!fdctx->released) { - list_add_tail (&fdctx->sfd_pos, &conf->saved_fds); - fdctx = NULL; - } - } - pthread_mutex_unlock (&conf->lock); + fdctx = local->fdctx; + if (!fdctx) { + gf_log (frame->this->name, GF_LOG_WARNING, "fdctx not found"); + ret = -1; + goto out; + } + + pthread_mutex_lock (&conf->lock); + { + fdctx->remote_fd = rsp.fd; + + if (!fdctx->released) { + list_add_tail (&fdctx->sfd_pos, &conf->saved_fds); + fdctx = NULL; } } + pthread_mutex_unlock (&conf->lock); - decrement_reopen_fd_count (frame->this, conf); ret = 0; out: @@ -561,6 +604,9 @@ protocol_client_reopendir (xlator_t *this, clnt_fd_ctx_t *fdctx) ret = inode_path (inode, NULL, &path); if (ret < 0) { + gf_log (this->name, GF_LOG_WARNING, + "couldn't build path from inode %s", + uuid_utoa (inode->gfid)); goto out; } @@ -599,6 +645,8 @@ protocol_client_reopendir (xlator_t *this, clnt_fd_ctx_t *fdctx) return ret; out: + gf_log ("", GF_LOG_ERROR, "failed to send the re-opendir request"); + if (frame) { frame->local = NULL; STACK_DESTROY (frame->root); @@ -636,6 +684,9 @@ protocol_client_reopen (xlator_t *this, clnt_fd_ctx_t *fdctx) ret = inode_path (inode, NULL, &path); if (ret < 0) { + gf_log (this->name, GF_LOG_WARNING, + "couldn't build path from inode %s", + uuid_utoa (inode->gfid)); goto out; } @@ -674,6 +725,8 @@ protocol_client_reopen (xlator_t *this, clnt_fd_ctx_t *fdctx) return ret; out: + gf_log ("", GF_LOG_ERROR, "failed to send the re-open request"); + if (frame) { frame->local = NULL; STACK_DESTROY (frame->root); @@ -742,9 +795,8 @@ client_post_handshake (call_frame_t *frame, xlator_t *this) } } else { gf_log (this->name, GF_LOG_DEBUG, - "No open fds - notifying all parents child up"); + "no open fds - notifying all parents child up"); client_notify_parents_child_up (this); - } out: return 0; @@ -771,13 +823,15 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m conf = this->private; if (-1 == req->rpc_status) { + gf_log (frame->this->name, GF_LOG_WARNING, + "received RPC status error"); op_ret = -1; goto out; } ret = xdr_to_setvolume_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); op_ret = -1; goto out; } @@ -785,7 +839,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m op_errno = gf_error_to_errno (rsp.op_errno); if (-1 == rsp.op_ret) { gf_log (frame->this->name, GF_LOG_WARNING, - "failed to set the volume"); + "failed to set the volume (%s)", + (op_errno)? strerror (op_errno) : "--"); } reply = dict_new (); @@ -796,7 +851,7 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m ret = dict_unserialize (rsp.dict.dict_val, rsp.dict.dict_len, &reply); if (ret < 0) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to unserialize buffer to dict"); goto out; } @@ -804,13 +859,13 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m ret = dict_get_str (reply, "ERROR", &remote_error); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get ERROR string from reply dict"); } ret = dict_get_str (reply, "process-uuid", &process_uuid); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get 'process-uuid' from reply dict"); } @@ -830,10 +885,14 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m } goto out; } + ret = dict_get_str (this->options, "remote-subvolume", &remote_subvol); - if (ret || !remote_subvol) + if (ret || !remote_subvol) { + gf_log (this->name, GF_LOG_WARNING, + "failed to find key 'remote-subvolume' in the options"); goto out; + } /* TODO: currently setpeer path is broken */ /* @@ -857,7 +916,7 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m } */ - gf_log (this->name, GF_LOG_NORMAL, + gf_log (this->name, GF_LOG_INFO, "Connected to %s, attached to remote volume '%s'.", conf->rpc->conn.trans->peerinfo.identifier, remote_subvol); @@ -878,6 +937,7 @@ out: * background, for now, don't hang here, * tell the parents that i am all ok.. */ + gf_log (this->name, GF_LOG_INFO, "sending CHILD_CONNECTING event"); parent = this->parents; while (parent) { xlator_notify (parent->xlator, @@ -992,6 +1052,7 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc) NULL, 0, NULL); fail: + if (ret) { config.remote_port = -1; rpc_clnt_reconfig (conf->rpc, &config); @@ -1010,8 +1071,11 @@ select_server_supported_programs (xlator_t *this, gf_prog_detail *prog) clnt_conf_t *conf = NULL; int ret = -1; - if (!this || !prog) + if (!this || !prog) { + gf_log ("", GF_LOG_WARNING, + "xlator not found OR RPC program not found"); goto out; + } conf = this->private; trav = prog; @@ -1046,8 +1110,11 @@ server_has_portmap (xlator_t *this, gf_prog_detail *prog) gf_prog_detail *trav = NULL; int ret = -1; - if (!this || !prog) + if (!this || !prog) { + gf_log ("", GF_LOG_WARNING, + "xlator not found OR RPC program not found"); goto out; + } trav = prog; @@ -1078,26 +1145,29 @@ client_query_portmap_cbk (struct rpc_req *req, struct iovec *iov, int count, voi xlator_t *this = NULL; frame = myframe; - if (!frame || !frame->this || !frame->this->private) + if (!frame || !frame->this || !frame->this->private) { + gf_log ("", GF_LOG_WARNING, + "frame not found with rpc request"); goto out; - + } this = frame->this; conf = frame->this->private; if (-1 == req->rpc_status) { - gf_log ("", 1, "some error, retry again later"); + gf_log (this->name, GF_LOG_WARNING, + "received RPC status error, try again later"); goto out; } ret = xdr_to_pmap_port_by_brick_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed"); goto out; } if (-1 == rsp.op_ret) { ret = -1; - gf_log (frame->this->name, GF_LOG_ERROR, + gf_log (this->name, GF_LOG_ERROR, "failed to get the port number for remote subvolume"); goto out; } @@ -1175,17 +1245,18 @@ client_dump_version_cbk (struct rpc_req *req, struct iovec *iov, int count, conf = frame->this->private; if (-1 == req->rpc_status) { - gf_log ("", 1, "some error, retry again later"); + gf_log (frame->this->name, GF_LOG_WARNING, + "received RPC status error"); goto out; } ret = xdr_to_dump_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed"); goto out; } if (-1 == rsp.op_ret) { - gf_log (frame->this->name, GF_LOG_ERROR, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to get the 'versions' from server"); goto out; } @@ -1200,8 +1271,7 @@ client_dump_version_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = select_server_supported_programs (frame->this, rsp.prog); if (ret) { gf_log (frame->this->name, GF_LOG_ERROR, - "Server versions are not present in this " - "release"); + "server doesn't support the version"); goto out; } @@ -1236,8 +1306,10 @@ client_handshake (xlator_t *this, struct rpc_clnt *rpc) int ret = 0; conf = this->private; - if (!conf->handshake) + if (!conf->handshake) { + gf_log (this->name, GF_LOG_WARNING, "handshake program not found"); goto out; + } frame = create_frame (this, this->ctx->pool); if (!frame) diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c index 4dd51257b6e..85a9f89ed65 100644 --- a/xlators/protocol/client/src/client-helpers.c +++ b/xlators/protocol/client/src/client-helpers.c @@ -78,25 +78,23 @@ this_fd_set_ctx (fd_t *file, xlator_t *this, loc_t *loc, clnt_fd_ctx_t *ctx) ret = fd_ctx_get (file, this, &oldaddr); if (ret >= 0) { if (loc) - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_INFO, "%s (%"PRId64"): trying duplicate remote fd set. ", loc->path, loc->inode->ino); else - gf_log (this->name, GF_LOG_DEBUG, - "%p: trying duplicate remote fd set. ", - file); + gf_log (this->name, GF_LOG_INFO, + "%p: trying duplicate remote fd set. ", file); } ret = fd_ctx_set (file, this, (uint64_t)(unsigned long)ctx); if (ret < 0) { if (loc) - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "%s (%"PRId64"): failed to set remote fd", loc->path, loc->inode->ino); else - gf_log (this->name, GF_LOG_DEBUG, - "%p: failed to set remote fd", - file); + gf_log (this->name, GF_LOG_WARNING, + "%p: failed to set remote fd", file); } out: return; diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c index c018d537547..068d4460950 100644 --- a/xlators/protocol/client/src/client-lk.c +++ b/xlators/protocol/client/src/client-lk.c @@ -34,7 +34,7 @@ __dump_client_lock (client_posix_lock_t *lock) this = THIS; - gf_log (this->name, GF_LOG_TRACE, + gf_log (this->name, GF_LOG_INFO, "{fd=%p}" "{%s lk-owner:%"PRIu64" %"PRId64" - %"PRId64"}" "{start=%"PRId64" end=%"PRId64"}", @@ -241,7 +241,8 @@ subtract_locks (client_posix_lock_t *big, client_posix_lock_t *small) memcpy (v.locks[1], small, sizeof (client_posix_lock_t)); } else { - gf_log ("client-protocol", GF_LOG_ERROR, + /* LOG-TODO : decide what more info is required here*/ + gf_log ("client-protocol", GF_LOG_CRITICAL, "Unexpected case in subtract_locks. Please send " "a bug report to gluster-devel@nongnu.org"); } @@ -402,7 +403,7 @@ delete_granted_locks_owner (fd_t *fd, uint64_t owner) destroy_client_lock (lock); } -/* FIXME: Need to actually print the locks instead of count */ + /* FIXME: Need to actually print the locks instead of count */ gf_log (this->name, GF_LOG_DEBUG, "Number of locks cleared=%d", count); @@ -451,6 +452,10 @@ client_mark_bad_fd (fd_t *fd, clnt_fd_ctx_t *fdctx) this = THIS; if (fdctx) fdctx->remote_fd = -1; + + gf_log (this->name, GF_LOG_WARNING, + "marking the file descriptor (%p) bad", fd); + this_fd_set_ctx (fd, this, NULL, fdctx); } @@ -492,8 +497,6 @@ new_client_lock (struct gf_flock *flock, uint64_t owner, new_lock = GF_CALLOC (1, sizeof (*new_lock), gf_client_mt_clnt_lock_t); if (!new_lock) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); goto out; } @@ -512,7 +515,6 @@ new_client_lock (struct gf_flock *flock, uint64_t owner, new_lock->owner = owner; new_lock->cmd = cmd; /* Not really useful */ - out: return new_lock; } @@ -548,16 +550,14 @@ client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock, uint64_t owner, pthread_mutex_unlock (&conf->lock); if (!fdctx) { - gf_log (this->name, GF_LOG_DEBUG, - "failed to get fd context. Marking as bad fd."); + gf_log (this->name, GF_LOG_WARNING, + "failed to get fd context. sending EBADFD"); ret = -EBADFD; goto out; } lock = new_client_lock (flock, owner, cmd, fd); if (!lock) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); ret = -ENOMEM; goto out; } @@ -613,7 +613,7 @@ decrement_reopen_fd_count (xlator_t *this, clnt_conf_t *conf) UNLOCK (&conf->rec_lock); if (fd_count == 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_INFO, "last fd open'd/lock-self-heal'd - notifying CHILD-UP"); client_notify_parents_child_up (this); } @@ -638,10 +638,8 @@ client_remove_reserve_lock_cbk (call_frame_t *frame, conf = this->private; if (op_ret < 0) { - /* TODO: critical error describing recovery command - and blanket on ops on fd */ - gf_log (this->name, GF_LOG_CRITICAL, - "Lock recovery failed with error msg=%s", + gf_log (this->name, GF_LOG_WARNING, + "removing reserver lock on fd failed: %s", strerror(op_errno)); goto cleanup; } @@ -651,11 +649,13 @@ client_remove_reserve_lock_cbk (call_frame_t *frame, cleanup: frame->local = NULL; - client_mark_bad_fd (local->client_lock->fd, - local->fdctx); + + client_mark_bad_fd (local->client_lock->fd, local->fdctx); + destroy_client_lock (local->client_lock); client_local_wipe (local); STACK_DESTROY (frame->root); + fd_count = decrement_reopen_fd_count (this, conf); gf_log (this->name, GF_LOG_DEBUG, "Need to attempt lock recovery on %lld open fds", @@ -703,11 +703,11 @@ unlock: int32_t client_reserve_lock_cbk (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct gf_flock *lock) + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct gf_flock *lock) { clnt_local_t *local = NULL; @@ -724,14 +724,13 @@ client_reserve_lock_cbk (call_frame_t *frame, if (op_ret >= 0) { /* Lock is grantable if flock reflects a successful getlk() call*/ if (lock->l_type == F_UNLCK && lock->l_pid) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_INFO, "Got the reservelk, but the lock is not grantable. "); client_remove_reserve_lock (this, frame, local->client_lock); goto out; } - gf_log (this->name, GF_LOG_DEBUG, - "Reserve Lock succeeded"); + gf_log (this->name, GF_LOG_DEBUG, "reserve lock succeeded"); client_send_recovery_lock (frame, this, local->client_lock); goto out; } @@ -739,8 +738,8 @@ client_reserve_lock_cbk (call_frame_t *frame, /* Somebody else has a reserve lk. Lock conflict detected. Mark fd as bad */ - gf_log (this->name, GF_LOG_DEBUG, - "Reservelk OP failed. Aborting lock recovery and marking bad fd"); + gf_log (this->name, GF_LOG_WARNING, + "reservelk OP failed. aborting lock recovery"); client_mark_bad_fd (local->client_lock->fd, local->fdctx); @@ -748,10 +747,11 @@ client_reserve_lock_cbk (call_frame_t *frame, frame->local = NULL; client_local_wipe (local); STACK_DESTROY (frame->root); + fd_count = decrement_reopen_fd_count (this, conf); gf_log (this->name, GF_LOG_DEBUG, - "Need to attempt lock recovery on %lld open fds", - (unsigned long long) fd_count); + "need to attempt lock recovery on %"PRIu64" open fds", + fd_count); out: return 0; @@ -777,10 +777,8 @@ client_recovery_lock_cbk (call_frame_t *frame, conf = this->private; if (op_ret < 0) { - /* TODO: critical error describing recovery command - and blanket on ops on fd */ - gf_log (this->name, GF_LOG_CRITICAL, - "Lock recovery failed with error msg=%s", + gf_log (this->name, GF_LOG_ERROR, + "lock recovery failed: %s", strerror(op_errno)); client_mark_bad_fd (local->client_lock->fd, @@ -790,12 +788,12 @@ client_recovery_lock_cbk (call_frame_t *frame, /* Lock recovered. Continue with reserve lock for next lock */ } else { gf_log (this->name, GF_LOG_DEBUG, - "lock recovered successfully - Continuing with next lock."); + "lock recovered successfully - continuing with next lock."); next_lock = get_next_recovery_lock (this, local); if (!next_lock) { gf_log (this->name, GF_LOG_DEBUG, - "All locks recovered on fd"); + "all locks recovered on fd"); goto cleanup; } @@ -811,15 +809,20 @@ client_recovery_lock_cbk (call_frame_t *frame, } cleanup: + frame->local = NULL; client_local_wipe (local); + if (local->client_lock) destroy_client_lock (local->client_lock); + STACK_DESTROY (frame->root); + fd_count = decrement_reopen_fd_count (this, conf); + gf_log (this->name, GF_LOG_DEBUG, - "Need to attempt lock recovery on %lld open fds", - (unsigned long long) fd_count); + "need to attempt lock recovery on %"PRIu64" open fds", + fd_count); out: return 0; @@ -872,8 +875,6 @@ client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx) local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); ret = -ENOMEM; goto out; } @@ -883,7 +884,7 @@ client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx) lock = get_next_recovery_lock (this, local); if (!lock) { gf_log (this->name, GF_LOG_DEBUG, - "No locks on fd"); + "no locks found on fd"); ret = -1; goto out; } @@ -891,7 +892,7 @@ client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx) frame = create_frame (this, this->ctx->pool); if (!frame) { gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); + "creating of frame failed, lock recovery failed"); ret = -1; goto out; } @@ -928,8 +929,8 @@ client_dump_locks (char *name, inode_t *inode, ret = dict_set_dynstr(new_dict, CLIENT_DUMP_LOCKS, dict_string); if (ret) { - gf_log (THIS->name, GF_LOG_DEBUG, - "Could not set dict with %s", CLIENT_DUMP_LOCKS); + gf_log (THIS->name, GF_LOG_WARNING, + "could not set dict with %s", CLIENT_DUMP_LOCKS); goto out; } diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 3ef38fe84d4..3082656f4d5 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -57,8 +57,9 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, char start_ping = 0; struct iobref *new_iobref = NULL; - if (!this || !prog || !frame) - goto out; + GF_VALIDATE_OR_GOTO ("client", this, out); + GF_VALIDATE_OR_GOTO (this->name, prog, out); + GF_VALIDATE_OR_GOTO (this->name, frame, out); conf = this->private; @@ -68,8 +69,11 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, if (!(conf->connected || ((prog->prognum == GLUSTER_DUMP_PROGRAM) || (prog->prognum == GLUSTER_PMAP_PROGRAM) || - ((prog->prognum == GLUSTER_HNDSK_PROGRAM) && (procnum == GF_HNDSK_SETVOLUME))))) + ((prog->prognum == GLUSTER_HNDSK_PROGRAM) && (procnum == GF_HNDSK_SETVOLUME))))) { + gf_log (this->name, GF_LOG_WARNING, + "connection in disconnected state"); goto out; + } iobuf = iobuf_get (this->ctx->iobuf_pool); if (!iobuf) { @@ -104,6 +108,10 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, if (req && sfunc) { ret = sfunc (iov, req); if (ret == -1) { + /* callingfn so that, we can get to know which xdr + function was called */ + gf_log_callingfn (this->name, GF_LOG_WARNING, + "XDR payload creation failed"); goto out; } iov.iov_len = ret; @@ -114,6 +122,10 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame, 0, new_iobref, frame, rsphdr, rsphdr_count, rsp_payload, rsp_payload_count, rsp_iobref); + if (ret < 0) { + gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed"); + } + if (ret == 0) { pthread_mutex_lock (&conf->rpc->conn.lock); { @@ -162,6 +174,12 @@ client_releasedir (xlator_t *this, fd_t *fd) args.fd = fd; proc = &conf->fops->proctable[GF_FOP_RELEASEDIR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_RELEASEDIR]); + goto out; + } if (proc->fn) { frame = create_frame (this, this->ctx->pool); if (!frame) { @@ -171,7 +189,7 @@ client_releasedir (xlator_t *this, fd_t *fd) } out: if (ret) - gf_log (this->name, GF_LOG_TRACE, + gf_log (this->name, GF_LOG_WARNING, "releasedir fop failed"); return 0; } @@ -191,6 +209,12 @@ client_release (xlator_t *this, fd_t *fd) args.fd = fd; proc = &conf->fops->proctable[GF_FOP_RELEASE]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_RELEASE]); + goto out; + } if (proc->fn) { frame = create_frame (this, this->ctx->pool); if (!frame) { @@ -200,7 +224,7 @@ client_release (xlator_t *this, fd_t *fd) } out: if (ret) - gf_log (this->name, GF_LOG_TRACE, + gf_log (this->name, GF_LOG_WARNING, "release fop failed"); return 0; } @@ -223,6 +247,12 @@ client_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, args.dict = xattr_req; proc = &conf->fops->proctable[GF_FOP_LOOKUP]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_LOOKUP]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -250,13 +280,18 @@ client_stat (call_frame_t *frame, xlator_t *this, loc_t *loc) args.loc = loc; proc = &conf->fops->proctable[GF_FOP_STAT]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_STAT]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: if (ret) STACK_UNWIND_STRICT (stat, frame, -1, ENOTCONN, NULL); - return 0; } @@ -277,6 +312,12 @@ client_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset) args.offset = offset; proc = &conf->fops->proctable[GF_FOP_TRUNCATE]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_TRUNCATE]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -304,6 +345,12 @@ client_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) args.offset = offset; proc = &conf->fops->proctable[GF_FOP_FTRUNCATE]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FTRUNCATE]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -331,6 +378,12 @@ client_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask) args.mask = mask; proc = &conf->fops->proctable[GF_FOP_ACCESS]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_ACCESS]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -359,6 +412,12 @@ client_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size) args.size = size; proc = &conf->fops->proctable[GF_FOP_READLINK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_READLINK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -388,6 +447,12 @@ client_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, args.dict = params; proc = &conf->fops->proctable[GF_FOP_MKNOD]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_MKNOD]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -417,6 +482,12 @@ client_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, args.dict = params; proc = &conf->fops->proctable[GF_FOP_MKDIR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_MKDIR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -444,6 +515,12 @@ client_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc) args.loc = loc; proc = &conf->fops->proctable[GF_FOP_UNLINK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_UNLINK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -470,6 +547,12 @@ client_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags) args.flags = flags; proc = &conf->fops->proctable[GF_FOP_RMDIR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_RMDIR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -500,6 +583,12 @@ client_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath, args.dict = params; proc = &conf->fops->proctable[GF_FOP_SYMLINK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_SYMLINK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -528,6 +617,12 @@ client_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, args.oldloc = oldloc; args.newloc = newloc; proc = &conf->fops->proctable[GF_FOP_RENAME]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_RENAME]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -557,6 +652,12 @@ client_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, args.newloc = newloc; proc = &conf->fops->proctable[GF_FOP_LINK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_LINK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -589,6 +690,12 @@ client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, args.dict = params; proc = &conf->fops->proctable[GF_FOP_CREATE]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_CREATE]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -620,6 +727,12 @@ client_open (call_frame_t *frame, xlator_t *this, loc_t *loc, args.wbflags = wbflags; proc = &conf->fops->proctable[GF_FOP_OPEN]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_OPEN]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); @@ -650,6 +763,12 @@ client_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, args.offset = offset; proc = &conf->fops->proctable[GF_FOP_READ]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_READ]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); @@ -685,6 +804,12 @@ client_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, args.iobref = iobref; proc = &conf->fops->proctable[GF_FOP_WRITE]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_WRITE]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -711,6 +836,12 @@ client_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) args.fd = fd; proc = &conf->fops->proctable[GF_FOP_FLUSH]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FLUSH]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -739,6 +870,12 @@ client_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, args.flags = flags; proc = &conf->fops->proctable[GF_FOP_FSYNC]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FSYNC]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -765,6 +902,12 @@ client_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) args.fd = fd; proc = &conf->fops->proctable[GF_FOP_FSTAT]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FSTAT]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -792,6 +935,12 @@ client_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd) args.fd = fd; proc = &conf->fops->proctable[GF_FOP_OPENDIR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_OPENDIR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -819,6 +968,12 @@ client_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) args.flags = flags; proc = &conf->fops->proctable[GF_FOP_FSYNCDIR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FSYNCDIR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -845,6 +1000,12 @@ client_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc) args.loc = loc; proc = &conf->fops->proctable[GF_FOP_STATFS]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_STATFS]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -861,12 +1022,16 @@ is_client_rpc_init_command (dict_t *dict, xlator_t *this, gf_boolean_t ret = _gf_false; int dict_ret = -1; - if (!strstr (this->name, "replace-brick")) + if (!strstr (this->name, "replace-brick")) { + gf_log (this->name, GF_LOG_TRACE, "name is !replace-brick"); goto out; - + } dict_ret = dict_get_str (dict, CLIENT_CMD_CONNECT, value); - if (dict_ret) + if (dict_ret) { + gf_log (this->name, GF_LOG_TRACE, "key %s not present", + CLIENT_CMD_CONNECT); goto out; + } ret = _gf_true; @@ -882,12 +1047,17 @@ is_client_rpc_destroy_command (dict_t *dict, xlator_t *this) int dict_ret = -1; char *dummy = NULL; - if (strncmp (this->name, "replace-brick", 13)) + if (strncmp (this->name, "replace-brick", 13)) { + gf_log (this->name, GF_LOG_TRACE, "name is !replace-brick"); goto out; + } dict_ret = dict_get_str (dict, CLIENT_CMD_DISCONNECT, &dummy); - if (dict_ret) + if (dict_ret) { + gf_log (this->name, GF_LOG_TRACE, "key %s not present", + CLIENT_CMD_DISCONNECT); goto out; + } ret = _gf_true; @@ -925,8 +1095,6 @@ client_set_remote_options (char *value, xlator_t *this) host_dup = gf_strdup (host); if (!host_dup) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); goto out; } @@ -939,8 +1107,6 @@ client_set_remote_options (char *value, xlator_t *this) subvol_dup = gf_strdup (subvol); if (!subvol_dup) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); goto out; } @@ -987,6 +1153,7 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, if (is_client_rpc_init_command (dict, this, &value) == _gf_true) { GF_ASSERT (value); + gf_log (this->name, GF_LOG_INFO, "client rpc init command"); ret = client_set_remote_options (value, this); if (ret) ret = client_init_rpc (this); @@ -1000,6 +1167,7 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, } if (is_client_rpc_destroy_command (dict, this) == _gf_true) { + gf_log (this->name, GF_LOG_INFO, "client rpc destroy command"); ret = client_destroy_rpc (this); if (ret) { op_ret = 0; @@ -1021,11 +1189,15 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, args.flags = flags; proc = &conf->fops->proctable[GF_FOP_SETXATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_SETXATTR]); + goto out; + } if (proc->fn) { ret = proc->fn (frame, this, &args); if (ret) { - op_ret = -1; - op_errno = ENOTCONN; need_unwind = 1; } } @@ -1056,6 +1228,12 @@ client_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, args.flags = flags; proc = &conf->fops->proctable[GF_FOP_FSETXATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FSETXATTR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1085,6 +1263,12 @@ client_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, args.name = name; proc = &conf->fops->proctable[GF_FOP_FGETXATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FGETXATTR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1113,6 +1297,12 @@ client_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, args.loc = loc; proc = &conf->fops->proctable[GF_FOP_GETXATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_GETXATTR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1142,6 +1332,12 @@ client_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc, args.dict = dict; proc = &conf->fops->proctable[GF_FOP_XATTROP]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_XATTROP]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1171,6 +1367,12 @@ client_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd, args.dict = dict; proc = &conf->fops->proctable[GF_FOP_FXATTROP]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FXATTROP]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1199,6 +1401,12 @@ client_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc, args.loc = loc; proc = &conf->fops->proctable[GF_FOP_REMOVEXATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_REMOVEXATTR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1227,6 +1435,12 @@ client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, args.flock = lock; proc = &conf->fops->proctable[GF_FOP_LK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_LK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1256,6 +1470,12 @@ client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, args.volume = volume; proc = &conf->fops->proctable[GF_FOP_INODELK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_INODELK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1286,6 +1506,12 @@ client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, args.volume = volume; proc = &conf->fops->proctable[GF_FOP_FINODELK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FINODELK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1317,6 +1543,12 @@ client_entrylk (call_frame_t *frame, xlator_t *this, const char *volume, args.cmd_entrylk = cmd; proc = &conf->fops->proctable[GF_FOP_ENTRYLK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_ENTRYLK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1349,6 +1581,12 @@ client_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume, args.cmd_entrylk = cmd; proc = &conf->fops->proctable[GF_FOP_FENTRYLK]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FENTRYLK]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1377,6 +1615,12 @@ client_rchecksum (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, args.len = len; proc = &conf->fops->proctable[GF_FOP_RCHECKSUM]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_RCHECKSUM]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1404,6 +1648,12 @@ client_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, args.offset = off; proc = &conf->fops->proctable[GF_FOP_READDIR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_READDIR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1432,6 +1682,12 @@ client_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, args.offset = off; proc = &conf->fops->proctable[GF_FOP_READDIRP]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_READDIRP]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1460,6 +1716,12 @@ client_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, args.valid = valid; proc = &conf->fops->proctable[GF_FOP_SETATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_SETATTR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1487,6 +1749,12 @@ client_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, args.valid = valid; proc = &conf->fops->proctable[GF_FOP_FSETATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FSETATTR]); + goto out; + } if (proc->fn) ret = proc->fn (frame, this, &args); out: @@ -1515,6 +1783,12 @@ client_getspec (call_frame_t *frame, xlator_t *this, const char *key, /* For all other xlators, getspec is an fop, hence its in fops table */ proc = &conf->fops->proctable[GF_FOP_GETSPEC]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_GETSPEC]); + goto out; + } if (proc->fn) { /* But at protocol level, this is handshake */ ret = proc->fn (frame, this, &args); @@ -1560,8 +1834,9 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, this = mydata; if (!this || !this->private) { gf_log ("client", GF_LOG_ERROR, - (this != NULL)?"private structure of the xlator this is NULL": - "xlator this is NULL"); + (this != NULL) ? + "private structure of the xlator is NULL": + "xlator is NULL"); goto out; } @@ -1575,18 +1850,18 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, ret = dict_get_str (this->options, "disable-handshake", &handshake); - gf_log (this->name, GF_LOG_TRACE, "got RPC_CLNT_CONNECT"); + gf_log (this->name, GF_LOG_DEBUG, "got RPC_CLNT_CONNECT"); if ((ret < 0) || (strcasecmp (handshake, "on"))) { ret = client_handshake (this, conf->rpc); if (ret) - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "handshake msg returned %d", ret); } else { //conf->rpc->connected = 1; ret = default_notify (this, GF_EVENT_CHILD_UP, NULL); if (ret) - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "default notify failed"); } break; @@ -1635,8 +1910,8 @@ notify (xlator_t *this, int32_t event, void *data, ...) switch (event) { case GF_EVENT_PARENT_UP: { - gf_log (this->name, GF_LOG_DEBUG, - "got GF_EVENT_PARENT_UP, attempting connect " + gf_log (this->name, GF_LOG_INFO, + "parent translators are ready, attempting connect " "on transport"); rpc_clnt_start (conf->rpc); @@ -1657,15 +1932,15 @@ notify (xlator_t *this, int32_t event, void *data, ...) int build_client_config (xlator_t *this, clnt_conf_t *conf) { - int ret = 0; + int ret = -1; if (!conf) - return -1; + goto out; ret = dict_get_int32 (this->options, "frame-timeout", &conf->rpc_conf.rpc_timeout); if (ret >= 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_INFO, "setting frame-timeout to %d", conf->rpc_conf.rpc_timeout); } else { @@ -1677,7 +1952,7 @@ build_client_config (xlator_t *this, clnt_conf_t *conf) ret = dict_get_int32 (this->options, "remote-port", &conf->rpc_conf.remote_port); if (ret >= 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_INFO, "remote-port is %d", conf->rpc_conf.remote_port); } else { gf_log (this->name, GF_LOG_DEBUG, @@ -1687,7 +1962,7 @@ build_client_config (xlator_t *this, clnt_conf_t *conf) ret = dict_get_int32 (this->options, "ping-timeout", &conf->opt.ping_timeout); if (ret >= 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_INFO, "setting ping-timeout to %d", conf->opt.ping_timeout); } else { gf_log (this->name, GF_LOG_DEBUG, @@ -1699,7 +1974,7 @@ build_client_config (xlator_t *this, clnt_conf_t *conf) &conf->opt.remote_subvolume); if (ret) { /* This is valid only if 'cluster/pump' is the parent */ - gf_log (this->name, GF_LOG_NORMAL, + gf_log (this->name, GF_LOG_WARNING, "option 'remote-subvolume' not given"); ret = 1; goto out; @@ -1723,7 +1998,7 @@ mem_acct_init (xlator_t *this) if (ret != 0) { gf_log (this->name, GF_LOG_ERROR, "Memory accounting init" - "failed"); + "failed"); return ret; } @@ -1748,7 +2023,7 @@ client_destroy_rpc (xlator_t *this) goto out; } - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "RPC destory called on already destroyed " "connection"); @@ -1765,26 +2040,33 @@ client_init_rpc (xlator_t *this) conf = this->private; if (conf->rpc) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "client rpc already init'ed"); ret = -1; goto out; } conf->rpc = rpc_clnt_new (this->options, this->ctx, this->name); - if (!conf->rpc) + if (!conf->rpc) { + gf_log (this->name, GF_LOG_ERROR, "failed to initialize RPC"); goto out; + } ret = rpc_clnt_register_notify (conf->rpc, client_rpc_notify, this); - if (ret) + if (ret) { + gf_log (this->name, GF_LOG_ERROR, "failed to register notify"); goto out; + } conf->handshake = &clnt_handshake_prog; conf->dump = &clnt_dump_prog; ret = rpcclnt_cbk_program_register (conf->rpc, &gluster_cbk_prog); - if (ret) + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "failed to register callback program"); goto out; + } ret = 0; @@ -1800,30 +2082,30 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) int timeout_ret=0; int ping_timeout; int frame_timeout; - - + + timeout_ret = dict_get_int32 (options, "frame-timeout", &frame_timeout); if (timeout_ret == 0) { if (frame_timeout < 5 ) { - gf_log (this->name, GF_LOG_WARNING, "Validation" - "'option frame-timeout %d failed , Min value" - " can be 5", frame_timeout); + gf_log (this->name, GF_LOG_WARNING, "validation of " + "'option frame-timeout %d failed, min value" + " can be 5", frame_timeout); *op_errstr = gf_strdup ("Error, Min Value 5"); ret = -1; goto out; } if (frame_timeout > 86400 ) { - gf_log (this->name, GF_LOG_WARNING, "Reconfiguration" - "'option frame-timeout %d failed , Max value" - "can be 86400", frame_timeout ); + gf_log (this->name, GF_LOG_WARNING, "reconfiguration of" + " 'option frame-timeout %d failed , max value " + "can be 86400", frame_timeout ); *op_errstr = gf_strdup ("Error, Max Value 86400"); ret = -1; goto out; } - + gf_log (this->name, GF_LOG_DEBUG, "validation otion frame-timeout to %d", frame_timeout); @@ -1836,8 +2118,8 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) if (ping_timeout < 5 ) { gf_log (this->name, GF_LOG_WARNING, "Reconfiguration" - "'option ping-timeout %d failed , Min value" - " can be 5", ping_timeout); + " 'option ping-timeout %d failed , Min value" + " can be 5", ping_timeout); *op_errstr = gf_strdup ("Error, Min Value 5"); ret = -1; goto out; @@ -1845,40 +2127,37 @@ validate_options (xlator_t *this, dict_t *options, char **op_errstr) if (ping_timeout > 1013 ) { gf_log (this->name, GF_LOG_WARNING, "Reconfiguration" - "'option frame-timeout %d failed , Max value" - "can be 1013,", frame_timeout); + " 'option frame-timeout %d failed , Max value" + " can be 1013,", frame_timeout); *op_errstr = gf_strdup ("Error, Max Value 1013"); ret = -1; goto out; } - + gf_log (this->name, GF_LOG_DEBUG, "Validated " - "'option ping-timeout' to %d", ping_timeout); - + "'option ping-timeout' to %d", ping_timeout); + } ret = 0; out: - return ret; - + return ret; } int reconfigure (xlator_t *this, dict_t *options) { - int ret = 0; - int timeout_ret = 0; - int ping_timeout = 0; - int frame_timeout = 0; - clnt_conf_t *conf = NULL; - char *old_remote_subvol = NULL; - char *new_remote_subvol = NULL; - char *old_remote_host = NULL; - char *new_remote_host = NULL; - int subvol_ret = 0; - - + clnt_conf_t *conf = NULL; + int ret = 0; + int timeout_ret = 0; + int ping_timeout = 0; + int frame_timeout = 0; + int subvol_ret = 0; + char *old_remote_subvol = NULL; + char *new_remote_subvol = NULL; + char *old_remote_host = NULL; + char *new_remote_host = NULL; conf = this->private; @@ -2076,7 +2355,7 @@ client_priv_dump (xlator_t *this) ret = pthread_mutex_trylock(&conf->lock); if (ret) { - gf_log("", GF_LOG_WARNING, "Unable to lock client %s" + gf_log(this->name, GF_LOG_WARNING, "Unable to lock client %s" " errno: %d", this->name, errno); return -1; } diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index f3bc0073e0a..221ba542e4f 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -31,9 +31,10 @@ #include "glusterfs3.h" /* FIXME: Needs to be defined in a common file */ -#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect" +#define CLIENT_CMD_CONNECT "trusted.glusterfs.client-connect" #define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect" -#define CLIENT_DUMP_LOCKS "trusted.glusterfs.clientlk-dump" +#define CLIENT_DUMP_LOCKS "trusted.glusterfs.clientlk-dump" + struct clnt_options { char *remote_subvolume; int ping_timeout; @@ -81,7 +82,7 @@ typedef struct _client_fd_ctx { typedef struct _client_posix_lock { fd_t *fd; /* The fd on which the lk operation was made */ - struct gf_flock user_flock; /* the flock supplied by the user */ + struct gf_flock user_flock; /* the flock supplied by the user */ off_t fl_start; off_t fl_end; short fl_type; @@ -92,19 +93,19 @@ typedef struct _client_posix_lock { } client_posix_lock_t; typedef struct client_local { - loc_t loc; - loc_t loc2; - fd_t *fd; - clnt_fd_ctx_t *fdctx; - uint32_t flags; - uint32_t wbflags; - struct iobref *iobref; + loc_t loc; + loc_t loc2; + fd_t *fd; + clnt_fd_ctx_t *fdctx; + uint32_t flags; + uint32_t wbflags; + struct iobref *iobref; client_posix_lock_t *client_lock; - uint64_t owner; - int32_t cmd; - struct list_head lock_list; - pthread_mutex_t mutex; + uint64_t owner; + int32_t cmd; + struct list_head lock_list; + pthread_mutex_t mutex; } 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 6f7808ebb1b..5c01fb5abe6 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -83,6 +83,8 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame, if (req && sfunc) { ret = sfunc (iov, req); if (ret == -1) { + gf_log_callingfn ("", GF_LOG_WARNING, + "XDR function failed"); goto out; } @@ -93,6 +95,9 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame, ret = rpc_clnt_submit (conf->rpc, prog, procnum, cbk, &iov, count, payload, payloadcnt, new_iobref, frame, NULL, 0, NULL, 0, NULL); + if (ret < 0) { + gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed"); + } if (ret == 0) { pthread_mutex_lock (&conf->rpc->conn.lock); @@ -131,6 +136,9 @@ client3_1_symlink_cbk (struct rpc_req *req, struct iovec *iov, int count, int ret = 0; clnt_local_t *local = NULL; inode_t *inode = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -145,7 +153,7 @@ client3_1_symlink_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_symlink_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -160,6 +168,10 @@ client3_1_symlink_cbk (struct rpc_req *req, struct iovec *iov, int count, out: frame->local = NULL; + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (symlink, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), inode, &stbuf, &preparent, &postparent); @@ -183,6 +195,9 @@ client3_1_mknod_cbk (struct rpc_req *req, struct iovec *iov, int count, int ret = 0; clnt_local_t *local = NULL; inode_t *inode = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -197,7 +212,7 @@ client3_1_mknod_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_mknod_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -212,6 +227,10 @@ client3_1_mknod_cbk (struct rpc_req *req, struct iovec *iov, int count, out: frame->local = NULL; + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (mknod, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), inode, &stbuf, &preparent, &postparent); @@ -234,6 +253,9 @@ client3_1_mkdir_cbk (struct rpc_req *req, struct iovec *iov, int count, int ret = 0; clnt_local_t *local = NULL; inode_t *inode = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -248,7 +270,7 @@ client3_1_mkdir_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_mkdir_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -262,6 +284,10 @@ client3_1_mkdir_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (mkdir, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), inode, &stbuf, &preparent, &postparent); @@ -283,6 +309,9 @@ client3_1_open_cbk (struct rpc_req *req, struct iovec *iov, int count, fd_t *fd = NULL; int ret = 0; gfs3_open_rsp rsp = {0,}; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -298,7 +327,7 @@ client3_1_open_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_open_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -332,6 +361,10 @@ client3_1_open_cbk (struct rpc_req *req, struct iovec *iov, int count, out: frame->local = NULL; + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (open, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), fd); @@ -349,6 +382,9 @@ client3_1_stat_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; struct iatt iatt = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -359,7 +395,7 @@ client3_1_stat_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_stat_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -370,6 +406,10 @@ client3_1_stat_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (stat, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &iatt); @@ -384,6 +424,9 @@ client3_1_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; struct iatt iatt = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -394,7 +437,7 @@ client3_1_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_readlink_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -405,6 +448,10 @@ client3_1_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (readlink, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), rsp.path, &iatt); @@ -425,6 +472,9 @@ client3_1_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt preparent = {0,}; struct iatt postparent = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -435,7 +485,7 @@ client3_1_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_unlink_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -447,6 +497,10 @@ client3_1_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (unlink, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &preparent, &postparent); @@ -463,6 +517,9 @@ client3_1_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt preparent = {0,}; struct iatt postparent = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -473,7 +530,7 @@ client3_1_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_rmdir_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -485,6 +542,10 @@ client3_1_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (rmdir, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &preparent, &postparent); @@ -502,6 +563,9 @@ client3_1_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prestat = {0,}; struct iatt poststat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -512,7 +576,7 @@ client3_1_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_truncate_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -524,6 +588,10 @@ client3_1_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (truncate, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &prestat, &poststat); @@ -540,6 +608,9 @@ client3_1_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; struct statvfs statfs = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -550,7 +621,7 @@ client3_1_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_statfs_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -561,6 +632,10 @@ client3_1_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (statfs, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &statfs); @@ -577,6 +652,9 @@ client3_1_writev_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prestat = {0,}; struct iatt poststat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -588,7 +666,7 @@ client3_1_writev_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_truncate_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -600,6 +678,10 @@ client3_1_writev_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (writev, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &prestat, &poststat); @@ -628,7 +710,7 @@ client3_1_flush_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -636,10 +718,10 @@ client3_1_flush_cbk (struct rpc_req *req, struct iovec *iov, int count, if (rsp.op_ret >= 0) { /* Delete all saved locks of the owner issuing flush */ + ret = delete_granted_locks_owner (local->fd, local->owner); gf_log (this->name, GF_LOG_DEBUG, - "Attempting to delete locks of owner=%llu", - (long long unsigned) local->owner); - delete_granted_locks_owner (local->fd, local->owner); + "deleting locks of owner (%llu) returned %d", + (long long unsigned) local->owner, ret); } frame->local = NULL; @@ -647,6 +729,10 @@ client3_1_flush_cbk (struct rpc_req *req, struct iovec *iov, int count, client_local_wipe (local); out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (flush, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -662,6 +748,9 @@ client3_1_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prestat = {0,}; struct iatt poststat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -673,7 +762,7 @@ client3_1_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_truncate_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -685,6 +774,10 @@ client3_1_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fsync, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &prestat, &poststat); @@ -699,6 +792,9 @@ client3_1_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -710,13 +806,17 @@ client3_1_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (setxattr, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -736,6 +836,9 @@ client3_1_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, gfs3_getxattr_rsp rsp = {0,}; int ret = 0; clnt_local_t *local = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -749,7 +852,7 @@ client3_1_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_getxattr_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); op_ret = -1; op_errno = EINVAL; goto out; @@ -770,7 +873,7 @@ client3_1_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = dict_unserialize (buf, dict_len, &dict); if (ret < 0) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to unserialize xattr dict"); op_errno = EINVAL; goto out; @@ -782,6 +885,10 @@ 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_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, dict); if (rsp.dict.dict_val) { @@ -815,6 +922,9 @@ client3_1_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, int op_ret = 0; int op_errno = EINVAL; clnt_local_t *local = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -827,7 +937,7 @@ client3_1_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_fgetxattr_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); op_ret = -1; op_errno = EINVAL; goto out; @@ -847,7 +957,7 @@ client3_1_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = dict_unserialize (buf, dict_len, &dict); if (ret < 0) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to unserialize xattr dict"); op_errno = EINVAL; goto out; @@ -858,6 +968,10 @@ client3_1_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, op_ret = 0; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fgetxattr, frame, op_ret, op_errno, dict); if (rsp.dict.dict_val) { /* don't use GF_FREE, this memory was allocated by libc @@ -885,6 +999,9 @@ client3_1_removexattr_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -896,13 +1013,17 @@ client3_1_removexattr_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (removexattr, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -916,6 +1037,9 @@ client3_1_fsyncdir_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -926,13 +1050,17 @@ client3_1_fsyncdir_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fsyncdir, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -946,6 +1074,9 @@ client3_1_access_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -956,13 +1087,17 @@ client3_1_access_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (access, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -979,6 +1114,9 @@ client3_1_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prestat = {0,}; struct iatt poststat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -989,7 +1127,7 @@ client3_1_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_ftruncate_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1001,6 +1139,10 @@ client3_1_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (ftruncate, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &prestat, &poststat); @@ -1016,6 +1158,9 @@ client3_1_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; struct iatt stat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1026,7 +1171,7 @@ client3_1_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_fstat_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1037,6 +1182,10 @@ client3_1_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fstat, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &stat); @@ -1051,6 +1200,9 @@ client3_1_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1061,13 +1213,17 @@ client3_1_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (inodelk, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -1081,6 +1237,9 @@ client3_1_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1091,13 +1250,17 @@ client3_1_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (finodelk, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -1111,6 +1274,9 @@ client3_1_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1121,7 +1287,7 @@ client3_1_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1129,6 +1295,10 @@ client3_1_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (entrylk, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -1142,6 +1312,9 @@ client3_1_fentrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1152,13 +1325,17 @@ client3_1_fentrylk_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fentrylk, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -1178,6 +1355,9 @@ client3_1_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, int dict_len = 0; int op_errno = EINVAL; clnt_local_t *local = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1190,7 +1370,7 @@ client3_1_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_xattrop_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); op_ret = -1; op_errno = EINVAL; goto out; @@ -1210,7 +1390,7 @@ client3_1_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, GF_VALIDATE_OR_GOTO (frame->this->name, buf, out); op_ret = dict_unserialize (buf, dict_len, &dict); if (op_ret < 0) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to unserialize xattr dict"); op_errno = EINVAL; goto out; @@ -1223,6 +1403,10 @@ client3_1_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (xattrop, frame, op_ret, gf_error_to_errno (op_errno), dict); @@ -1257,6 +1441,9 @@ client3_1_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, int dict_len = 0; int op_errno = 0; clnt_local_t *local = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1272,7 +1459,7 @@ client3_1_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, if (ret < 0) { op_ret = -1; op_errno = EINVAL; - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); goto out; } op_errno = rsp.op_errno; @@ -1289,7 +1476,7 @@ client3_1_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, GF_VALIDATE_OR_GOTO (frame->this->name, buf, out); op_ret = dict_unserialize (buf, dict_len, &dict); if (op_ret < 0) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "failed to unserialize xattr dict"); op_errno = EINVAL; goto out; @@ -1302,6 +1489,10 @@ client3_1_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count, out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fxattrop, frame, op_ret, gf_error_to_errno (op_errno), dict); @@ -1329,6 +1520,9 @@ client3_1_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gf_common_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1339,13 +1533,17 @@ client3_1_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_common_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fsetxattr, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno)); @@ -1361,6 +1559,9 @@ client3_1_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prestat = {0,}; struct iatt poststat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1371,7 +1572,7 @@ client3_1_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count, } ret = xdr_to_fsetattr_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1383,6 +1584,10 @@ client3_1_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (fsetattr, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &prestat, &poststat); @@ -1400,6 +1605,9 @@ client3_1_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prestat = {0,}; struct iatt poststat = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1411,7 +1619,7 @@ client3_1_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_setattr_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1423,6 +1631,10 @@ client3_1_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (setattr, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &prestat, &poststat); @@ -1445,6 +1657,9 @@ client3_1_create_cbk (struct rpc_req *req, struct iovec *iov, int count, clnt_conf_t *conf = NULL; clnt_fd_ctx_t *fdctx = NULL; gfs3_create_rsp rsp = {0,}; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; frame->local = NULL; @@ -1460,7 +1675,7 @@ client3_1_create_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_create_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1498,6 +1713,10 @@ client3_1_create_cbk (struct rpc_req *req, struct iovec *iov, int count, out: frame->local = NULL; + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (create, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), fd, inode, &stbuf, &preparent, &postparent); @@ -1514,6 +1733,9 @@ client3_1_rchecksum_cbk (struct rpc_req *req, struct iovec *iov, int count, call_frame_t *frame = NULL; gfs3_rchecksum_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1525,13 +1747,17 @@ client3_1_rchecksum_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_rchecksum_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (rchecksum, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), rsp.weak_checksum, @@ -1555,6 +1781,9 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count, struct gf_flock lock = {0,}; gfs3_lk_rsp rsp = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1567,7 +1796,7 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_lk_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1595,6 +1824,10 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count, client_local_wipe (local); out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (lk, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &lock); @@ -1610,6 +1843,9 @@ client3_1_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count, int32_t ret = 0; clnt_local_t *local = NULL; gf_dirent_t entries; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1623,7 +1859,7 @@ client3_1_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_readdir_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1635,6 +1871,10 @@ client3_1_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (readdir, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &entries); @@ -1659,6 +1899,9 @@ client3_1_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count, int32_t ret = 0; clnt_local_t *local = NULL; gf_dirent_t entries; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1672,7 +1915,7 @@ client3_1_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_readdirp_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1684,6 +1927,10 @@ client3_1_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (readdirp, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &entries); @@ -1711,6 +1958,9 @@ client3_1_rename_cbk (struct rpc_req *req, struct iovec *iov, int count, struct iatt prenewparent = {0,}; struct iatt postnewparent = {0,}; int ret = 0; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1722,7 +1972,7 @@ client3_1_rename_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_rename_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1739,6 +1989,10 @@ client3_1_rename_cbk (struct rpc_req *req, struct iovec *iov, int count, } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (rename, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), &stbuf, &preoldparent, &postoldparent, @@ -1759,6 +2013,9 @@ client3_1_link_cbk (struct rpc_req *req, struct iovec *iov, int count, int ret = 0; clnt_local_t *local = NULL; inode_t *inode = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; @@ -1774,7 +2031,7 @@ client3_1_link_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_link_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1789,6 +2046,10 @@ client3_1_link_cbk (struct rpc_req *req, struct iovec *iov, int count, out: frame->local = NULL; + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (link, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), inode, &stbuf, &preparent, &postparent); @@ -1809,6 +2070,9 @@ client3_1_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count, fd_t *fd = NULL; int ret = 0; gfs3_opendir_rsp rsp = {0,}; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1825,7 +2089,7 @@ client3_1_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_opendir_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -1858,6 +2122,10 @@ client3_1_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count, out: frame->local = NULL; + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (opendir, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), fd); @@ -1881,6 +2149,9 @@ client3_1_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, dict_t *xattr = NULL; inode_t *inode = NULL; char *buf = NULL; + xlator_t *this = NULL; + + this = THIS; frame = myframe; local = frame->local; @@ -1895,7 +2166,7 @@ client3_1_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_lookup_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; op_errno = EINVAL; goto out; @@ -1919,7 +2190,7 @@ client3_1_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = dict_unserialize (buf, rsp.dict.dict_len, &xattr); if (ret < 0) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "%s (%"PRId64"): failed to " "unserialize dictionary", local->loc.path, inode->ino); @@ -1933,7 +2204,7 @@ client3_1_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, if ((!uuid_is_null (inode->gfid)) && (uuid_compare (stbuf.ia_gfid, inode->gfid) != 0)) { - gf_log (frame->this->name, GF_LOG_DEBUG, + gf_log (frame->this->name, GF_LOG_WARNING, "gfid changed for %s", local->loc.path); rsp.op_ret = -1; rsp.op_errno = ESTALE; @@ -1945,6 +2216,16 @@ client3_1_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count, out: rsp.op_errno = op_errno; frame->local = NULL; + if (rsp.op_ret == -1) { + /* any error other than ENOENT or for revalidate for ENOENT too */ + if ((gf_error_to_errno (rsp.op_errno) != ENOENT) || + !uuid_is_null (local->loc.inode->gfid)) + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + else + gf_log (this->name, GF_LOG_TRACE, "not found on remote node"); + + } STACK_UNWIND_STRICT (lookup, frame, rsp.op_ret, rsp.op_errno, inode, &stbuf, xattr, &postparent); @@ -1978,6 +2259,9 @@ client3_1_readv_cbk (struct rpc_req *req, struct iovec *iov, int count, gfs3_read_rsp rsp = {0,}; int ret = 0, rspcount = 0; clnt_local_t *local = NULL; + xlator_t *this = NULL; + + this = THIS; memset (vector, 0, sizeof (vector)); @@ -1993,7 +2277,7 @@ client3_1_readv_cbk (struct rpc_req *req, struct iovec *iov, int count, ret = xdr_to_readv_rsp (*iov, &rsp); if (ret < 0) { - gf_log ("", GF_LOG_ERROR, "error"); + gf_log (this->name, GF_LOG_ERROR, "error"); rsp.op_ret = -1; rsp.op_errno = EINVAL; goto out; @@ -2009,6 +2293,10 @@ client3_1_readv_cbk (struct rpc_req *req, struct iovec *iov, int count, rspcount = 1; } out: + if (rsp.op_ret == -1) { + gf_log (this->name, GF_LOG_INFO, "remote operation failed: %s", + strerror (gf_error_to_errno (rsp.op_errno))); + } STACK_UNWIND_STRICT (readv, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), vector, rspcount, &stat, iobref); @@ -2050,14 +2338,17 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx) if (!fdctx) goto out; - if (fdctx->remote_fd == -1) + if (fdctx->remote_fd == -1) { + gf_log (this->name, GF_LOG_DEBUG, "not a valid fd"); goto out; + } fr = create_frame (this, this->ctx->pool); if (fdctx->is_dir) { gfs3_releasedir_req req = {{0,},}; req.fd = fdctx->remote_fd; + gf_log (this->name, GF_LOG_INFO, "sending releasedir on fd"); ret = client_submit_request (this, &req, fr, &clnt3_1_fop_prog, GFS3_OP_RELEASEDIR, client3_1_releasedir_cbk, @@ -2066,6 +2357,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx) } else { gfs3_release_req req = {{0,},}; req.fd = fdctx->remote_fd; + gf_log (this->name, GF_LOG_INFO, "sending release on fd"); ret = client_submit_request (this, &req, fr, &clnt3_1_fop_prog, GFS3_OP_RELEASE, client3_1_release_cbk, NULL, @@ -2244,15 +2536,11 @@ client3_1_lookup (call_frame_t *frame, xlator_t *this, if (content != NULL) { rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -2272,7 +2560,7 @@ client3_1_lookup (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized length of dict"); op_errno = EINVAL; goto unwind; @@ -2304,6 +2592,8 @@ client3_1_lookup (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); + if (frame) frame->local = NULL; @@ -2360,6 +2650,8 @@ client3_1_stat (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop %s", + strerror (op_errno)); STACK_UNWIND_STRICT (stat, frame, -1, op_errno, NULL); return 0; } @@ -2400,6 +2692,7 @@ client3_1_truncate (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop %s", strerror (op_errno)); STACK_UNWIND_STRICT (truncate, frame, -1, op_errno, NULL, NULL); return 0; } @@ -2430,7 +2723,7 @@ client3_1_ftruncate (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -2438,7 +2731,7 @@ client3_1_ftruncate (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -2458,6 +2751,7 @@ client3_1_ftruncate (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (ftruncate, frame, -1, op_errno, NULL, NULL); return 0; } @@ -2500,6 +2794,7 @@ client3_1_access (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (access, frame, -1, op_errno); return 0; } @@ -2539,6 +2834,7 @@ client3_1_readlink (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (readlink, frame, -1, op_errno, NULL, NULL); return 0; } @@ -2580,6 +2876,7 @@ client3_1_unlink (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (unlink, frame, -1, op_errno, NULL, NULL); return 0; } @@ -2620,6 +2917,7 @@ client3_1_rmdir (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (rmdir, frame, -1, op_errno, NULL, NULL); return 0; } @@ -2663,7 +2961,7 @@ client3_1_symlink (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized length of dict"); op_errno = EINVAL; goto unwind; @@ -2686,6 +2984,7 @@ client3_1_symlink (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (frame) frame->local = NULL; @@ -2739,6 +3038,7 @@ client3_1_rename (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL); return 0; } @@ -2791,6 +3091,7 @@ client3_1_link (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (link, frame, -1, op_errno, NULL, NULL, NULL, NULL); return 0; } @@ -2836,7 +3137,7 @@ client3_1_mknod (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized length of dict"); op_errno = EINVAL; goto unwind; @@ -2859,6 +3160,7 @@ client3_1_mknod (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (frame) frame->local = NULL; @@ -2912,7 +3214,7 @@ client3_1_mkdir (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized length of dict"); op_errno = EINVAL; goto unwind; @@ -2935,6 +3237,7 @@ client3_1_mkdir (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (frame) frame->local = NULL; @@ -2990,7 +3293,7 @@ client3_1_create (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized length of dict"); op_errno = EINVAL; goto unwind; @@ -3013,6 +3316,7 @@ client3_1_create (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (frame) frame->local = NULL; @@ -3074,6 +3378,7 @@ client3_1_open (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (frame) frame->local = NULL; @@ -3114,7 +3419,7 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3122,7 +3427,7 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3134,14 +3439,12 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { - gf_log (this->name, GF_LOG_ERROR, "out of memory"); op_errno = ENOMEM; goto unwind; } rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, "out of memory"); op_errno = ENOMEM; goto unwind; } @@ -3154,7 +3457,7 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, rsp_iobuf = NULL; if (args->size > rsp_vec.iov_len) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "read-size (%lu) is bigger than iobuf size (%lu)", (unsigned long)args->size, (unsigned long)rsp_vec.iov_len); @@ -3164,8 +3467,6 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (local == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); op_errno = ENOMEM; goto unwind; } @@ -3185,6 +3486,7 @@ client3_1_readv (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (rsp_iobuf) { iobuf_unref (rsp_iobuf); } @@ -3221,7 +3523,7 @@ client3_1_writev (call_frame_t *frame, xlator_t *this, void *data) pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3229,7 +3531,7 @@ client3_1_writev (call_frame_t *frame, xlator_t *this, void *data) } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3248,6 +3550,7 @@ client3_1_writev (call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (writev, frame, -1, op_errno, NULL, NULL); return 0; } @@ -3278,7 +3581,7 @@ client3_1_flush (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3286,7 +3589,7 @@ client3_1_flush (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3296,8 +3599,6 @@ client3_1_flush (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of Memory"); STACK_UNWIND (frame, -1, ENOMEM); return 0; @@ -3319,6 +3620,7 @@ client3_1_flush (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (flush, frame, -1, op_errno); return 0; } @@ -3349,7 +3651,7 @@ client3_1_fsync (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3357,7 +3659,7 @@ client3_1_fsync (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3376,6 +3678,7 @@ client3_1_fsync (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (fsync, frame, -1, op_errno, NULL, NULL); return 0; } @@ -3406,7 +3709,7 @@ client3_1_fstat (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3414,7 +3717,7 @@ client3_1_fstat (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3432,6 +3735,7 @@ client3_1_fstat (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (fstat, frame, -1, op_errno, NULL); return 0; } @@ -3481,6 +3785,7 @@ client3_1_opendir (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); if (frame) frame->local = NULL; STACK_UNWIND_STRICT (opendir, frame, -1, op_errno, NULL); @@ -3514,7 +3819,7 @@ client3_1_fsyncdir (call_frame_t *frame, xlator_t *this, void *data) pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3522,7 +3827,7 @@ client3_1_fsyncdir (call_frame_t *frame, xlator_t *this, void *data) } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3543,6 +3848,7 @@ client3_1_fsyncdir (call_frame_t *frame, xlator_t *this, void *data) } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (fsyncdir, frame, -1, op_errno); return 0; } @@ -3586,6 +3892,7 @@ client3_1_statfs (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (statfs, frame, -1, op_errno, NULL); return 0; } @@ -3617,7 +3924,7 @@ client3_1_setxattr (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized dict"); op_errno = EINVAL; goto unwind; @@ -3643,6 +3950,7 @@ client3_1_setxattr (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (setxattr, frame, -1, op_errno); if (req.dict.dict_val) { GF_FREE (req.dict.dict_val); @@ -3677,7 +3985,7 @@ client3_1_fsetxattr (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3685,7 +3993,7 @@ client3_1_fsetxattr (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3700,7 +4008,7 @@ client3_1_fsetxattr (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized dict"); goto unwind; } @@ -3722,6 +4030,7 @@ client3_1_fsetxattr (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (fsetxattr, frame, -1, op_errno); if (req.dict.dict_val) { GF_FREE (req.dict.dict_val); @@ -3762,7 +4071,7 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -3770,7 +4079,7 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -3779,8 +4088,6 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_errno = ENOMEM; goto unwind; } @@ -3788,8 +4095,6 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); op_errno = ENOMEM; goto unwind; } @@ -3797,8 +4102,6 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -3832,6 +4135,7 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); local = frame->local; frame->local = NULL; @@ -3886,8 +4190,6 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_ret = -1; op_errno = ENOMEM; goto unwind; @@ -3896,8 +4198,6 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this, rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); op_ret = -1; op_errno = ENOMEM; goto unwind; @@ -3907,8 +4207,6 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this, if (rsp_iobuf == NULL) { op_ret = -1; op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -3940,7 +4238,7 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this, args->loc->inode, dict); if (ret) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "Client dump locks failed"); op_ret = -1; op_errno = EINVAL; @@ -3966,6 +4264,7 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); local = frame->local; frame->local = NULL; client_local_wipe (local); @@ -4013,8 +4312,6 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4022,8 +4319,6 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this, rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4031,8 +4326,6 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this, rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -4052,7 +4345,7 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized dict"); op_errno = EINVAL; goto unwind; @@ -4079,6 +4372,7 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this, } return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); local = frame->local; frame->local = NULL; @@ -4134,7 +4428,7 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4142,7 +4436,7 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4155,8 +4449,6 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4164,8 +4456,6 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4173,8 +4463,6 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -4193,7 +4481,7 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, &req.dict.dict_val, &dict_len); if (ret < 0) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "failed to get serialized dict"); goto unwind; } @@ -4216,6 +4504,7 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); local = frame->local; frame->local = NULL; @@ -4276,6 +4565,7 @@ client3_1_removexattr (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (removexattr, frame, -1, op_errno); return 0; } @@ -4302,8 +4592,6 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, conf = this->private; local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4315,7 +4603,7 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4323,7 +4611,7 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4332,8 +4620,9 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, ret = client_cmd_to_gf_cmd (args->cmd, &gf_cmd); if (ret) { op_errno = EINVAL; - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "Unknown cmd (%d)!", gf_cmd); + goto unwind; } switch (args->flock->l_type) { @@ -4368,6 +4657,7 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (lk, frame, -1, op_errno, NULL); return 0; } @@ -4400,7 +4690,7 @@ client3_1_inodelk (call_frame_t *frame, xlator_t *this, else if (args->cmd == F_SETLKW || args->cmd == F_SETLKW64) gf_cmd = GF_LK_SETLKW; else { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "Unknown cmd (%d)!", gf_cmd); op_errno = EINVAL; goto unwind; @@ -4438,6 +4728,7 @@ client3_1_inodelk (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (inodelk, frame, -1, op_errno); return 0; } @@ -4470,7 +4761,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4478,7 +4769,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4491,7 +4782,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this, else if (args->cmd == F_SETLKW || args->cmd == F_SETLKW64) gf_cmd = GF_LK_SETLKW; else { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "Unknown cmd (%d)!", gf_cmd); goto unwind; } @@ -4526,6 +4817,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (finodelk, frame, -1, op_errno); return 0; } @@ -4574,6 +4866,7 @@ client3_1_entrylk (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (entrylk, frame, -1, op_errno); return 0; } @@ -4604,7 +4897,7 @@ client3_1_fentrylk (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4612,7 +4905,7 @@ client3_1_fentrylk (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4640,6 +4933,7 @@ client3_1_fentrylk (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (fentrylk, frame, -1, op_errno); return 0; } @@ -4669,7 +4963,7 @@ client3_1_rchecksum (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4677,7 +4971,7 @@ client3_1_rchecksum (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4699,6 +4993,7 @@ client3_1_rchecksum (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (rchecksum, frame, -1, op_errno, 0, NULL); return 0; } @@ -4737,7 +5032,7 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4745,7 +5040,7 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4759,8 +5054,6 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4768,15 +5061,11 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this, rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -4810,6 +5099,7 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); local = frame->local; frame->local = NULL; client_local_wipe (local); @@ -4859,7 +5149,7 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -4867,7 +5157,7 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -4882,8 +5172,6 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); if (!local) { - gf_log (this->name, GF_LOG_ERROR, - "Out of memory"); op_errno = ENOMEM; goto unwind; } @@ -4891,15 +5179,11 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, rsp_iobref = iobref_new (); if (rsp_iobref == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } rsp_iobuf = iobuf_get (this->ctx->iobuf_pool); if (rsp_iobuf == NULL) { - gf_log (this->name, GF_LOG_ERROR, - "out of memory"); goto unwind; } @@ -4931,6 +5215,7 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); local = frame->local; frame->local = NULL; client_local_wipe (local); @@ -4985,6 +5270,7 @@ client3_1_setattr (call_frame_t *frame, xlator_t *this, return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (setattr, frame, -1, op_errno, NULL, NULL); return 0; } @@ -5012,7 +5298,7 @@ client3_1_fsetattr (call_frame_t *frame, xlator_t *this, void *data) pthread_mutex_unlock (&conf->lock); if (fdctx == NULL) { - gf_log (this->name, GF_LOG_DEBUG, + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; @@ -5020,7 +5306,7 @@ client3_1_fsetattr (call_frame_t *frame, xlator_t *this, void *data) } if (fdctx->remote_fd == -1) { - gf_log (this->name, GF_LOG_DEBUG, "(%"PRId64"): failed to get" + gf_log (this->name, GF_LOG_WARNING, "(%"PRId64"): failed to get" " fd ctx. EBADFD", args->fd->inode->ino); op_errno = EBADFD; goto unwind; @@ -5042,6 +5328,7 @@ client3_1_fsetattr (call_frame_t *frame, xlator_t *this, void *data) return 0; unwind: + gf_log (this->name, GF_LOG_WARNING, "failed to send the fop: %s", strerror (op_errno)); STACK_UNWIND_STRICT (fsetattr, frame, -1, op_errno, NULL, NULL); return 0; } -- cgit