summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-06-19 13:45:55 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-06-20 13:47:02 +0000
commit808608b33da4beb100d285cc8ed54afe6cb054bc (patch)
tree66630b0faadb0d0359c0ab6883b69182eaab162e
parent51eee2bf5c878920e83b118422e193fd087e0778 (diff)
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 <pkarampu@redhat.com> > Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> (cherry picked from commit 61924b98a61108a7ec453fb7f1fc5487d1386e56) Change-Id: Idcf5c65a47b096a3766cf7f20ca938d988572052 BUG: 1457616 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: https://review.gluster.org/17570 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--xlators/storage/posix/src/posix-helpers.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index cf03035c..69f61bf 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -1696,13 +1696,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;
@@ -1723,13 +1721,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;