From 451fd20fc8be25d8b99d5e8dfcdb43eaa3f94c72 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 26 Jun 2018 10:40:08 +0530 Subject: storage/posix: Add warning logs on failure posix_readdirp_fill will fail to update the iatt information if posix_handle_path fails. There is currently no log message to indicate this making debugging difficult. Change-Id: I6bce360ea7d1696501637433f80e02794fe1368f updates: bz#1564071 Signed-off-by: N Balachandran --- xlators/storage/posix/src/posix-inode-fd-ops.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index ccddf0ed745..2ebdd1a8bf1 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -5025,11 +5025,21 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic itable = fd->inode->table; len = posix_handle_path (this, fd->inode->gfid, NULL, NULL, 0); - if (len <= 0) + if (len <= 0) { + gf_msg (this->name, GF_LOG_WARNING, 0, P_MSG_HANDLEPATH_FAILED, + "Failed to create handle path, fd=%p, gfid=%s", + fd, uuid_utoa (fd->inode->gfid)); return -1; + } + hpath = alloca (len + 256); /* NAME_MAX */ - if (posix_handle_path (this, fd->inode->gfid, NULL, hpath, len) <= 0) + if (posix_handle_path (this, fd->inode->gfid, NULL, hpath, len) <= 0) { + gf_msg (this->name, GF_LOG_WARNING, 0, P_MSG_HANDLEPATH_FAILED, + "Failed to create handle path, fd=%p, gfid=%s", + fd, uuid_utoa (fd->inode->gfid)); return -1; + } + len = strlen (hpath); hpath[len] = '/'; -- cgit