summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/server/src')
-rw-r--r--xlators/protocol/server/src/Makefile.am4
-rw-r--r--xlators/protocol/server/src/server-common.c2
-rw-r--r--xlators/protocol/server/src/server-helpers.c104
-rw-r--r--xlators/protocol/server/src/server-messages.h179
-rw-r--r--xlators/protocol/server/src/server-rpc-fops_v2.c736
-rw-r--r--xlators/protocol/server/src/server.c194
6 files changed, 599 insertions, 620 deletions
diff --git a/xlators/protocol/server/src/Makefile.am b/xlators/protocol/server/src/Makefile.am
index 01edbd3..5e875c8 100644
--- a/xlators/protocol/server/src/Makefile.am
+++ b/xlators/protocol/server/src/Makefile.am
@@ -4,11 +4,11 @@ endif
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/protocol
-server_la_LDFLAGS = $(LIB_DL) -module $(GF_XLATOR_DEFAULT_LDFLAGS)
+server_la_LDFLAGS = -module $(GF_XLATOR_DEFAULT_LDFLAGS)
server_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
$(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \
- $(top_builddir)/rpc/xdr/src/libgfxdr.la
+ $(top_builddir)/rpc/xdr/src/libgfxdr.la $(LIB_DL)
server_la_SOURCES = server.c server-resolve.c server-helpers.c \
server-rpc-fops.c server-handshake.c authenticate.c \
diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c
index 4bb8404..cd79cf4 100644
--- a/xlators/protocol/server/src/server-common.c
+++ b/xlators/protocol/server/src/server-common.c
@@ -828,7 +828,7 @@ server4_post_lease(gfx_lease_rsp *rsp, struct gf_lease *lease)
void
server4_post_link(server_state_t *state, gfx_common_3iatt_rsp *rsp,
inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+ struct iatt *postparent)
{
inode_t *link_inode = NULL;
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 510dd09..6e64491 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -52,14 +52,14 @@ gid_resolve(server_conf_t *conf, call_stack_t *root)
ret = getpwuid_r(root->uid, &mypw, mystrs, sizeof(mystrs), &result);
if (ret != 0) {
- gf_msg("gid-cache", GF_LOG_ERROR, errno, PS_MSG_GET_UID_FAILED,
- "getpwuid_r(%u) failed", root->uid);
+ gf_smsg("gid-cache", GF_LOG_ERROR, errno, PS_MSG_GET_UID_FAILED,
+ "uid=%u", root->uid, NULL);
return -1;
}
if (!result) {
- gf_msg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_UID_NOT_FOUND,
- "getpwuid_r(%u) found nothing", root->uid);
+ gf_smsg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_UID_NOT_FOUND, "uid=%u",
+ root->uid, NULL);
return -1;
}
@@ -67,9 +67,9 @@ gid_resolve(server_conf_t *conf, call_stack_t *root)
ngroups = gf_getgrouplist(result->pw_name, root->gid, &mygroups);
if (ngroups == -1) {
- gf_msg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_MAPPING_ERROR,
- "could not map %s to group list (%d gids)", result->pw_name,
- root->ngrps);
+ gf_smsg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_MAPPING_ERROR,
+ "pw_name=%s", result->pw_name, "root->ngtps=%d", root->ngrps,
+ NULL);
return -1;
}
root->ngrps = (uint16_t)ngroups;
@@ -313,13 +313,12 @@ do_fd_cleanup(xlator_t *this, client_t *client, fdentry_t *fdentries,
ret = inode_path(fd->inode, NULL, &path);
if (ret > 0) {
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
- "fd cleanup on %s", path);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
+ "path=%s", path, NULL);
GF_FREE(path);
} else {
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
- "fd cleanup on inode with gfid %s",
- uuid_utoa(fd->inode->gfid));
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
+ "inode-gfid=%s", uuid_utoa(fd->inode->gfid), NULL);
}
tmp_frame->local = fd;
@@ -363,9 +362,7 @@ server_connection_cleanup(xlator_t *this, client_t *client, int32_t flags,
serv_ctx = server_ctx_get(client, client->this);
if (serv_ctx == NULL) {
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
- "server_ctx_get() "
- "failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED, NULL);
goto out;
}
@@ -413,8 +410,7 @@ server_connection_cleanup(xlator_t *this, client_t *client, int32_t flags,
fd_count);
ret = do_fd_cleanup(this, client, fdentries, fd_count, detach);
} else
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_FDENTRY_NULL,
- "no fdentries to clean");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_FDENTRY_NULL, NULL);
if (cd_ret || ret)
ret = -1;
@@ -598,9 +594,8 @@ server_build_config(xlator_t *this, server_conf_t *conf)
if (data) {
ret = gf_string2boolean(data->data, &conf->verify_volfile);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "wrong value for '"
- "verify-volfile-checksum', Neglecting option");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_WRONG_VALUE,
+ NULL);
}
}
@@ -608,9 +603,8 @@ server_build_config(xlator_t *this, server_conf_t *conf)
if (data) {
ret = gf_string2boolean(data->data, &conf->trace);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "'trace' takes on only "
- "boolean values. Neglecting option");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
+ NULL);
}
}
@@ -631,18 +625,16 @@ server_build_config(xlator_t *this, server_conf_t *conf)
or directory specified is non standard */
ret = sys_stat(data->data, &buf);
if ((ret != 0) || !S_ISDIR(buf.st_mode)) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_DIR_NOT_FOUND,
- "Directory '%s' doesn't "
- "exist, exiting.",
- data->data);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_DIR_NOT_FOUND,
+ "data=%s", data->data, NULL);
ret = -1;
goto out;
}
/* Make sure that conf-dir doesn't contain ".." in path */
if ((gf_strstr(data->data, "/", "..")) == -1) {
ret = -1;
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_CONF_DIR_INVALID,
- "%s: invalid conf_dir", data->data);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_CONF_DIR_INVALID,
+ "data=%s", data->data, NULL);
goto out;
}
@@ -824,8 +816,9 @@ server_print_reply(call_frame_t *frame, int op_ret, int op_errno)
if (state->fd)
snprintf(fdstr, 32, " fd=%p", state->fd);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_MSG,
- "%s%s => (%d, %d)%s", op, caller, op_ret, op_errno, fdstr);
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_MSG, "op=%s", op,
+ "caller=%s", caller, "op_ret=%d", op_ret, "op_errno=%d", op_errno,
+ "fdstr=%s", fdstr, NULL);
out:
return;
}
@@ -885,9 +878,10 @@ server_print_request(call_frame_t *frame)
break;
}
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_MSG, "%s%s%s%s%s%s%s", op,
- caller, resolve_vars, loc_vars, resolve2_vars, loc2_vars,
- other_vars);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_MSG, "op=%s", op,
+ "caller=%s", caller, "resolve_vars=%s", resolve_vars, "loc_vars=%s",
+ loc_vars, "resolve2_vars=%s", resolve2_vars, "loc2_vars=%s",
+ loc2_vars, "other_vars=%s", other_vars, NULL);
out:
return;
}
@@ -923,8 +917,8 @@ serialize_rsp_direntp(gf_dirent_t *entries, gfs3_readdirp_rsp *rsp)
(char **)&trav->dict.dict_val,
&trav->dict.dict_len);
if (ret != 0) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_DICT_SERIALIZE_FAIL,
- "failed to serialize reply dict");
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_DICT_SERIALIZE_FAIL,
+ NULL);
errno = -ret;
trav->dict.dict_len = 0;
goto out;
@@ -1155,8 +1149,8 @@ common_rsp_locklist(lock_migration_info_t *locklist, gfs3_locklist **reply)
break;
default:
- gf_msg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_LOCK_ERROR,
- "Unknown lock type: %" PRId32 "!", tmp->flock.l_type);
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_LOCK_ERROR,
+ "lock_type=%" PRId32, tmp->flock.l_type, NULL);
break;
}
@@ -1255,8 +1249,9 @@ gf_server_check_getxattr_cmd(call_frame_t *frame, const char *key)
{
list_for_each_entry(xprt, &conf->xprt_list, list)
{
- gf_msg("mount-point-list", GF_LOG_INFO, 0, PS_MSG_MOUNT_PT_FAIL,
- "%s", xprt->peerinfo.identifier);
+ gf_smsg("mount-point-list", GF_LOG_INFO, 0,
+ PS_MSG_MOUNT_PT_FAIL, "identifier=%s",
+ xprt->peerinfo.identifier, NULL);
}
}
pthread_mutex_unlock(&conf->mutex);
@@ -1286,9 +1281,8 @@ gf_server_check_setxattr_cmd(call_frame_t *frame, dict_t *dict)
total_read += xprt->total_bytes_read;
total_write += xprt->total_bytes_write;
}
- gf_msg("stats", GF_LOG_INFO, 0, PS_MSG_RW_STAT,
- "total-read %" PRIu64 ", total-write %" PRIu64, total_read,
- total_write);
+ gf_smsg("stats", GF_LOG_INFO, 0, PS_MSG_RW_STAT, "total-read=%" PRIu64,
+ total_read, "total-write=%" PRIu64, total_write, NULL);
}
return 0;
@@ -1364,15 +1358,15 @@ auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
ret = dict_get_str(input_params, "password", &password);
if (ret) {
- gf_msg("auth/login", GF_LOG_WARNING, 0, PS_MSG_DICT_GET_FAILED,
- "password not found, returning DONT-CARE");
+ gf_smsg("auth/login", GF_LOG_WARNING, 0, PS_MSG_PASSWORD_NOT_FOUND,
+ NULL);
goto out;
}
ret = dict_get_str(input_params, "remote-subvolume", &brick_name);
if (ret) {
- gf_msg("auth/login", GF_LOG_ERROR, 0, PS_MSG_DICT_GET_FAILED,
- "remote-subvolume not specified");
+ gf_smsg("auth/login", GF_LOG_ERROR, 0,
+ PS_MSG_REMOTE_SUBVOL_NOT_SPECIFIED, NULL);
ret = -1;
goto out;
}
@@ -1404,10 +1398,8 @@ auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
GF_FREE(searchstr);
if (!passwd_data) {
- gf_msg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
- "wrong "
- "username/password "
- "combination");
+ gf_smsg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
+ NULL);
ret = -1;
goto out;
}
@@ -1417,10 +1409,8 @@ auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
client->auth.username = gf_strdup(username);
client->auth.passwd = gf_strdup(password);
} else {
- gf_msg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
- "wrong "
- "password for user %s",
- username);
+ gf_smsg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
+ "username=%s", username, NULL);
}
break;
}
@@ -1457,7 +1447,7 @@ unserialize_req_locklist(gfs3_setactivelk_req *req, lock_migration_info_t *lmi)
while (trav) {
temp = GF_CALLOC(1, sizeof(*lmi), gf_common_mt_lock_mig);
if (temp == NULL) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, 0, "No memory");
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_NO_MEM, NULL);
goto out;
}
@@ -1494,7 +1484,7 @@ unserialize_req_locklist_v2(gfx_setactivelk_req *req,
while (trav) {
temp = GF_CALLOC(1, sizeof(*lmi), gf_common_mt_lock_mig);
if (temp == NULL) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, 0, "No memory");
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_NO_MEM, NULL);
goto out;
}
diff --git a/xlators/protocol/server/src/server-messages.h b/xlators/protocol/server/src/server-messages.h
index 9f00421..1b2e149 100644
--- a/xlators/protocol/server/src/server-messages.h
+++ b/xlators/protocol/server/src/server-messages.h
@@ -23,43 +23,146 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(PS, PS_MSG_AUTHENTICATE_ERROR, PS_MSG_VOL_VALIDATE_FAILED,
- PS_MSG_AUTH_INIT_FAILED, PS_MSG_REMOTE_CLIENT_REFUSED,
- PS_MSG_GFID_RESOLVE_FAILED, PS_MSG_ANONYMOUS_FD_CREATE_FAILED,
- PS_MSG_NO_MEMORY, PS_MSG_FD_NOT_FOUND, PS_MSG_INVALID_ENTRY,
- PS_MSG_GET_UID_FAILED, PS_MSG_UID_NOT_FOUND, PS_MSG_MAPPING_ERROR,
- PS_MSG_FD_CLEANUP, PS_MSG_SERVER_CTX_GET_FAILED, PS_MSG_FDENTRY_NULL,
- PS_MSG_DIR_NOT_FOUND, PS_MSG_SERVER_MSG, PS_MSG_DICT_SERIALIZE_FAIL,
- PS_MSG_RW_STAT, PS_MSG_DICT_GET_FAILED, PS_MSG_LOGIN_ERROR,
- PS_MSG_REMOUNT_CLIENT_REQD, PS_MSG_DEFAULTING_FILE,
- PS_MSG_VOL_FILE_OPEN_FAILED, PS_MSG_STAT_ERROR,
- PS_MSG_SSL_NAME_SET_FAILED, PS_MSG_ASPRINTF_FAILED,
- PS_MSG_CLIENT_VERSION_NOT_SET, PS_MSG_CLIENT_ACCEPTED,
- PS_MSG_CLIENT_LK_VERSION_ERROR, PS_MSG_GRACE_TIMER_EXPD,
- PS_MSG_SERIALIZE_REPLY_FAILED, PS_MSG_AUTH_IP_ERROR,
- PS_MSG_SKIP_FORMAT_CHK, PS_MSG_INTERNET_ADDR_ERROR,
- PS_MSG_CLIENT_DISCONNECTING, PS_MSG_GRACE_TIMER_START,
- PS_MSG_STATEDUMP_PATH_ERROR, PS_MSG_GRP_CACHE_ERROR,
- PS_MSG_RPC_CONF_ERROR, PS_MSG_TRANSPORT_ERROR, PS_MSG_SUBVOL_NULL,
- PS_MSG_PARENT_VOL_ERROR, PS_MSG_RPCSVC_CREATE_FAILED,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, PS_MSG_RPCSVC_NOTIFY,
- PS_MSG_PGM_REG_FAILED, PS_MSG_ULIMIT_SET_FAILED, PS_MSG_STATFS,
- PS_MSG_LOOKUP_INFO, PS_MSG_LK_INFO, PS_MSG_LOCK_ERROR,
- PS_MSG_INODELK_INFO, PS_MSG_ENTRYLK_INFO, PS_MSG_ACCESS_INFO,
- PS_MSG_DIR_INFO, PS_MSG_MKNOD_INFO, PS_MSG_REMOVEXATTR_INFO,
- PS_MSG_GETXATTR_INFO, PS_MSG_SETXATTR_INFO, PS_MSG_RENAME_INFO,
- PS_MSG_LINK_INFO, PS_MSG_TRUNCATE_INFO, PS_MSG_FSTAT_INFO,
- PS_MSG_FLUSH_INFO, PS_MSG_SYNC_INFO, PS_MSG_WRITE_INFO,
- PS_MSG_READ_INFO, PS_MSG_CHKSUM_INFO, PS_MSG_OPEN_INFO,
- PS_MSG_CREATE_INFO, PS_MSG_SETATTR_INFO, PS_MSG_XATTROP_INFO,
- PS_MSG_ALLOC_INFO, PS_MSG_DISCARD_INFO, PS_MSG_ZEROFILL_INFO,
- PS_MSG_FD_CREATE_FAILED, PS_MSG_WRONG_STATE, PS_MSG_CONF_DIR_INVALID,
- PS_MSG_MOUNT_PT_FAIL, PS_MSG_STAT_INFO, PS_MSG_FILE_OP_FAILED,
- PS_MSG_GRACE_TIMER_CANCELLED, PS_MSG_ENCODE_MSG_FAILED,
- PS_MSG_REPLY_SUBMIT_FAILED, PS_MSG_RPC_NOTIFY_ERROR,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED, PS_MSG_SERVER_IPC_INFO,
- PS_MSG_SEEK_INFO, PS_MSG_COMPOUND_INFO,
- PS_MSG_CLIENT_OPVERSION_GET_FAILED, PS_MSG_CHILD_STATUS_FAILED,
- PS_MSG_PUT_INFO);
+GLFS_MSGID(
+ PS, PS_MSG_AUTHENTICATE_ERROR, PS_MSG_VOL_VALIDATE_FAILED,
+ PS_MSG_AUTH_INIT_FAILED, PS_MSG_REMOTE_CLIENT_REFUSED,
+ PS_MSG_GFID_RESOLVE_FAILED, PS_MSG_ANONYMOUS_FD_CREATE_FAILED,
+ PS_MSG_NO_MEMORY, PS_MSG_FD_NOT_FOUND, PS_MSG_INVALID_ENTRY,
+ PS_MSG_GET_UID_FAILED, PS_MSG_UID_NOT_FOUND, PS_MSG_MAPPING_ERROR,
+ PS_MSG_FD_CLEANUP, PS_MSG_SERVER_CTX_GET_FAILED, PS_MSG_FDENTRY_NULL,
+ PS_MSG_DIR_NOT_FOUND, PS_MSG_SERVER_MSG, PS_MSG_DICT_SERIALIZE_FAIL,
+ PS_MSG_RW_STAT, PS_MSG_DICT_GET_FAILED, PS_MSG_LOGIN_ERROR,
+ PS_MSG_REMOUNT_CLIENT_REQD, PS_MSG_DEFAULTING_FILE,
+ PS_MSG_VOL_FILE_OPEN_FAILED, PS_MSG_STAT_ERROR, PS_MSG_SSL_NAME_SET_FAILED,
+ PS_MSG_ASPRINTF_FAILED, PS_MSG_CLIENT_VERSION_NOT_SET,
+ PS_MSG_CLIENT_ACCEPTED, PS_MSG_CLIENT_LK_VERSION_ERROR,
+ PS_MSG_GRACE_TIMER_EXPD, PS_MSG_SERIALIZE_REPLY_FAILED,
+ PS_MSG_AUTH_IP_ERROR, PS_MSG_SKIP_FORMAT_CHK, PS_MSG_INTERNET_ADDR_ERROR,
+ PS_MSG_CLIENT_DISCONNECTING, PS_MSG_GRACE_TIMER_START,
+ PS_MSG_STATEDUMP_PATH_ERROR, PS_MSG_GRP_CACHE_ERROR, PS_MSG_RPC_CONF_ERROR,
+ PS_MSG_TRANSPORT_ERROR, PS_MSG_SUBVOL_NULL, PS_MSG_PARENT_VOL_ERROR,
+ PS_MSG_RPCSVC_CREATE_FAILED, PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
+ PS_MSG_RPCSVC_NOTIFY, PS_MSG_PGM_REG_FAILED, PS_MSG_ULIMIT_SET_FAILED,
+ PS_MSG_STATFS, PS_MSG_LOOKUP_INFO, PS_MSG_LK_INFO, PS_MSG_LOCK_ERROR,
+ PS_MSG_INODELK_INFO, PS_MSG_ENTRYLK_INFO, PS_MSG_ACCESS_INFO,
+ PS_MSG_DIR_INFO, PS_MSG_MKNOD_INFO, PS_MSG_REMOVEXATTR_INFO,
+ PS_MSG_GETXATTR_INFO, PS_MSG_SETXATTR_INFO, PS_MSG_RENAME_INFO,
+ PS_MSG_LINK_INFO, PS_MSG_TRUNCATE_INFO, PS_MSG_FSTAT_INFO,
+ PS_MSG_FLUSH_INFO, PS_MSG_SYNC_INFO, PS_MSG_WRITE_INFO, PS_MSG_READ_INFO,
+ PS_MSG_CHKSUM_INFO, PS_MSG_OPEN_INFO, PS_MSG_CREATE_INFO,
+ PS_MSG_SETATTR_INFO, PS_MSG_XATTROP_INFO, PS_MSG_ALLOC_INFO,
+ PS_MSG_DISCARD_INFO, PS_MSG_ZEROFILL_INFO, PS_MSG_FD_CREATE_FAILED,
+ PS_MSG_WRONG_STATE, PS_MSG_CONF_DIR_INVALID, PS_MSG_MOUNT_PT_FAIL,
+ PS_MSG_STAT_INFO, PS_MSG_FILE_OP_FAILED, PS_MSG_GRACE_TIMER_CANCELLED,
+ PS_MSG_ENCODE_MSG_FAILED, PS_MSG_REPLY_SUBMIT_FAILED,
+ PS_MSG_RPC_NOTIFY_ERROR, PS_MSG_SERVER_EVENT_UPCALL_FAILED,
+ PS_MSG_SERVER_IPC_INFO, PS_MSG_SEEK_INFO, PS_MSG_COMPOUND_INFO,
+ PS_MSG_CLIENT_OPVERSION_GET_FAILED, PS_MSG_CHILD_STATUS_FAILED,
+ PS_MSG_PUT_INFO, PS_MSG_UNAUTHORIZED_CLIENT, PS_MSG_RECONFIGURE_FAILED,
+ PS_MSG_SET_STATEDUMP_PATH_ERROR, PS_MSG_INIT_GRP_CACHE_ERROR,
+ PS_MSG_RPC_CONFIGURE_FAILED, PS_MSG_TRANSPORT_TYPE_NOT_SET,
+ PS_MSG_GET_TOTAL_AVAIL_TRANSPORT_FAILED, PS_MSG_INVLAID_UPCALL_EVENT,
+ PS_MSG_SERVER_CHILD_EVENT_FAILED, PS_MSG_SETACTIVELK_INFO,
+ PS_MSG_GETACTIVELK_INFO, PS_MSG_WRONG_VALUE, PS_MSG_PASSWORD_NOT_FOUND,
+ PS_MSG_REMOTE_SUBVOL_NOT_SPECIFIED, PS_MSG_NO_MEM);
+#define PS_MSG_SERIALIZE_REPLY_FAILED_STR "Failed to serialize reply"
+#define PS_MSG_AUTH_IP_ERROR_STR "assuming 'auth.ip' to be 'auth.addr'"
+#define PS_MSG_SKIP_FORMAT_CHK_STR "skip format check for non-addr auth option"
+#define PS_MSG_INTERNET_ADDR_ERROR_STR \
+ "internet address does not confirm to standards"
+#define PS_MSG_AUTHENTICATE_ERROR_STR \
+ "volume defined as subvolume, but no authentication defined for the same"
+#define PS_MSG_CLIENT_DISCONNECTING_STR "disconnecting connection"
+#define PS_MSG_DICT_GET_FAILED_STR "failed to get"
+#define PS_MSG_NO_MEMORY_STR "Memory accounting init failed"
+#define PS_MSG_INVALID_ENTRY_STR \
+ "'trace' takes on only boolean values. Neglecting option"
+#define PS_MSG_STATEDUMP_PATH_ERROR_STR \
+ "Error while reconfiguring statedump path"
+#define PS_MSG_GRP_CACHE_ERROR_STR "Failed to reconfigure group cache."
+#define PS_MSG_RPC_CONF_ERROR_STR "No rpc_conf !!!!"
+#define PS_MSG_CLIENT_ACCEPTED_STR \
+ "authorized client, hence we continue with this connection"
+#define PS_MSG_UNAUTHORIZED_CLIENT_STR \
+ "unauthorized client, hence terminating the connection"
+#define PS_MSG_RECONFIGURE_FAILED_STR \
+ "Failed to reconfigure outstanding-rpc-limit"
+#define PS_MSG_TRANSPORT_ERROR_STR "Reconfigure not found for transport"
+#define PS_MSG_SUBVOL_NULL_STR "protocol/server should have subvolume"
+#define PS_MSG_PARENT_VOL_ERROR_STR \
+ "protocol/server should not have parent volumes"
+#define PS_MSG_SET_STATEDUMP_PATH_ERROR_STR "Error setting statedump path"
+#define PS_MSG_INIT_GRP_CACHE_ERROR_STR "Failed to initialize group cache."
+#define PS_MSG_RPCSVC_CREATE_FAILED_STR "creation of rpcsvc failed"
+#define PS_MSG_RPC_CONFIGURE_FAILED_STR \
+ "Failed to configure outstanding-rpc-limit"
+#define PS_MSG_TRANSPORT_TYPE_NOT_SET_STR "option transport-type not set"
+#define PS_MSG_GET_TOTAL_AVAIL_TRANSPORT_FAILED_STR \
+ "failed to get total number of available tranpsorts"
+#define PS_MSG_RPCSVC_LISTENER_CREATE_FAILED_STR "creation of listener failed"
+#define PS_MSG_RPCSVC_NOTIFY_STR "registration of notify with rpcsvc failed"
+#define PS_MSG_PGM_REG_FAILED_STR "registration of program failed"
+#define PS_MSG_ULIMIT_SET_FAILED_STR "WARNING: Failed to set 'ulimit -n 1M'"
+#define PS_MSG_FD_NOT_FOUND_STR "Failed to set max open fd to 64k"
+#define PS_MSG_VOL_FILE_OPEN_FAILED_STR \
+ "volfile-id argument not given. This is mandatory argument, defaulting " \
+ "to 'gluster'"
+#define PS_MSG_INVLAID_UPCALL_EVENT_STR "Received invalid upcall event"
+#define PS_MSG_CHILD_STATUS_FAILED_STR "No xlator is found in child status list"
+#define PS_MSG_SERVER_EVENT_UPCALL_FAILED_STR \
+ "server_process_event_upcall failed"
+#define PS_MSG_SERVER_CHILD_EVENT_FAILED_STR "server_process_child_event failed"
+#define PS_MSG_STATFS_STR "STATFS"
+#define PS_MSG_LOOKUP_INFO_STR "LOOKUP info"
+#define PS_MSG_LK_INFO_STR "LEASE info"
+#define PS_MSG_INODELK_INFO_STR "INODELK info"
+#define PS_MSG_DIR_INFO_STR "MKDIR info"
+#define PS_MSG_MKNOD_INFO_STR "MKNOD info"
+#define PS_MSG_REMOVEXATTR_INFO_STR "REMOVEXATTR info"
+#define PS_MSG_GETXATTR_INFO_STR "GETXATTR info"
+#define PS_MSG_SETXATTR_INFO_STR "SETXATTR info"
+#define PS_MSG_RENAME_INFO_STR "RENAME inf"
+#define PS_MSG_LINK_INFO_STR "LINK info"
+#define PS_MSG_TRUNCATE_INFO_STR "TRUNCATE info"
+#define PS_MSG_STAT_INFO_STR "STAT info"
+#define PS_MSG_FLUSH_INFO_STR "FLUSH info"
+#define PS_MSG_SYNC_INFO_STR "SYNC info"
+#define PS_MSG_WRITE_INFO_STR "WRITE info"
+#define PS_MSG_READ_INFO_STR "READ info"
+#define PS_MSG_CHKSUM_INFO_STR "CHKSUM info"
+#define PS_MSG_OPEN_INFO_STR "OPEN info"
+#define PS_MSG_XATTROP_INFO_STR "XATTROP info"
+#define PS_MSG_ALLOC_INFO_STR "ALLOC info"
+#define PS_MSG_DISCARD_INFO_STR "DISCARD info"
+#define PS_MSG_ZEROFILL_INFO_STR "ZEROFILL info"
+#define PS_MSG_SERVER_IPC_INFO_STR "IPC info"
+#define PS_MSG_SEEK_INFO_STR "SEEK info"
+#define PS_MSG_SETACTIVELK_INFO_STR "SETACTIVELK info"
+#define PS_MSG_CREATE_INFO_STR "CREATE info"
+#define PS_MSG_PUT_INFO_STR "PUT info"
+#define PS_MSG_FD_CREATE_FAILED_STR "could not create the fd"
+#define PS_MSG_GETACTIVELK_INFO_STR "GETACTIVELK info"
+#define PS_MSG_ENTRYLK_INFO_STR "ENTRYLK info"
+#define PS_MSG_ACCESS_INFO_STR "ACCESS info"
+#define PS_MSG_SETATTR_INFO_STR "SETATTR info"
+#define PS_MSG_SERVER_CTX_GET_FAILED_STR "server_ctx_get() failed"
+#define PS_MSG_LOCK_ERROR_STR "Unknown lock type"
+#define PS_MSG_GET_UID_FAILED_STR "getpwuid_r failed"
+#define PS_MSG_UID_NOT_FOUND_STR "getpwuid_r found nothing"
+#define PS_MSG_MAPPING_ERROR_STR "could not map to group list"
+#define PS_MSG_FD_CLEANUP_STR "fd cleanup"
+#define PS_MSG_FDENTRY_NULL_STR "no fdentry to clean"
+#define PS_MSG_WRONG_VALUE_STR \
+ "wrong value for 'verify-volfile-checksum', Neglecting option"
+#define PS_MSG_DIR_NOT_FOUND_STR "Directory doesnot exist"
+#define PS_MSG_CONF_DIR_INVALID_STR "invalid conf_dir"
+#define PS_MSG_SERVER_MSG_STR "server msg"
+#define PS_MSG_DICT_SERIALIZE_FAIL_STR "failed to serialize reply dict"
+#define PS_MSG_MOUNT_PT_FAIL_STR "mount point fail"
+#define PS_MSG_RW_STAT_STR "stat"
+#define PS_MSG_PASSWORD_NOT_FOUND_STR "password not found, returning DONT-CARE"
+#define PS_MSG_REMOTE_SUBVOL_NOT_SPECIFIED_STR "remote-subvolume not specified"
+#define PS_MSG_LOGIN_ERROR_STR "wrong password for user"
+#define PS_MSG_NO_MEM_STR "No memory"
#endif /* !_PS_MESSAGES_H__ */
diff --git a/xlators/protocol/server/src/server-rpc-fops_v2.c b/xlators/protocol/server/src/server-rpc-fops_v2.c
index ec07698..c267f8f 100644
--- a/xlators/protocol/server/src/server-rpc-fops_v2.c
+++ b/xlators/protocol/server/src/server-rpc-fops_v2.c
@@ -56,10 +56,10 @@ server4_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_WARNING, op_errno, PS_MSG_STATFS,
- "%" PRId64 ": STATFS, client: %s, error-xlator: %s",
- frame->root->unique, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_WARNING, op_errno, PS_MSG_STATFS,
+ "frame=%" PRId64, frame->root->unique, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -146,25 +146,20 @@ out:
if (op_ret) {
if (state->resolve.bname) {
- gf_msg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno), op_errno,
- PS_MSG_LOOKUP_INFO,
- "%" PRId64
- ": LOOKUP %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno),
+ op_errno, PS_MSG_LOOKUP_INFO, "frame=%" PRId64,
+ frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid),
+ "bname=%s", state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
} else {
- gf_msg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno), op_errno,
- PS_MSG_LOOKUP_INFO,
- "%" PRId64
- ": LOOKUP %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid),
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno),
+ op_errno, PS_MSG_LOOKUP_INFO, "frame=%" PRId64,
+ frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
}
}
@@ -192,12 +187,12 @@ server4_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_LEASE, op_errno), op_errno,
- PS_MSG_LK_INFO,
- "%" PRId64 ": LEASE %s (%s), client: %s, error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LEASE, op_errno), op_errno,
+ PS_MSG_LK_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
}
server4_post_lease(&rsp, lease);
@@ -228,14 +223,12 @@ server4_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_LK, op_errno), op_errno,
- PS_MSG_LK_INFO,
- "%" PRId64 ": LK %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LK, op_errno), op_errno,
+ PS_MSG_LK_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -268,14 +261,12 @@ server4_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_INODELK, op_errno), op_errno,
- PS_MSG_INODELK_INFO,
- "%" PRId64
- ": INODELK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_INODELK, op_errno), op_errno,
+ PS_MSG_INODELK_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -307,14 +298,12 @@ server4_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_FINODELK, op_errno), op_errno,
- PS_MSG_INODELK_INFO,
- "%" PRId64 ": FINODELK %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FINODELK, op_errno), op_errno,
+ PS_MSG_INODELK_INFO, "frame=%" PRId64, frame->root->unique,
+ "FINODELK_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -346,14 +335,12 @@ server4_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_ENTRYLK, op_errno), op_errno,
- PS_MSG_ENTRYLK_INFO,
- "%" PRId64
- ": ENTRYLK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_ENTRYLK, op_errno), op_errno,
+ PS_MSG_ENTRYLK_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -385,14 +372,12 @@ server4_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_FENTRYLK, op_errno), op_errno,
- PS_MSG_ENTRYLK_INFO,
- "%" PRId64 ": FENTRYLK %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FENTRYLK, op_errno), op_errno,
+ PS_MSG_ENTRYLK_INFO, "frame=%" PRId64, frame->root->unique,
+ "FENTRYLK_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -423,13 +408,12 @@ server4_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_ACCESS_INFO,
- "%" PRId64
- ": ACCESS %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_ACCESS_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -462,13 +446,13 @@ server4_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO,
- "%" PRId64
- ": RMDIR %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO,
+ "frame=%" PRId64, frame->root->unique, "RMDIR_pat=%s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -504,14 +488,13 @@ server4_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_MKDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64
- ": MKDIR %s (%s/%s) client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_MKDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "MKDIR_path=%s", (state->loc.path) ? state->loc.path : "",
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -546,14 +529,13 @@ server4_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_MKNOD, op_errno), op_errno,
- PS_MSG_MKNOD_INFO,
- "%" PRId64
- ": MKNOD %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_MKNOD, op_errno), op_errno,
+ PS_MSG_MKNOD_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -585,14 +567,12 @@ server4_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FSYNCDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64 ": FSYNCDIR %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSYNCDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "FSYNCDIR_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -625,14 +605,12 @@ server4_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_READDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64 ": READDIR %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_READDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "READDIR_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -676,14 +654,12 @@ server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_OPENDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64
- ": OPENDIR %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_OPENDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "OPENDIR_path=%s", (state->loc.path) ? state->loc.path : "",
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -725,13 +701,12 @@ server4_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
else
loglevel = GF_LOG_INFO;
- gf_msg(this->name, loglevel, op_errno, PS_MSG_REMOVEXATTR_INFO,
- "%" PRId64
- ": REMOVEXATTR %s (%s) of key %s, client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, loglevel, op_errno, PS_MSG_REMOVEXATTR_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "name=%s", state->name, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -762,14 +737,13 @@ server4_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FREMOVEXATTR, op_errno),
- op_errno, PS_MSG_REMOVEXATTR_INFO,
- "%" PRId64 ": FREMOVEXATTR %" PRId64
- " (%s) (%s), "
- "client: %s, error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FREMOVEXATTR, op_errno),
+ op_errno, PS_MSG_REMOVEXATTR_INFO, "frame=%" PRId64,
+ frame->root->unique, "FREMOVEXATTR_fd_no%" PRId64,
+ state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "name=%s", state->name,
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -801,14 +775,12 @@ server4_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_GETXATTR, op_errno), op_errno,
- PS_MSG_GETXATTR_INFO,
- "%" PRId64
- ": GETXATTR %s (%s) (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_GETXATTR, op_errno), op_errno,
+ PS_MSG_GETXATTR_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "name=%s", state->name,
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -843,14 +815,12 @@ server4_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FGETXATTR, op_errno), op_errno,
- PS_MSG_GETXATTR_INFO,
- "%" PRId64 ": FGETXATTR %" PRId64
- " (%s) (%s), "
- "client: %s, error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FGETXATTR, op_errno), op_errno,
+ PS_MSG_GETXATTR_INFO, "frame=%" PRId64, frame->root->unique,
+ "FGETXATTR_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "name=%s",
+ state->name, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -890,11 +860,9 @@ server4_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_errno == ENOTSUP) {
gf_msg_debug(THIS->name, 0, "%s", strerror(op_errno));
} else {
- gf_msg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
- "client: %s, "
- "error-xlator: %s",
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
+ "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
}
goto out;
}
@@ -932,11 +900,9 @@ server4_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_errno == ENOTSUP) {
gf_msg_debug(THIS->name, 0, "%s", strerror(op_errno));
} else {
- gf_msg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
- "client: %s, "
- "error-xlator: %s",
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
+ "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
}
goto out;
}
@@ -980,14 +946,14 @@ server4_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
uuid_utoa_r(state->resolve.pargfid, oldpar_str);
uuid_utoa_r(state->resolve2.pargfid, newpar_str);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_RENAME_INFO,
- "%" PRId64
- ": RENAME %s (%s/%s) -> %s (%s/%s), "
- "client: %s, error-xlator: %s",
- frame->root->unique, state->loc.path, oldpar_str,
- state->resolve.bname, state->loc2.path, newpar_str,
- state->resolve2.bname, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_RENAME_INFO,
+ "frame=%" PRId64, frame->root->unique, "loc.path=%s",
+ state->loc.path, "oldpar_str=%s", oldpar_str, "resolve-name=%s",
+ state->resolve.bname, "loc2.path=%s", state->loc2.path,
+ "newpar_str=%s", newpar_str, "resolve2=%s",
+ state->resolve2.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1022,14 +988,13 @@ server4_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_UNLINK, op_errno), op_errno,
- PS_MSG_LINK_INFO,
- "%" PRId64
- ": UNLINK %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_UNLINK, op_errno), op_errno,
+ PS_MSG_LINK_INFO, "frame=%" PRId64, frame->root->unique,
+ "UNLINK_path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1072,13 +1037,13 @@ server4_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
- "%" PRId64
- ": SYMLINK %s (%s/%s), client: %s, "
- "error-xlator:%s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
+ "frame=%" PRId64, frame->root->unique, "SYMLINK_path= %s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1123,13 +1088,12 @@ server4_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
uuid_utoa_r(state->resolve.gfid, gfid_str);
uuid_utoa_r(state->resolve2.pargfid, newpar_str);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
- "%" PRId64
- ": LINK %s (%s) -> %s/%s, client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path, gfid_str, newpar_str,
- state->resolve2.bname, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
+ "frame=%" PRId64, frame->root->unique, "LINK_path=%s",
+ state->loc.path, "gfid_str=%s", gfid_str, "newpar_str=%s",
+ newpar_str, "resolve2.bname=%s", state->resolve2.bname,
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1163,13 +1127,11 @@ server4_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_TRUNCATE_INFO,
- "%" PRId64
- ": TRUNCATE %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_TRUNCATE_INFO,
+ "frame=%" PRId64, frame->root->unique, "TRUNCATE_path=%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1203,14 +1165,12 @@ server4_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_FSTAT, op_errno), op_errno,
- PS_MSG_STAT_INFO,
- "%" PRId64 ": FSTAT %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSTAT, op_errno), op_errno,
+ PS_MSG_STAT_INFO, "frame=%" PRId64, frame->root->unique,
+ "FSTAT_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1242,14 +1202,12 @@ server4_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FTRUNCATE, op_errno), op_errno,
- PS_MSG_TRUNCATE_INFO,
- "%" PRId64 ": FTRUNCATE %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FTRUNCATE, op_errno), op_errno,
+ PS_MSG_TRUNCATE_INFO, "frame=%" PRId64, frame->root->unique,
+ "FTRUNCATE_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1282,14 +1240,12 @@ server4_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FLUSH, op_errno), op_errno,
- PS_MSG_FLUSH_INFO,
- "%" PRId64 ": FLUSH %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FLUSH, op_errno), op_errno,
+ PS_MSG_FLUSH_INFO, "frame=%" PRId64, frame->root->unique,
+ "FLUSH_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1321,14 +1277,12 @@ server4_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FSYNC, op_errno), op_errno,
- PS_MSG_SYNC_INFO,
- "%" PRId64 ": FSYNC %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSYNC, op_errno), op_errno,
+ PS_MSG_SYNC_INFO, "frame=%" PRId64, frame->root->unique,
+ "FSYNC_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1362,14 +1316,12 @@ server4_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_WRITE, op_errno), op_errno,
- PS_MSG_WRITE_INFO,
- "%" PRId64 ": WRITEV %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_WRITE, op_errno), op_errno,
+ PS_MSG_WRITE_INFO, "frame=%" PRId64, frame->root->unique,
+ "WRITEV_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1414,14 +1366,12 @@ server4_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_READ, op_errno), op_errno,
- PS_MSG_READ_INFO,
- "%" PRId64 ": READV %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_READ, op_errno), op_errno,
+ PS_MSG_READ_INFO, "frame=%" PRId64, frame->root->unique,
+ "READV_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1455,14 +1405,12 @@ server4_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_RCHECKSUM, op_errno), op_errno,
- PS_MSG_CHKSUM_INFO,
- "%" PRId64 ": RCHECKSUM %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_RCHECKSUM, op_errno), op_errno,
+ PS_MSG_CHKSUM_INFO, "frame=%" PRId64, frame->root->unique,
+ "RCHECKSUM_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1494,12 +1442,12 @@ server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_OPEN, op_errno), op_errno,
- PS_MSG_OPEN_INFO,
- "%" PRId64 ": OPEN %s (%s), client: %s, error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_OPEN, op_errno), op_errno,
+ PS_MSG_OPEN_INFO, "frame=%" PRId64, frame->root->unique,
+ "OPEN_path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1536,13 +1484,12 @@ server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
- "%" PRId64
- ": CREATE %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(
+ this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1592,13 +1539,11 @@ server4_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
- "%" PRId64
- ": READLINK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
+ "frame=%" PRId64, frame->root->unique, "READLINK_path=%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1633,12 +1578,12 @@ server4_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_STAT, op_errno), op_errno,
- PS_MSG_STAT_INFO,
- "%" PRId64 ": STAT %s (%s), client: %s, error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_STAT, op_errno), op_errno,
+ PS_MSG_STAT_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", (state->loc.path) ? state->loc.path : "",
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1671,13 +1616,12 @@ server4_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO,
- "%" PRId64
- ": SETATTR %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1711,14 +1655,12 @@ server4_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FSETATTR, op_errno), op_errno,
- PS_MSG_SETATTR_INFO,
- "%" PRId64 ": FSETATTR %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSETATTR, op_errno), op_errno,
+ PS_MSG_SETATTR_INFO, "frame=%" PRId64,
+ "FSETATTR_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1752,14 +1694,12 @@ server4_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno), op_errno,
- PS_MSG_XATTROP_INFO,
- "%" PRId64
- ": XATTROP %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno), op_errno,
+ PS_MSG_XATTROP_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1794,14 +1734,12 @@ server4_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FXATTROP, op_errno), op_errno,
- PS_MSG_XATTROP_INFO,
- "%" PRId64 ": FXATTROP %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FXATTROP, op_errno), op_errno,
+ PS_MSG_XATTROP_INFO, "frame=%" PRId64, frame->root->unique,
+ "FXATTROP_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1840,14 +1778,12 @@ server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_READDIRP, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64 ": READDIRP %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_READDIRP, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "READDIRP_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1893,14 +1829,12 @@ server4_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FALLOCATE, op_errno), op_errno,
- PS_MSG_ALLOC_INFO,
- "%" PRId64 ": FALLOCATE %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FALLOCATE, op_errno), op_errno,
+ PS_MSG_ALLOC_INFO, "frame=%" PRId64, frame->root->unique,
+ "FALLOCATE_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1934,14 +1868,12 @@ server4_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_DISCARD, op_errno), op_errno,
- PS_MSG_DISCARD_INFO,
- "%" PRId64 ": DISCARD %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_DISCARD, op_errno), op_errno,
+ PS_MSG_DISCARD_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1977,14 +1909,12 @@ server4_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_ZEROFILL, op_errno), op_errno,
- PS_MSG_ZEROFILL_INFO,
- "%" PRId64 ": ZEROFILL%" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_ZEROFILL, op_errno), op_errno,
+ PS_MSG_ZEROFILL_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2018,13 +1948,12 @@ server4_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_IPC_INFO,
- "%" PRId64 ": IPC%" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_IPC_INFO,
+ "frame=%" PRId64, frame->root->unique, "IPC=%" PRId64,
+ state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2056,14 +1985,12 @@ server4_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_SEEK, op_errno), op_errno,
- PS_MSG_SEEK_INFO,
- "%" PRId64 ": SEEK%" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_SEEK, op_errno), op_errno,
+ PS_MSG_SEEK_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2096,13 +2023,11 @@ server4_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, 0,
- "%" PRId64
- ": SETACTIVELK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETACTIVELK_INFO,
+ "frame=%" PRId64, frame->root->unique, "path==%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2171,9 +2096,10 @@ server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
- "%" PRId64 ": ICREATE [%s] ==> (%s)", frame->root->unique,
- uuid_utoa(state->resolve.gfid), strerror(op_errno));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
+ "frame=%" PRId64, uuid_utoa(state->resolve.gfid),
+ "ICREATE_gfid=%s", uuid_utoa(state->resolve.gfid),
+ "op_errno=%s", strerror(op_errno), NULL);
goto out;
}
@@ -2226,13 +2152,12 @@ server4_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_PUT_INFO,
- "%" PRId64
- ": PUT %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(
+ this->name, GF_LOG_INFO, op_errno, PS_MSG_PUT_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2280,14 +2205,13 @@ server4_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
uuid_utoa_r(state->resolve.gfid, in_gfid);
uuid_utoa_r(state->resolve2.gfid, out_gfid);
- gf_msg(this->name, fop_log_level(GF_FOP_COPY_FILE_RANGE, op_errno),
- op_errno, PS_MSG_WRITE_INFO,
- "%" PRId64 ": COPY_FILE_RANGE %" PRId64 " (%s), %" PRId64
- " (%s) client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no, in_gfid,
- state->resolve2.fd_no, out_gfid, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_COPY_FILE_RANGE, op_errno),
+ op_errno, PS_MSG_WRITE_INFO, "frame=%" PRId64,
+ frame->root->unique, "COPY_FILE_RANGE_fd_no=%" PRId64,
+ state->resolve.fd_no, "in_gfid=%s", in_gfid,
+ "resolve2_fd_no=%" PRId64, state->resolve2.fd_no, "out_gfid=%s",
+ out_gfid, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2773,8 +2697,7 @@ server4_opendir_resume(call_frame_t *frame, xlator_t *bound_xl)
state->fd = fd_create(state->loc.inode, frame->root->pid);
if (!state->fd) {
- gf_msg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED,
- "could not create the fd");
+ gf_smsg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED, NULL);
goto err;
}
@@ -3137,9 +3060,9 @@ server4_create_resume(call_frame_t *frame, xlator_t *bound_xl)
state->fd = fd_create(state->loc.inode, frame->root->pid);
if (!state->fd) {
- gf_msg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED,
- "fd creation for the inode %s failed",
- state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : NULL);
+ gf_smsg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED, "inode=%s",
+ state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : NULL,
+ NULL);
state->resolve.op_ret = -1;
state->resolve.op_errno = ENOMEM;
goto err;
@@ -3385,13 +3308,11 @@ server4_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, 0,
- "%" PRId64
- ": GETACTIVELK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_GETACTIVELK_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ state->loc.path, "gfid=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -4112,9 +4033,8 @@ server4_0_release(rpcsvc_request_t *req)
serv_ctx = server_ctx_get(client, client->this);
if (serv_ctx == NULL) {
- gf_msg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
- "server_ctx_get() "
- "failed");
+ gf_smsg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
+ NULL);
req->rpc_err = SYSTEM_ERR;
goto out;
}
@@ -4158,9 +4078,8 @@ server4_0_releasedir(rpcsvc_request_t *req)
serv_ctx = server_ctx_get(client, client->this);
if (serv_ctx == NULL) {
- gf_msg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
- "server_ctx_get() "
- "failed");
+ gf_smsg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
+ NULL);
req->rpc_err = SYSTEM_ERR;
goto out;
}
@@ -5531,13 +5450,10 @@ server4_0_lk(rpcsvc_request_t *req)
state->flock.l_type = F_UNLCK;
break;
default:
- gf_msg(frame->root->client->bound_xl->name, GF_LOG_ERROR, 0,
- PS_MSG_LOCK_ERROR,
- "fd - %" PRId64
- " (%s): Unknown "
- "lock type: %" PRId32 "!",
- state->resolve.fd_no, uuid_utoa(state->fd->inode->gfid),
- state->type);
+ gf_smsg(frame->root->client->bound_xl->name, GF_LOG_ERROR, 0,
+ PS_MSG_LOCK_ERROR, "fd=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->fd->inode->gfid),
+ "lock type=" PRId32, state->type, NULL);
break;
}
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 222dc9a..7219680 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -108,8 +108,7 @@ server_submit_reply(call_frame_t *frame, rpcsvc_request_t *req, void *arg,
iob = gfs_serialize_reply(req, arg, &rsp, xdrproc);
if (!iob) {
- gf_msg("", GF_LOG_ERROR, 0, PS_MSG_SERIALIZE_REPLY_FAILED,
- "Failed to serialize reply");
+ gf_smsg("", GF_LOG_ERROR, 0, PS_MSG_SERIALIZE_REPLY_FAILED, NULL);
goto ret;
}
@@ -268,6 +267,8 @@ server_priv(xlator_t *this)
gf_proc_dump_build_key(key, "server", "total-bytes-write");
gf_proc_dump_write(key, "%" PRIu64, total_write);
+ rpcsvc_statedump(conf->rpc);
+
ret = 0;
out:
if (ret)
@@ -303,8 +304,7 @@ get_auth_types(dict_t *this, char *key, data_t *value, void *data)
/* TODO: backward compatibility, remove when
newer versions are available */
tmp = "addr";
- gf_msg("server", GF_LOG_WARNING, 0, PS_MSG_AUTH_IP_ERROR,
- "assuming 'auth.ip' to be 'auth.addr'");
+ gf_smsg("server", GF_LOG_WARNING, 0, PS_MSG_AUTH_IP_ERROR, NULL);
}
ret = dict_set_dynptr(auth_dict, tmp, NULL, 0);
if (ret < 0) {
@@ -333,8 +333,8 @@ _check_for_auth_option(dict_t *d, char *k, data_t *v, void *tmp)
goto out;
if (strncmp(tail, "addr.", 5) != 0) {
- gf_msg(xl->name, GF_LOG_TRACE, 0, PS_MSG_SKIP_FORMAT_CHK,
- "skip format check for non-addr auth option %s", k);
+ gf_smsg(xl->name, GF_LOG_TRACE, 0, PS_MSG_SKIP_FORMAT_CHK, "option=%s",
+ k, NULL);
goto out;
}
@@ -356,10 +356,8 @@ _check_for_auth_option(dict_t *d, char *k, data_t *v, void *tmp)
ret = xlator_option_validate_addr_list(xl, "auth-*", v->data, NULL,
NULL);
if (ret)
- gf_msg(xl->name, GF_LOG_ERROR, 0, PS_MSG_INTERNET_ADDR_ERROR,
- "internet address '%s' does not conform "
- "to standards.",
- v->data);
+ gf_smsg(xl->name, GF_LOG_ERROR, 0, PS_MSG_INTERNET_ADDR_ERROR,
+ "data=%s", v->data, NULL);
}
out:
return ret;
@@ -379,11 +377,8 @@ validate_auth_options(xlator_t *this, dict_t *dict)
error = dict_foreach(dict, _check_for_auth_option, trav->xlator);
if (-1 == error) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_AUTHENTICATE_ERROR,
- "volume '%s' "
- "defined as subvolume, but no authentication "
- "defined for the same",
- trav->xlator->name);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_AUTHENTICATE_ERROR,
+ "name=%s", trav->xlator->name, NULL);
break;
}
trav = trav->next;
@@ -410,7 +405,14 @@ server_call_xlator_mem_cleanup(xlator_t *this, char *victim_name)
arg = calloc(1, sizeof(*arg));
arg->this = this;
- arg->victim_name = gf_strdup(victim_name);
+ arg->victim_name = strdup(victim_name);
+ if (!arg->victim_name) {
+ gf_smsg(this->name, GF_LOG_CRITICAL, ENOMEM, LG_MSG_NO_MEMORY,
+ "Memory allocation is failed");
+ free(arg);
+ return;
+ }
+
th_ret = gf_thread_create_detached(&th_id, server_graph_janitor_threads,
arg, "graphjanitor");
if (th_ret) {
@@ -418,7 +420,7 @@ server_call_xlator_mem_cleanup(xlator_t *this, char *victim_name)
"graph janitor Thread"
" creation is failed for brick %s",
victim_name);
- GF_FREE(arg->victim_name);
+ free(arg->victim_name);
free(arg);
}
}
@@ -494,15 +496,13 @@ server_rpc_notify(rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, void *data)
if (!client)
goto unref_transport;
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_CLIENT_DISCONNECTING,
- "disconnecting connection"
- " from %s",
- client->client_uid);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_CLIENT_DISCONNECTING,
+ "client-uid=%s", client->client_uid, NULL);
ret = dict_get_str_sizen(this->options, "auth-path", &auth_path);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_DICT_GET_FAILED,
- "failed to get auth-path");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_DICT_GET_FAILED,
+ "type=auth-path", NULL);
auth_path = NULL;
}
@@ -630,7 +630,7 @@ server_graph_janitor_threads(void *data)
}
out:
- GF_FREE(arg->victim_name);
+ free(arg->victim_name);
free(arg);
return NULL;
}
@@ -645,8 +645,7 @@ server_mem_acct_init(xlator_t *this)
ret = xlator_mem_acct_init(this, gf_server_mt_end + 1);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, PS_MSG_NO_MEMORY,
- "Memory accounting init failed");
+ gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, PS_MSG_NO_MEMORY, NULL);
return ret;
}
out:
@@ -775,9 +774,8 @@ server_reconfigure(xlator_t *this, dict_t *options)
if (data) {
ret = gf_string2boolean(data->data, &trace);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "'trace' takes on only "
- "boolean values. Neglecting option");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
+ NULL);
ret = -1;
goto out;
}
@@ -787,8 +785,7 @@ server_reconfigure(xlator_t *this, dict_t *options)
GF_OPTION_RECONF("statedump-path", statedump_path, options, path, do_auth);
if (!statedump_path) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_STATEDUMP_PATH_ERROR,
- "Error while reconfiguring statedump path");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_STATEDUMP_PATH_ERROR, NULL);
goto do_auth;
}
gf_path_strip_trailing_slashes(statedump_path);
@@ -821,16 +818,14 @@ do_auth:
GF_OPTION_RECONF("gid-timeout", conf->gid_cache_timeout, options, int32,
do_rpc);
if (gid_cache_reconf(&conf->gid_cache, conf->gid_cache_timeout) < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_GRP_CACHE_ERROR,
- "Failed to reconfigure group cache.");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_GRP_CACHE_ERROR, NULL);
goto do_rpc;
}
do_rpc:
rpc_conf = conf->rpc;
if (!rpc_conf) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR,
- "No rpc_conf !!!!");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR, NULL);
goto out;
}
@@ -884,9 +879,8 @@ do_rpc:
ret = gf_authenticate(xprt->clnt_options, options,
conf->auth_modules);
if (ret == AUTH_ACCEPT) {
- gf_msg(kid->name, GF_LOG_TRACE, 0, PS_MSG_CLIENT_ACCEPTED,
- "authorized client, hence we "
- "continue with this connection");
+ gf_smsg(kid->name, GF_LOG_TRACE, 0, PS_MSG_CLIENT_ACCEPTED,
+ NULL);
} else {
gf_event(EVENT_CLIENT_AUTH_REJECT,
"client_uid=%s;"
@@ -896,11 +890,10 @@ do_rpc:
xprt->xl_private->client_uid,
xprt->peerinfo.identifier, xprt->myinfo.identifier,
auth_path);
- gf_msg(this->name, GF_LOG_INFO, EACCES,
- PS_MSG_AUTHENTICATE_ERROR,
- "unauthorized client, hence "
- "terminating the connection %s",
- xprt->peerinfo.identifier);
+ gf_smsg(this->name, GF_LOG_INFO, EACCES,
+ PS_MSG_UNAUTHORIZED_CLIENT,
+ "peerinfo-identifier=%s", xprt->peerinfo.identifier,
+ NULL);
rpc_transport_disconnect(xprt, _gf_false);
}
}
@@ -911,8 +904,7 @@ do_rpc:
ret = rpcsvc_set_outstanding_rpc_limit(
rpc_conf, options, RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR,
- "Failed to reconfigure outstanding-rpc-limit");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RECONFIGURE_FAILED, NULL);
goto out;
}
@@ -922,9 +914,8 @@ do_rpc:
if (listeners->trans->reconfigure)
listeners->trans->reconfigure(listeners->trans, options);
else
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
- "Reconfigure "
- "not found for transport");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
+ NULL);
}
}
@@ -1052,14 +1043,12 @@ server_init(xlator_t *this)
GF_VALIDATE_OR_GOTO("init", this, out);
if (this->children == NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_SUBVOL_NULL,
- "protocol/server should have subvolume");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_SUBVOL_NULL, NULL);
goto out;
}
if (this->parents != NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_PARENT_VOL_ERROR,
- "protocol/server should not have parent volumes");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_PARENT_VOL_ERROR, NULL);
goto out;
}
@@ -1096,8 +1085,8 @@ server_init(xlator_t *this)
gf_path_strip_trailing_slashes(statedump_path);
this->ctx->statedump_path = gf_strdup(statedump_path);
} else {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_STATEDUMP_PATH_ERROR,
- "Error setting statedump path");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_SET_STATEDUMP_PATH_ERROR,
+ NULL);
ret = -1;
goto out;
}
@@ -1128,8 +1117,7 @@ server_init(xlator_t *this)
GF_OPTION_INIT("gid-timeout", conf->gid_cache_timeout, int32, out);
if (gid_cache_init(&conf->gid_cache, conf->gid_cache_timeout) < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_GRP_CACHE_ERROR,
- "Failed to initialize group cache.");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_INIT_GRP_CACHE_ERROR, NULL);
goto out;
}
@@ -1148,9 +1136,7 @@ server_init(xlator_t *this)
/* RPC related */
conf->rpc = rpcsvc_init(this, this->ctx, this->options, 0);
if (conf->rpc == NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPCSVC_CREATE_FAILED,
- "creation of rpcsvc "
- "failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPCSVC_CREATE_FAILED, NULL);
ret = -1;
goto out;
}
@@ -1158,8 +1144,7 @@ server_init(xlator_t *this)
ret = rpcsvc_set_outstanding_rpc_limit(
conf->rpc, this->options, RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR,
- "Failed to configure outstanding-rpc-limit");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONFIGURE_FAILED, NULL);
goto out;
}
@@ -1171,15 +1156,15 @@ server_init(xlator_t *this)
ret = dict_get_str_sizen(this->options, "transport-type", &transport_type);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
- "option transport-type not set");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_TYPE_NOT_SET,
+ NULL);
ret = -1;
goto out;
}
total_transport = rpc_transport_count(transport_type);
if (total_transport <= 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
- "failed to get total number of available tranpsorts");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_GET_TOTAL_AVAIL_TRANSPORT_FAILED, NULL);
ret = -1;
goto out;
}
@@ -1188,24 +1173,21 @@ server_init(xlator_t *this)
ret = rpcsvc_create_listeners(conf->rpc, this->options, this->name);
if (ret < 1) {
- gf_msg(this->name, GF_LOG_WARNING, 0,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
- "creation of listener failed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0,
+ PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, NULL);
if (ret != -EADDRINUSE)
ret = -1;
goto out;
} else if (ret < total_transport) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
- "creation of %d listeners failed, continuing with "
- "succeeded transport",
- (total_transport - ret));
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, "number=%d",
+ "continuing with succeeded transport", (total_transport - ret),
+ NULL);
}
ret = rpcsvc_register_notify(conf->rpc, server_rpc_notify, this);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_RPCSVC_NOTIFY,
- "registration of notify with rpcsvc failed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_RPCSVC_NOTIFY, NULL);
goto out;
}
@@ -1215,11 +1197,10 @@ server_init(xlator_t *this)
*/
ret = rpcsvc_program_register(conf->rpc, &glusterfs3_3_fop_prog, _gf_true);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED,
- "registration of program (name:%s, prognum:%d, "
- "progver:%d) failed",
- glusterfs3_3_fop_prog.progname, glusterfs3_3_fop_prog.prognum,
- glusterfs3_3_fop_prog.progver);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED, "name=%s",
+ glusterfs3_3_fop_prog.progname, "prognum=%d",
+ glusterfs3_3_fop_prog.prognum, "progver=%d",
+ glusterfs3_3_fop_prog.progver, NULL);
goto out;
}
@@ -1239,11 +1220,10 @@ server_init(xlator_t *this)
ret = rpcsvc_program_register(conf->rpc, &gluster_handshake_prog,
_gf_false);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED,
- "registration of program (name:%s, prognum:%d, "
- "progver:%d) failed",
- gluster_handshake_prog.progname, gluster_handshake_prog.prognum,
- gluster_handshake_prog.progver);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED, "name=%s",
+ gluster_handshake_prog.progname, "prognum=%d",
+ gluster_handshake_prog.prognum, "progver=%d",
+ gluster_handshake_prog.progver, NULL);
rpcsvc_program_unregister(conf->rpc, &glusterfs3_3_fop_prog);
rpcsvc_program_unregister(conf->rpc, &glusterfs4_0_fop_prog);
goto out;
@@ -1257,18 +1237,14 @@ server_init(xlator_t *this)
lim.rlim_max = 1048576;
if (setrlimit(RLIMIT_NOFILE, &lim) == -1) {
- gf_msg(this->name, GF_LOG_WARNING, errno, PS_MSG_ULIMIT_SET_FAILED,
- "WARNING: Failed to "
- "set 'ulimit -n 1M': %s",
- strerror(errno));
+ gf_smsg(this->name, GF_LOG_WARNING, errno, PS_MSG_ULIMIT_SET_FAILED,
+ "errno=%s", strerror(errno), NULL);
lim.rlim_cur = 65536;
lim.rlim_max = 65536;
if (setrlimit(RLIMIT_NOFILE, &lim) == -1) {
- gf_msg(this->name, GF_LOG_WARNING, errno, PS_MSG_FD_NOT_FOUND,
- "Failed to set "
- "max open fd to 64k: %s",
- strerror(errno));
+ gf_smsg(this->name, GF_LOG_WARNING, errno, PS_MSG_FD_NOT_FOUND,
+ "errno=%s", strerror(errno), NULL);
} else {
gf_msg_trace(this->name, 0,
"max open fd set "
@@ -1280,9 +1256,8 @@ server_init(xlator_t *this)
if (!this->ctx->cmd_args.volfile_id) {
/* In some use cases this is a valid case, but
document this to be annoying log in that case */
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_VOL_FILE_OPEN_FAILED,
- "volfile-id argument not given. "
- "This is mandatory argument, defaulting to 'gluster'");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_VOL_FILE_OPEN_FAILED,
+ NULL);
this->ctx->cmd_args.volfile_id = gf_strdup("gluster");
}
FIRST_CHILD(this)->volfile_id = gf_strdup(this->ctx->cmd_args.volfile_id);
@@ -1418,9 +1393,9 @@ server_process_event_upcall(xlator_t *this, void *data)
xdrproc = (xdrproc_t)xdr_gfs4_entrylk_contention_req;
break;
default:
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "Received invalid upcall event(%d)",
- upcall_data->event_type);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL,
+ PS_MSG_INVLAID_UPCALL_EVENT, "event-type=%d",
+ upcall_data->event_type, NULL);
goto out;
}
@@ -1512,10 +1487,8 @@ server_process_child_event(xlator_t *this, int32_t event, void *data,
}
if (!tmp->name)
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_CHILD_STATUS_FAILED,
- "No xlator %s is found in "
- "child status list",
- victim->name);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_CHILD_STATUS_FAILED,
+ "name=%s", victim->name, NULL);
}
list_for_each_entry(xprt, &conf->xprt_list, list)
{
@@ -1564,9 +1537,8 @@ server_notify(xlator_t *this, int32_t event, void *data, ...)
ret = server_process_event_upcall(this, data);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- "server_process_event_upcall failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_EVENT_UPCALL_FAILED, NULL);
goto out;
}
break;
@@ -1585,9 +1557,8 @@ server_notify(xlator_t *this, int32_t event, void *data, ...)
ret = server_process_child_event(this, event, data,
GF_CBK_CHILD_UP);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- "server_process_child_event failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_CHILD_EVENT_FAILED, NULL);
goto out;
}
default_notify(this, event, data);
@@ -1604,9 +1575,8 @@ server_notify(xlator_t *this, int32_t event, void *data, ...)
ret = server_process_child_event(this, event, data,
GF_CBK_CHILD_DOWN);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- "server_process_child_event failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_CHILD_EVENT_FAILED, NULL);
goto out;
}
default_notify(this, event, data);