From 34b136a8b55a2518529e2bdc43de99e43868dde8 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Mon, 19 Jun 2017 13:45:55 +0530 Subject: posix: Revert modifying op_errno in __posix_fd_ctx_get https://review.gluster.org/#/c/17414/ converted ENOENT to EBADFD because ENOENT is not a valid error for fd based operations, but this apparently breaks dht rebalance behaviour (see comments in the backport 17517. So reverting that part of the change. > Reviewed-on: https://review.gluster.org/17565 > Reviewed-by: Pranith Kumar Karampuri > Tested-by: Pranith Kumar Karampuri > Smoke: Gluster Build System > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System (cherry picked from commit 61924b98a61108a7ec453fb7f1fc5487d1386e56) Change-Id: Idcf5c65a47b096a3766cf7f20ca938d988572052 BUG: 1457732 Signed-off-by: Ravishankar N Reviewed-on: https://review.gluster.org/17571 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri CentOS-regression: Gluster Build System --- xlators/storage/posix/src/posix-helpers.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'xlators') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index d39a77bbe06..9b945c271bc 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -1695,13 +1695,11 @@ __posix_fd_ctx_get (fd_t *fd, xlator_t *this, struct posix_fd **pfd_p, if (fd->inode->ia_type == IA_IFDIR) { dir = sys_opendir (real_path); if (!dir) { - (errno == ENOENT) ? (op_errno = EBADF) : - (op_errno = errno); - gf_msg (this->name, GF_LOG_ERROR, errno, + op_errno = errno; + gf_msg (this->name, GF_LOG_ERROR, op_errno, P_MSG_READ_FAILED, "Failed to get anonymous fd for " - "real_path: %s. Returning %s.", real_path, - strerror(op_errno)); + "real_path: %s.", real_path); GF_FREE (pfd); pfd = NULL; goto out; @@ -1722,13 +1720,11 @@ __posix_fd_ctx_get (fd_t *fd, xlator_t *this, struct posix_fd **pfd_p, _fd = open (unlink_path, fd->flags); } if (_fd == -1) { - (errno == ENOENT) ? (op_errno = EBADF) : - (op_errno = errno); - gf_msg (this->name, GF_LOG_ERROR, errno, + op_errno = errno; + gf_msg (this->name, GF_LOG_ERROR, op_errno, P_MSG_READ_FAILED, "Failed to get anonymous fd for " - "real_path: %s. Returning %s.", real_path, - strerror(op_errno)); + "real_path: %s.", real_path); GF_FREE (pfd); pfd = NULL; goto out; -- cgit