From c4029bb820bf695ff63b67a49a127633c34acb27 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 8 May 2018 13:34:35 +0530 Subject: cluster/dht: Debug logs in dht_readdir(p)_cbk Additional log messages to help debug issues with file listings. (cherry picked from commit d3e3b11d38b927cf849d2d7a20460650963fd438) Change-Id: Iccd07498ba01d597c0c40f026f4177dd06d7e901 fixes: bz#1579736 Signed-off-by: N Balachandran --- xlators/cluster/dht/src/dht-common.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 8e9959ca416..47521d160ee 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6460,8 +6460,16 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, if (conf->readdir_optimize == _gf_true) readdir_optimize = 1; + gf_msg_debug (this->name, 0, "Processing entries from %s", + prev->name); + list_for_each_entry (orig_entry, (&orig_entries->list), list) { next_offset = orig_entry->d_off; + + gf_msg_debug (this->name, 0, "%s: entry = %s, type = %d", + prev->name, orig_entry->d_name, + orig_entry->d_type); + if (IA_ISINVAL(orig_entry->d_stat.ia_type)) { /*stat failed somewhere- ignore this entry*/ gf_msg_debug (this->name, EINVAL, @@ -6504,6 +6512,8 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, if (check_is_linkfile (NULL, (&orig_entry->d_stat), orig_entry->dict, conf->link_xattr_name)) { + gf_msg_debug (this->name, 0, "%s: %s is a linkto file", + prev->name, orig_entry->d_name); continue; } @@ -6560,7 +6570,8 @@ list: gf_msg (this->name, GF_LOG_WARNING, 0, DHT_MSG_LAYOUT_SET_FAILED, "failed to link the layout " - "in inode"); + "in inode for %s", + orig_entry->d_name); entry->inode = inode_ref (orig_entry->inode); } else if (itable) { @@ -6583,13 +6594,17 @@ list: GF_LOG_WARNING, 0, DHT_MSG_LAYOUT_SET_FAILED, "failed to link the layout" - " in inode"); + " in inode for %s", + orig_entry->d_name); inode_unref (inode); inode = NULL; } } } + gf_msg_debug (this->name, 0, "%s: Adding entry = %s", + prev->name, entry->d_name); + list_add_tail (&entry->list, &local->entries.list); local->filled += gf_dirent_size (entry->d_name); count++; @@ -6697,9 +6712,16 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, layout = local->layout; + gf_msg_debug (this->name, 0, "Processing entries from %s", + prev->name); + list_for_each_entry (orig_entry, (&orig_entries->list), list) { next_offset = orig_entry->d_off; + gf_msg_debug (this->name, 0, "%s: entry = %s, type = %d", + prev->name, orig_entry->d_name, + orig_entry->d_type); + subvol = methods->layout_search (this, layout, orig_entry->d_name); @@ -6717,6 +6739,9 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, entry->d_type = orig_entry->d_type; entry->d_len = orig_entry->d_len; + gf_msg_debug (this->name, 0, "%s: Adding = entry %s", + prev->name, entry->d_name); + list_add_tail (&entry->list, &local->entries.list); count++; local->filled += gf_dirent_size (entry->d_name); -- cgit