all: fix the format string exceptions
Currently, there are possibilities in few places, where a user-controlled (like filename, program parameter etc) string can be passed as 'fmt' for printf(), which can lead to segfault, if the user's string contains '%s', '%d' in it. While fixing it, makes sense to make the explicit check for such issues across the codebase, by making the format call properly. Fixes: CVE-2018-14661 Fixes: bz#1644763 Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 Signed-off-by: Amar Tumballi <amarts@redhat.com>
This commit is contained in:
parent
2effe3b0d3
commit
74e8328d3f
@ -2861,7 +2861,7 @@ cli_launch_glfs_heal(int heal_op, dict_t *options)
|
||||
runner_add_args(&runner, "source-brick", NULL);
|
||||
runner_argprintf(&runner, "%s:%s", hostname, path);
|
||||
if (dict_get_str(options, "file", &filename) == 0)
|
||||
runner_argprintf(&runner, filename);
|
||||
runner_argprintf(&runner, "%s", filename);
|
||||
break;
|
||||
case GF_SHD_OP_SPLIT_BRAIN_FILES:
|
||||
runner_add_args(&runner, "split-brain-info", NULL);
|
||||
|
@ -585,7 +585,8 @@ client_dump(client_t *client, char *prefix)
|
||||
if (!client)
|
||||
return;
|
||||
|
||||
gf_proc_dump_write("refcount", GF_PRI_ATOMIC, GF_ATOMIC_GET(client->count));
|
||||
gf_proc_dump_write("refcount", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(client->count));
|
||||
}
|
||||
|
||||
void
|
||||
@ -626,7 +627,7 @@ clienttable_dump(clienttable_t *clienttable, char *prefix)
|
||||
if (GF_CLIENTENTRY_ALLOCATED ==
|
||||
clienttable->cliententries[i].next_free) {
|
||||
gf_proc_dump_build_key(key, prefix, "cliententry[%d]", i);
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
cliententry_dump(&clienttable->cliententries[i], key);
|
||||
}
|
||||
}
|
||||
@ -773,7 +774,7 @@ gf_client_dump_fdtables(xlator_t *this)
|
||||
gf_proc_dump_write(key, "%s", client->subdir_mount);
|
||||
}
|
||||
gf_proc_dump_build_key(key, "conn", "%d.ref", count);
|
||||
gf_proc_dump_write(key, GF_PRI_ATOMIC,
|
||||
gf_proc_dump_write(key, "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(client->count));
|
||||
if (client->bound_xl) {
|
||||
gf_proc_dump_build_key(key, "conn", "%d.bound_xl", count);
|
||||
|
@ -992,13 +992,14 @@ fd_dump(fd_t *fd, char *prefix)
|
||||
if (!fd)
|
||||
return;
|
||||
|
||||
gf_proc_dump_write("pid", "%llu", fd->pid);
|
||||
gf_proc_dump_write("refcount", "%d", fd->refcount);
|
||||
gf_proc_dump_write("pid", "%" PRIu64, fd->pid);
|
||||
gf_proc_dump_write("refcount", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(fd->refcount));
|
||||
gf_proc_dump_write("flags", "%d", fd->flags);
|
||||
|
||||
if (fd->inode) {
|
||||
gf_proc_dump_build_key(key, "inode", NULL);
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
inode_dump(fd->inode, key);
|
||||
}
|
||||
}
|
||||
@ -1040,7 +1041,7 @@ fdtable_dump(fdtable_t *fdtable, char *prefix)
|
||||
for (i = 0; i < fdtable->max_fds; i++) {
|
||||
if (GF_FDENTRY_ALLOCATED == fdtable->fdentries[i].next_free) {
|
||||
gf_proc_dump_build_key(key, prefix, "fdentry[%d]", i);
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
fdentry_dump(&fdtable->fdentries[i], key);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
{ \
|
||||
gf_proc_dump_build_key(key_buf, key_prefix, "%s.%d", list_type, \
|
||||
i++); \
|
||||
gf_proc_dump_add_section(key_buf); \
|
||||
gf_proc_dump_add_section("%s", key_buf); \
|
||||
inode_dump(inode, key); \
|
||||
} \
|
||||
}
|
||||
@ -2341,7 +2341,7 @@ inode_table_dump(inode_table_t *itable, char *prefix)
|
||||
}
|
||||
|
||||
gf_proc_dump_build_key(key, prefix, "hashsize");
|
||||
gf_proc_dump_write(key, "%d", itable->hashsize);
|
||||
gf_proc_dump_write(key, "%" GF_PRI_SIZET, itable->hashsize);
|
||||
gf_proc_dump_build_key(key, prefix, "name");
|
||||
gf_proc_dump_write(key, "%s", itable->name);
|
||||
|
||||
|
@ -1068,7 +1068,7 @@ iobuf_info_dump(struct iobuf *iobuf, const char *key_prefix)
|
||||
UNLOCK(&iobuf->lock);
|
||||
|
||||
gf_proc_dump_build_key(key, key_prefix, "ref");
|
||||
gf_proc_dump_write(key, "%d", my_iobuf.ref);
|
||||
gf_proc_dump_write(key, "%" GF_PRI_ATOMIC, GF_ATOMIC_GET(my_iobuf.ref));
|
||||
gf_proc_dump_build_key(key, key_prefix, "ptr");
|
||||
gf_proc_dump_write(key, "%p", my_iobuf.ptr);
|
||||
|
||||
@ -1094,13 +1094,13 @@ iobuf_arena_info_dump(struct iobuf_arena *iobuf_arena, const char *key_prefix)
|
||||
gf_proc_dump_build_key(key, key_prefix, "alloc_cnt");
|
||||
gf_proc_dump_write(key, "%" PRIu64, iobuf_arena->alloc_cnt);
|
||||
gf_proc_dump_build_key(key, key_prefix, "max_active");
|
||||
gf_proc_dump_write(key, "%" PRIu64, iobuf_arena->max_active);
|
||||
gf_proc_dump_write(key, "%d", iobuf_arena->max_active);
|
||||
gf_proc_dump_build_key(key, key_prefix, "page_size");
|
||||
gf_proc_dump_write(key, "%" PRIu64, iobuf_arena->page_size);
|
||||
gf_proc_dump_write(key, "%" GF_PRI_SIZET, iobuf_arena->page_size);
|
||||
list_for_each_entry(trav, &iobuf_arena->active.list, list)
|
||||
{
|
||||
gf_proc_dump_build_key(key, key_prefix, "active_iobuf.%d", i++);
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
iobuf_info_dump(trav, key);
|
||||
}
|
||||
|
||||
@ -1126,9 +1126,10 @@ iobuf_stats_dump(struct iobuf_pool *iobuf_pool)
|
||||
}
|
||||
gf_proc_dump_add_section("iobuf.global");
|
||||
gf_proc_dump_write("iobuf_pool", "%p", iobuf_pool);
|
||||
gf_proc_dump_write("iobuf_pool.default_page_size", "%d",
|
||||
gf_proc_dump_write("iobuf_pool.default_page_size", "%" GF_PRI_SIZET,
|
||||
iobuf_pool->default_page_size);
|
||||
gf_proc_dump_write("iobuf_pool.arena_size", "%d", iobuf_pool->arena_size);
|
||||
gf_proc_dump_write("iobuf_pool.arena_size", "%" GF_PRI_SIZET,
|
||||
iobuf_pool->arena_size);
|
||||
gf_proc_dump_write("iobuf_pool.arena_cnt", "%d", iobuf_pool->arena_cnt);
|
||||
gf_proc_dump_write("iobuf_pool.request_misses", "%" PRId64,
|
||||
iobuf_pool->request_misses);
|
||||
@ -1137,21 +1138,21 @@ iobuf_stats_dump(struct iobuf_pool *iobuf_pool)
|
||||
list_for_each_entry(trav, &iobuf_pool->arenas[j], list)
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "arena.%d", i);
|
||||
gf_proc_dump_add_section(msg);
|
||||
gf_proc_dump_add_section("%s", msg);
|
||||
iobuf_arena_info_dump(trav, msg);
|
||||
i++;
|
||||
}
|
||||
list_for_each_entry(trav, &iobuf_pool->purge[j], list)
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "purge.%d", i);
|
||||
gf_proc_dump_add_section(msg);
|
||||
gf_proc_dump_add_section("%s", msg);
|
||||
iobuf_arena_info_dump(trav, msg);
|
||||
i++;
|
||||
}
|
||||
list_for_each_entry(trav, &iobuf_pool->filled[j], list)
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "filled.%d", i);
|
||||
gf_proc_dump_add_section(msg);
|
||||
gf_proc_dump_add_section("%s", msg);
|
||||
iobuf_arena_info_dump(trav, msg);
|
||||
i++;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ gf_proc_dump_latency_info(xlator_t *xl)
|
||||
int i;
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.latency", xl->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
for (i = 0; i < GF_FOP_MAXVALUE; i++) {
|
||||
gf_proc_dump_build_key(key, key_prefix, "%s", (char *)gf_fop_list[i]);
|
||||
|
@ -183,7 +183,8 @@ _gf_log_callingfn(const char *domain, const char *file, const char *function,
|
||||
__attribute__((__format__(__printf__, 6, 7)));
|
||||
|
||||
int
|
||||
_gf_log_eh(const char *function, const char *fmt, ...);
|
||||
_gf_log_eh(const char *function, const char *fmt, ...)
|
||||
__attribute__((__format__(__printf__, 2, 3)));
|
||||
|
||||
/* treat GF_LOG_TRACE and GF_LOG_NONE as LOG_DEBUG and
|
||||
* other level as is */
|
||||
|
@ -93,7 +93,8 @@ int
|
||||
gf_vasprintf(char **string_ptr, const char *format, va_list arg);
|
||||
|
||||
int
|
||||
gf_asprintf(char **string_ptr, const char *format, ...);
|
||||
gf_asprintf(char **string_ptr, const char *format, ...)
|
||||
__attribute__((__format__(__printf__, 2, 3)));
|
||||
|
||||
void
|
||||
__gf_free(void *ptr);
|
||||
|
@ -81,8 +81,8 @@ runner_add_args(runner_t *runner, ...);
|
||||
* @param format printf style format specifier
|
||||
*/
|
||||
void
|
||||
runner_argprintf(runner_t *runner, const char *format, ...);
|
||||
|
||||
runner_argprintf(runner_t *runner, const char *format, ...)
|
||||
__attribute__((__format__(__printf__, 2, 3)));
|
||||
/**
|
||||
* log a message about the command to be run.
|
||||
*
|
||||
|
@ -148,7 +148,7 @@ gf_proc_dump_call_frame(call_frame_t *call_frame, const char *key_buf, ...)
|
||||
out:
|
||||
if (ret) {
|
||||
gf_proc_dump_write("Unable to dump the frame information",
|
||||
"(Lock acquisition failed) %p", my_frame);
|
||||
"(Lock acquisition failed)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -185,9 +185,9 @@ gf_proc_dump_call_stack(call_stack_t *call_stack, const char *key_buf, ...)
|
||||
gf_proc_dump_write("uid", "%d", call_stack->uid);
|
||||
gf_proc_dump_write("gid", "%d", call_stack->gid);
|
||||
gf_proc_dump_write("pid", "%d", call_stack->pid);
|
||||
gf_proc_dump_write("unique", "%Ld", call_stack->unique);
|
||||
gf_proc_dump_write("unique", "%" PRIu64, call_stack->unique);
|
||||
gf_proc_dump_write("lk-owner", "%s", lkowner_utoa(&call_stack->lk_owner));
|
||||
gf_proc_dump_write("ctime", "%lld.%" GF_PRI_SNSECONDS,
|
||||
gf_proc_dump_write("ctime", "%" GF_PRI_SECOND ".%" GF_PRI_SNSECONDS,
|
||||
call_stack->tv.tv_sec, call_stack->tv.tv_nsec);
|
||||
|
||||
if (call_stack->type == GF_OP_TYPE_FOP)
|
||||
@ -224,7 +224,7 @@ gf_proc_dump_pending_frames(call_pool_t *call_pool)
|
||||
gf_proc_dump_add_section("global.callpool");
|
||||
section_added = _gf_true;
|
||||
gf_proc_dump_write("callpool_address", "%p", call_pool);
|
||||
gf_proc_dump_write("callpool.cnt", "%d", call_pool->cnt);
|
||||
gf_proc_dump_write("callpool.cnt", "%" PRId64, call_pool->cnt);
|
||||
|
||||
list_for_each_entry(trav, &call_pool->all_frames, all_frames)
|
||||
{
|
||||
|
@ -255,12 +255,13 @@ gf_proc_dump_xlator_mem_info_only_in_use(xlator_t *xl)
|
||||
gf_proc_dump_add_section("%s.%s - usage-type %d", xl->type, xl->name,
|
||||
i);
|
||||
|
||||
gf_proc_dump_write("size", "%u", xl->mem_acct->rec[i].size);
|
||||
gf_proc_dump_write("max_size", "%u", xl->mem_acct->rec[i].max_size);
|
||||
gf_proc_dump_write("size", "%" PRIu64, xl->mem_acct->rec[i].size);
|
||||
gf_proc_dump_write("max_size", "%" PRIu64,
|
||||
xl->mem_acct->rec[i].max_size);
|
||||
gf_proc_dump_write("num_allocs", "%u", xl->mem_acct->rec[i].num_allocs);
|
||||
gf_proc_dump_write("max_num_allocs", "%u",
|
||||
xl->mem_acct->rec[i].max_num_allocs);
|
||||
gf_proc_dump_write("total_allocs", "%u",
|
||||
gf_proc_dump_write("total_allocs", "%" PRIu64,
|
||||
xl->mem_acct->rec[i].total_allocs);
|
||||
}
|
||||
|
||||
@ -379,8 +380,8 @@ gf_proc_dump_mempool_info(glusterfs_ctx_t *ctx)
|
||||
gf_proc_dump_write("-----", "-----");
|
||||
gf_proc_dump_write("pool-name", "%s", pool->name);
|
||||
gf_proc_dump_write("active-count", "%" GF_PRI_ATOMIC, active);
|
||||
gf_proc_dump_write("sizeof-type", "%d", pool->sizeof_type);
|
||||
gf_proc_dump_write("padded-sizeof", "%lu",
|
||||
gf_proc_dump_write("sizeof-type", "%lu", pool->sizeof_type);
|
||||
gf_proc_dump_write("padded-sizeof", "%d",
|
||||
1 << pool->pool->power_of_two);
|
||||
gf_proc_dump_write("size", "%lu",
|
||||
(1 << pool->pool->power_of_two) * active);
|
||||
@ -466,7 +467,7 @@ gf_proc_dump_dict_info(glusterfs_ctx_t *ctx)
|
||||
total_dicts = GF_ATOMIC_GET(ctx->stats.total_dicts_used);
|
||||
total_pairs = GF_ATOMIC_GET(ctx->stats.total_pairs_used);
|
||||
|
||||
gf_proc_dump_write("max-pairs-per-dict", "%u",
|
||||
gf_proc_dump_write("max-pairs-per-dict", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ctx->stats.max_dict_pairs));
|
||||
gf_proc_dump_write("total-pairs-used", "%lu", total_pairs);
|
||||
gf_proc_dump_write("total-dicts-used", "%lu", total_dicts);
|
||||
|
@ -81,10 +81,12 @@ void
|
||||
gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx);
|
||||
|
||||
int
|
||||
gf_proc_dump_add_section(char *key, ...);
|
||||
gf_proc_dump_add_section(char *key, ...)
|
||||
__attribute__((__format__(__printf__, 1, 2)));
|
||||
|
||||
int
|
||||
gf_proc_dump_write(char *key, char *value, ...);
|
||||
gf_proc_dump_write(char *key, char *value, ...)
|
||||
__attribute__((__format__(__printf__, 2, 3)));
|
||||
|
||||
void
|
||||
inode_table_dump(inode_table_t *itable, char *prefix);
|
||||
|
@ -564,10 +564,10 @@ rpcsvc_drc_priv(rpcsvc_drc_globals_t *drc)
|
||||
gf_proc_dump_write(key, "%d", drc->lru_factor);
|
||||
|
||||
gf_proc_dump_build_key(key, "drc", "duplicate_request_count");
|
||||
gf_proc_dump_write(key, "%d", drc->cache_hits);
|
||||
gf_proc_dump_write(key, "%" PRIu64, drc->cache_hits);
|
||||
|
||||
gf_proc_dump_build_key(key, "drc", "in_transit_duplicate_requests");
|
||||
gf_proc_dump_write(key, "%d", drc->intransit_hits);
|
||||
gf_proc_dump_write(key, "%" PRIu64, drc->intransit_hits);
|
||||
|
||||
list_for_each_entry(client, &drc->clients_head, client_list)
|
||||
{
|
||||
|
@ -4860,7 +4860,7 @@ afr_priv_dump(xlator_t *this)
|
||||
|
||||
GF_ASSERT(priv);
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
gf_proc_dump_write("child_count", "%u", priv->child_count);
|
||||
for (i = 0; i < priv->child_count; i++) {
|
||||
sprintf(key, "child_up[%d]", i);
|
||||
@ -4897,7 +4897,7 @@ afr_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_write("ta_child_up", "%d", priv->ta_child_up);
|
||||
gf_proc_dump_write("ta_bad_child_index", "%d",
|
||||
priv->ta_bad_child_index);
|
||||
gf_proc_dump_write("ta_notify_dom_lock_offset", "%lld",
|
||||
gf_proc_dump_write("ta_notify_dom_lock_offset", "%" PRId64,
|
||||
priv->ta_notify_dom_lock_offset);
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ dht_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_write(key, "%lf", conf->du_stats[i].avail_inodes);
|
||||
|
||||
snprintf(key, sizeof(key), "du_stats[%d].log", i);
|
||||
gf_proc_dump_write(key, "%lu", conf->du_stats[i].log);
|
||||
gf_proc_dump_write(key, "%" PRIu32, conf->du_stats[i].log);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1380,7 +1380,7 @@ ec_dump_private(xlator_t *this)
|
||||
GF_ASSERT(ec);
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
gf_proc_dump_write("up", "%u", ec->up);
|
||||
gf_proc_dump_write("nodes", "%u", ec->nodes);
|
||||
gf_proc_dump_write("redundancy", "%u", ec->redundancy);
|
||||
@ -1400,21 +1400,21 @@ ec_dump_private(xlator_t *this)
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s.stats.stripe_cache",
|
||||
this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("hits", "%llu",
|
||||
gf_proc_dump_write("hits", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.hits));
|
||||
gf_proc_dump_write("misses", "%llu",
|
||||
gf_proc_dump_write("misses", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.misses));
|
||||
gf_proc_dump_write("updates", "%llu",
|
||||
gf_proc_dump_write("updates", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.updates));
|
||||
gf_proc_dump_write("invalidations", "%llu",
|
||||
gf_proc_dump_write("invalidations", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.invals));
|
||||
gf_proc_dump_write("evicts", "%llu",
|
||||
gf_proc_dump_write("evicts", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.evicts));
|
||||
gf_proc_dump_write("allocations", "%llu",
|
||||
gf_proc_dump_write("allocations", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.allocs));
|
||||
gf_proc_dump_write("errors", "%llu",
|
||||
gf_proc_dump_write("errors", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(ec->stats.stripe_cache.errors));
|
||||
|
||||
return 0;
|
||||
|
@ -77,7 +77,7 @@ dump_history_trace(circular_buffer_t *cb, void *data)
|
||||
".%" GF_PRI_SUSECONDS, cb->tv.tv_usec);
|
||||
gf_proc_dump_write("TIME", "%s", timestr);
|
||||
|
||||
gf_proc_dump_write("FOP", "%s\n", cb->data);
|
||||
gf_proc_dump_write("FOP", "%s\n", (char *)cb->data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -3218,7 +3218,7 @@ trace_dump_history(xlator_t *this)
|
||||
// Is it ok to return silently if log-history option his off?
|
||||
if (conf && conf->log_history == _gf_true) {
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.debug.trace", "history");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
eh_dump(this->history, NULL, dump_history_trace);
|
||||
}
|
||||
ret = 0;
|
||||
|
@ -283,7 +283,7 @@ jbrc_priv_dump(xlator_t *this)
|
||||
GF_VALIDATE_OR_GOTO(this->name, priv, out);
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("up_children", "%u", priv->up_children);
|
||||
|
||||
|
@ -721,7 +721,7 @@ __barrier_dump_queue(barrier_priv_t *priv)
|
||||
list_for_each_entry(stub, &priv->queue, list)
|
||||
{
|
||||
snprintf(key, sizeof(key), "stub.%d", i++);
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
barrier_dump_stub(stub, key);
|
||||
}
|
||||
|
||||
@ -745,7 +745,7 @@ barrier_dump_priv(xlator_t *this)
|
||||
return 0;
|
||||
|
||||
gf_proc_dump_build_key(key, "xlator.features.barrier", "priv");
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
|
||||
LOCK(&priv->lock);
|
||||
{
|
||||
|
@ -1365,7 +1365,7 @@ ga_dump_inodectx(xlator_t *this, inode_t *inode)
|
||||
if (ret == 0) {
|
||||
tmp_inode = (void *)(uintptr_t)value;
|
||||
gf_proc_dump_build_key(key_prefix, this->name, "inode");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
gf_proc_dump_write("real-gfid", "%s", uuid_utoa(tmp_inode->gfid));
|
||||
}
|
||||
|
||||
|
@ -3224,7 +3224,7 @@ __dump_entrylks(pl_inode_t *pl_inode)
|
||||
lock->connection_id, blocked, granted);
|
||||
}
|
||||
|
||||
gf_proc_dump_write(key, tmp);
|
||||
gf_proc_dump_write(key, "%s", tmp);
|
||||
|
||||
count++;
|
||||
}
|
||||
@ -3242,7 +3242,7 @@ __dump_entrylks(pl_inode_t *pl_inode)
|
||||
lkowner_utoa(&lock->owner), lock->client, lock->connection_id,
|
||||
blocked);
|
||||
|
||||
gf_proc_dump_write(key, tmp);
|
||||
gf_proc_dump_write(key, "%s", tmp);
|
||||
|
||||
count++;
|
||||
}
|
||||
@ -3286,7 +3286,7 @@ __dump_inodelks(pl_inode_t *pl_inode)
|
||||
lock->client, lock->connection_id,
|
||||
&lock->granted_time.tv_sec, &lock->blkd_time.tv_sec,
|
||||
_gf_true);
|
||||
gf_proc_dump_write(key, tmp);
|
||||
gf_proc_dump_write(key, "%s", tmp);
|
||||
|
||||
count++;
|
||||
}
|
||||
@ -3299,7 +3299,7 @@ __dump_inodelks(pl_inode_t *pl_inode)
|
||||
pl_dump_lock(tmp, sizeof(tmp), &lock->user_flock, &lock->owner,
|
||||
lock->client, lock->connection_id, 0,
|
||||
&lock->blkd_time.tv_sec, _gf_false);
|
||||
gf_proc_dump_write(key, tmp);
|
||||
gf_proc_dump_write(key, "%s", tmp);
|
||||
|
||||
count++;
|
||||
}
|
||||
@ -3334,7 +3334,7 @@ __dump_posixlks(pl_inode_t *pl_inode)
|
||||
lock->client, NULL, &lock->granted_time.tv_sec,
|
||||
&lock->blkd_time.tv_sec,
|
||||
(lock->blocked) ? _gf_false : _gf_true);
|
||||
gf_proc_dump_write(key, tmp);
|
||||
gf_proc_dump_write(key, "%s", tmp);
|
||||
|
||||
count++;
|
||||
}
|
||||
|
@ -5125,7 +5125,7 @@ quota_priv_dump(xlator_t *this)
|
||||
if (!priv)
|
||||
goto out;
|
||||
|
||||
gf_proc_dump_add_section("xlators.features.quota.priv", this->name);
|
||||
gf_proc_dump_add_section("xlators.features.quota.priv");
|
||||
|
||||
ret = TRY_LOCK(&priv->lock);
|
||||
if (ret)
|
||||
|
@ -6759,12 +6759,12 @@ shard_priv_dump(xlator_t *this)
|
||||
priv = this->private;
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
str = gf_uint64_2human_readable(priv->block_size);
|
||||
gf_proc_dump_write("shard-block-size", "%s", str);
|
||||
gf_proc_dump_write("inode-count", "%d", priv->inode_count);
|
||||
gf_proc_dump_write("ilist_head", "%p", &priv->ilist_head);
|
||||
gf_proc_dump_write("lru-max-limit", "%d", priv->lru_limit);
|
||||
gf_proc_dump_write("lru-max-limit", "%" PRIu64, priv->lru_limit);
|
||||
|
||||
GF_FREE(str);
|
||||
|
||||
|
@ -2173,7 +2173,7 @@ glusterd_op_stage_quota(dict_t *dict, char **op_errstr, dict_t *rsp_dict)
|
||||
gf_asprintf(op_errstr,
|
||||
"Hard-limit "
|
||||
"value out of range (0 - %" PRId64 "): %s",
|
||||
hard_limit_str);
|
||||
hard_limit, hard_limit_str);
|
||||
else
|
||||
gf_msg(this->name, GF_LOG_ERROR, errno,
|
||||
GD_MSG_CONVERSION_FAILED,
|
||||
|
@ -304,7 +304,7 @@ glusterd_handle_defrag_start(glusterd_volinfo_t *volinfo, char *op_errstr,
|
||||
runner_add_arg(&runner, "--pid-file");
|
||||
runner_argprintf(&runner, "%s", pidfile);
|
||||
runner_add_arg(&runner, "-l");
|
||||
runner_argprintf(&runner, logfile);
|
||||
runner_argprintf(&runner, "%s", logfile);
|
||||
if (volinfo->memory_accounting)
|
||||
runner_add_arg(&runner, "--mem-accounting");
|
||||
if (dict_get_strn(priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
|
||||
|
@ -180,7 +180,7 @@ glusterd_dump_priv(xlator_t *this)
|
||||
return 0;
|
||||
|
||||
gf_proc_dump_build_key(key, "xlator.glusterd", "priv");
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
|
||||
pthread_mutex_lock(&priv->mutex);
|
||||
{
|
||||
|
@ -5290,7 +5290,7 @@ fuse_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_write("proto_minor", "%u", private->proto_minor);
|
||||
gf_proc_dump_write("volfile", "%s",
|
||||
private->volfile ? private->volfile : "None");
|
||||
gf_proc_dump_write("volfile_size", "%d", private->volfile_size);
|
||||
gf_proc_dump_write("volfile_size", "%" GF_PRI_SIZET, private->volfile_size);
|
||||
gf_proc_dump_write("mount_point", "%s", private->mount_point);
|
||||
gf_proc_dump_write("fuse_thread_started", "%d",
|
||||
(int)private->fuse_thread_started);
|
||||
@ -5324,7 +5324,7 @@ fuse_history_dump(xlator_t *this)
|
||||
GF_VALIDATE_OR_GOTO(this->name, this->history, out);
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.mount.fuse", "history");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
eh_dump(this->history, NULL, dump_history_fuse);
|
||||
|
||||
ret = 0;
|
||||
@ -5345,7 +5345,7 @@ dump_history_fuse(circular_buffer_t *cb, void *data)
|
||||
".%" GF_PRI_SUSECONDS, cb->tv.tv_usec);
|
||||
gf_proc_dump_write("TIME", "%s", timestr);
|
||||
|
||||
gf_proc_dump_write("message", "%s\n", cb->data);
|
||||
gf_proc_dump_write("message", "%s\n", (char *)cb->data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1868,7 +1868,7 @@ __ioc_page_dump(ioc_page_t *page, char *prefix)
|
||||
goto out;
|
||||
{
|
||||
gf_proc_dump_write("offset", "%" PRId64, page->offset);
|
||||
gf_proc_dump_write("size", "%" PRId64, page->size);
|
||||
gf_proc_dump_write("size", "%" GF_PRI_SIZET, page->size);
|
||||
gf_proc_dump_write("dirty", "%s", page->dirty ? "yes" : "no");
|
||||
gf_proc_dump_write("ready", "%s", page->ready ? "yes" : "no");
|
||||
ioc_page_waitq_dump(page, prefix);
|
||||
@ -1962,7 +1962,7 @@ ioc_inode_dump(xlator_t *this, inode_t *inode)
|
||||
if (gf_uuid_is_null(ioc_inode->inode->gfid))
|
||||
goto unlock;
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
section_added = _gf_true;
|
||||
|
||||
__inode_path(ioc_inode->inode, NULL, &path);
|
||||
@ -1985,7 +1985,7 @@ unlock:
|
||||
out:
|
||||
if (ret && ioc_inode) {
|
||||
if (section_added == _gf_false)
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
gf_proc_dump_write("Unable to print the status of ioc_inode",
|
||||
"(Lock acquisition failed) %s",
|
||||
uuid_utoa(inode->gfid));
|
||||
@ -2009,7 +2009,7 @@ ioc_priv_dump(xlator_t *this)
|
||||
priv = this->private;
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "io-cache", "priv");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
add_section = _gf_true;
|
||||
|
||||
ret = pthread_mutex_trylock(&priv->table_lock);
|
||||
@ -2021,8 +2021,8 @@ ioc_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_write("cache_used", "%ld", priv->cache_used);
|
||||
gf_proc_dump_write("inode_count", "%u", priv->inode_count);
|
||||
gf_proc_dump_write("cache_timeout", "%u", priv->cache_timeout);
|
||||
gf_proc_dump_write("min-file-size", "%u", priv->min_file_size);
|
||||
gf_proc_dump_write("max-file-size", "%u", priv->max_file_size);
|
||||
gf_proc_dump_write("min-file-size", "%" PRIu64, priv->min_file_size);
|
||||
gf_proc_dump_write("max-file-size", "%" PRIu64, priv->max_file_size);
|
||||
}
|
||||
pthread_mutex_unlock(&priv->table_lock);
|
||||
out:
|
||||
@ -2032,7 +2032,7 @@ out:
|
||||
"xlator."
|
||||
"performance.io-cache",
|
||||
"priv");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
}
|
||||
gf_proc_dump_write(
|
||||
"Unable to dump the state of private "
|
||||
|
@ -937,7 +937,7 @@ iot_priv_dump(xlator_t *this)
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("maximum_threads_count", "%d", conf->max_count);
|
||||
gf_proc_dump_write("current_threads_count", "%d", conf->curr_count);
|
||||
|
@ -3063,7 +3063,7 @@ mdc_priv_dump(xlator_t *this)
|
||||
conf = this->private;
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("stat_hit_count", "%" PRId64,
|
||||
GF_ATOMIC_GET(conf->mdc_counter.stat_hit));
|
||||
|
@ -1161,7 +1161,7 @@ nlc_dump_inodectx(xlator_t *this, inode_t *inode)
|
||||
if (!ret) {
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.nl-cache",
|
||||
"nlc_inode");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
__inode_path(inode, NULL, &path);
|
||||
if (path != NULL) {
|
||||
@ -1176,14 +1176,14 @@ nlc_dump_inodectx(xlator_t *this, inode_t *inode)
|
||||
|
||||
gf_proc_dump_write("state", "%" PRIu64, nlc_ctx->state);
|
||||
gf_proc_dump_write("timer", "%p", nlc_ctx->timer);
|
||||
gf_proc_dump_write("cache-time", "%lld", nlc_ctx->cache_time);
|
||||
gf_proc_dump_write("cache-time", "%" GF_PRI_TIME, nlc_ctx->cache_time);
|
||||
gf_proc_dump_write("cache-size", "%zu", nlc_ctx->cache_size);
|
||||
gf_proc_dump_write("refd-inodes", "%" PRIu64, nlc_ctx->refd_inodes);
|
||||
|
||||
if (IS_PE_VALID(nlc_ctx->state))
|
||||
list_for_each_entry_safe(pe, tmp, &nlc_ctx->pe, list)
|
||||
{
|
||||
gf_proc_dump_write("pe", "%p, %s", pe, pe->inode, pe->name);
|
||||
gf_proc_dump_write("pe", "%p, %p, %s", pe, pe->inode, pe->name);
|
||||
}
|
||||
|
||||
if (IS_NE_VALID(nlc_ctx->state))
|
||||
|
@ -588,7 +588,7 @@ nlc_priv_dump(xlator_t *this)
|
||||
conf = this->private;
|
||||
|
||||
snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("negative_lookup_hit_count", "%" PRId64,
|
||||
GF_ATOMIC_GET(conf->nlc_counter.nlc_hit));
|
||||
|
@ -1130,7 +1130,7 @@ ob_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.open-behind",
|
||||
"priv");
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("use_anonymous_fd", "%d", conf->use_anonymous_fd);
|
||||
|
||||
@ -1160,14 +1160,14 @@ ob_fdctx_dump(xlator_t *this, fd_t *fd)
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.open-behind",
|
||||
"file");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("fd", "%p", fd);
|
||||
|
||||
gf_proc_dump_write("open_frame", "%p", ob_fd->open_frame);
|
||||
|
||||
if (ob_fd->open_frame)
|
||||
gf_proc_dump_write("open_frame.root.unique", "%p",
|
||||
gf_proc_dump_write("open_frame.root.unique", "%" PRIu64,
|
||||
ob_fd->open_frame->root->unique);
|
||||
|
||||
gf_proc_dump_write("loc.path", "%s", ob_fd->loc.path);
|
||||
|
@ -1044,7 +1044,7 @@ qr_inodectx_dump(xlator_t *this, inode_t *inode)
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.quick-read",
|
||||
"inodectx");
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("entire-file-cached", "%s",
|
||||
qr_inode->data ? "yes" : "no");
|
||||
@ -1088,9 +1088,9 @@ qr_priv_dump(xlator_t *this)
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.quick-read", "priv");
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("max_file_size", "%d", conf->max_file_size);
|
||||
gf_proc_dump_write("max_file_size", "%" PRIu64, conf->max_file_size);
|
||||
gf_proc_dump_write("cache_timeout", "%d", conf->cache_timeout);
|
||||
|
||||
if (!table) {
|
||||
@ -1106,11 +1106,13 @@ qr_priv_dump(xlator_t *this)
|
||||
}
|
||||
|
||||
gf_proc_dump_write("total_files_cached", "%d", file_count);
|
||||
gf_proc_dump_write("total_cache_used", "%d", total_size);
|
||||
gf_proc_dump_write("cache-hit", "%" PRId64, priv->qr_counter.cache_hit);
|
||||
gf_proc_dump_write("cache-miss", "%" PRId64, priv->qr_counter.cache_miss);
|
||||
gf_proc_dump_write("cache-invalidations", "%" PRId64,
|
||||
priv->qr_counter.file_data_invals);
|
||||
gf_proc_dump_write("total_cache_used", "%" PRIu64, total_size);
|
||||
gf_proc_dump_write("cache-hit", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(priv->qr_counter.cache_hit));
|
||||
gf_proc_dump_write("cache-miss", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(priv->qr_counter.cache_miss));
|
||||
gf_proc_dump_write("cache-invalidations", "%" GF_PRI_ATOMIC,
|
||||
GF_ATOMIC_GET(priv->qr_counter.file_data_invals));
|
||||
|
||||
out:
|
||||
return 0;
|
||||
|
@ -744,7 +744,7 @@ ra_page_dump(struct ra_page *page)
|
||||
|
||||
gf_proc_dump_write("offset", "%" PRId64, page->offset);
|
||||
|
||||
gf_proc_dump_write("size", "%" PRId64, page->size);
|
||||
gf_proc_dump_write("size", "%" GF_PRI_SIZET, page->size);
|
||||
|
||||
gf_proc_dump_write("dirty", "%s", page->dirty ? "yes" : "no");
|
||||
|
||||
@ -770,9 +770,6 @@ ra_fdctx_dump(xlator_t *this, fd_t *fd)
|
||||
int32_t ret = 0, i = 0;
|
||||
uint64_t tmp_file = 0;
|
||||
char *path = NULL;
|
||||
char key[GF_DUMP_MAX_BUF_LEN] = {
|
||||
0,
|
||||
};
|
||||
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {
|
||||
0,
|
||||
};
|
||||
@ -787,7 +784,7 @@ ra_fdctx_dump(xlator_t *this, fd_t *fd)
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.read-ahead", "file");
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
ret = __inode_path(fd->inode, NULL, &path);
|
||||
if (path != NULL) {
|
||||
@ -812,8 +809,7 @@ ra_fdctx_dump(xlator_t *this, fd_t *fd)
|
||||
file->offset);
|
||||
|
||||
for (page = file->pages.next; page != &file->pages; page = page->next) {
|
||||
sprintf(key, "page[%d]", i);
|
||||
gf_proc_dump_write(key, "%p", page[i++]);
|
||||
gf_proc_dump_write("page", "%d: %p", i++, (void *)page);
|
||||
ra_page_dump(page);
|
||||
}
|
||||
|
||||
@ -1040,14 +1036,14 @@ ra_priv_dump(xlator_t *this)
|
||||
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.read-ahead", "priv");
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
add_section = _gf_true;
|
||||
|
||||
ret = pthread_mutex_trylock(&conf->conf_lock);
|
||||
if (ret)
|
||||
goto out;
|
||||
{
|
||||
gf_proc_dump_write("page_size", "%d", conf->page_size);
|
||||
gf_proc_dump_write("page_size", "%" PRIu64, conf->page_size);
|
||||
gf_proc_dump_write("page_count", "%d", conf->page_count);
|
||||
gf_proc_dump_write("force_atime_update", "%d",
|
||||
conf->force_atime_update);
|
||||
@ -1058,7 +1054,7 @@ ra_priv_dump(xlator_t *this)
|
||||
out:
|
||||
if (ret && conf) {
|
||||
if (add_section == _gf_false)
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("Unable to dump priv",
|
||||
"(Lock acquisition failed) %s", this->name);
|
||||
|
@ -2843,10 +2843,10 @@ wb_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.write-behind",
|
||||
"priv");
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("aggregate_size", "%d", conf->aggregate_size);
|
||||
gf_proc_dump_write("window_size", "%d", conf->window_size);
|
||||
gf_proc_dump_write("aggregate_size", "%" PRIu64, conf->aggregate_size);
|
||||
gf_proc_dump_write("window_size", "%" PRIu64, conf->window_size);
|
||||
gf_proc_dump_write("flush_behind", "%d", conf->flush_behind);
|
||||
gf_proc_dump_write("trickling_writes", "%d", conf->trickling_writes);
|
||||
|
||||
@ -2873,7 +2873,7 @@ __wb_dump_requests(struct list_head *head, char *prefix)
|
||||
gf_proc_dump_build_key(key_prefix, key, "%s",
|
||||
(char *)gf_fop_list[req->fop]);
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
gf_proc_dump_write("unique", "%" PRIu64, req->unique);
|
||||
|
||||
@ -2884,7 +2884,7 @@ __wb_dump_requests(struct list_head *head, char *prefix)
|
||||
else
|
||||
gf_proc_dump_write("wound", "no");
|
||||
|
||||
gf_proc_dump_write("generation-number", "%d", req->gen);
|
||||
gf_proc_dump_write("generation-number", "%" PRIu64, req->gen);
|
||||
|
||||
gf_proc_dump_write("req->op_ret", "%d", req->op_ret);
|
||||
gf_proc_dump_write("req->op_errno", "%d", req->op_errno);
|
||||
@ -2946,7 +2946,7 @@ wb_inode_dump(xlator_t *this, inode_t *inode)
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.performance.write-behind",
|
||||
"wb_inode");
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
__inode_path(inode, NULL, &path);
|
||||
if (path != NULL) {
|
||||
|
@ -50,7 +50,7 @@ template_priv(xlator_t *this)
|
||||
template_private_t *priv = NULL;
|
||||
|
||||
priv = this->private;
|
||||
gf_proc_dump_write("template.dummy", "%lu", priv->dummy);
|
||||
gf_proc_dump_write("template.dummy", "%" PRId32, priv->dummy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2796,13 +2796,13 @@ client_priv_dump(xlator_t *this)
|
||||
gf_proc_dump_build_key(key_prefix, "xlator.protocol.client", "%s.priv",
|
||||
this->name);
|
||||
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
pthread_spin_lock(&conf->fd_lock);
|
||||
list_for_each_entry(tmp, &conf->saved_fds, sfd_pos)
|
||||
{
|
||||
sprintf(key, "fd.%d.remote_fd", i);
|
||||
gf_proc_dump_write(key, "%d", tmp->remote_fd);
|
||||
gf_proc_dump_write(key, "%" PRId64, tmp->remote_fd);
|
||||
client_fd_lk_ctx_dump(this, tmp->lk_ctx, i);
|
||||
i++;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ server_priv(xlator_t *this)
|
||||
return 0;
|
||||
|
||||
gf_proc_dump_build_key(key, "xlator.protocol.server", "priv");
|
||||
gf_proc_dump_add_section(key);
|
||||
gf_proc_dump_add_section("%s", key);
|
||||
|
||||
ret = pthread_mutex_trylock(&conf->mutex);
|
||||
if (ret != 0)
|
||||
|
@ -112,7 +112,7 @@ posix_priv(xlator_t *this)
|
||||
|
||||
(void)snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type,
|
||||
this->name);
|
||||
gf_proc_dump_add_section(key_prefix);
|
||||
gf_proc_dump_add_section("%s", key_prefix);
|
||||
|
||||
if (!this)
|
||||
return 0;
|
||||
@ -124,8 +124,8 @@ posix_priv(xlator_t *this)
|
||||
|
||||
gf_proc_dump_write("base_path", "%s", priv->base_path);
|
||||
gf_proc_dump_write("base_path_length", "%d", priv->base_path_length);
|
||||
gf_proc_dump_write("max_read", "%d", priv->read_value);
|
||||
gf_proc_dump_write("max_write", "%d", priv->write_value);
|
||||
gf_proc_dump_write("max_read", "%" PRId64, priv->read_value);
|
||||
gf_proc_dump_write("max_write", "%" PRId64, priv->write_value);
|
||||
gf_proc_dump_write("nr_files", "%ld", priv->nr_files);
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user