summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-07-28 22:37:38 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-07-29 00:05:01 -0700
commitb20b3c68d32f6dba3f7e003f3ad9b86220d9fa25 (patch)
tree5d313af4c0bcbd2bbe720c3521c8c60d3ad1878d /xlators
parent1faf452818fe51fae1f07d17afab910a5e0da0cd (diff)
storage/posix: Look for file in "unlink" dir IFF open on real-path fails with ENOENT
PROBLEM: In some of our users' setups, open() on the anon fd failed for a reason other than ENOENT. But this error code is getting masked by a subsequent open() under posix's hidden "unlink" directory, which will fail with ENOENT because the gfid handle still exists under .glusterfs. And the log message following the two open()s ends up logging ENOENT, causing much confusion. FIX: Look for the presence of the file under "unlink" ONLY if the open() on the real_path failed with ENOENT. Change-Id: Ifb674dc7123f79fec9a9ac1ec7bf832f4df17627 BUG: 1361300 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/15039 Reviewed-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>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 8ad674e063f..36cee49696c 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -1665,7 +1665,7 @@ __posix_fd_ctx_get (fd_t *fd, xlator_t *this, struct posix_fd **pfd_p,
*/
if (fd->inode->ia_type == IA_IFREG) {
_fd = open (real_path, fd->flags);
- if (_fd == -1) {
+ if ((_fd == -1) && (errno == ENOENT)) {
POSIX_GET_FILE_UNLINK_PATH (priv->base_path,
fd->inode->gfid,
unlink_path);