d1681e
From b777482ac36960537be213c54490aec9e1077a1f Mon Sep 17 00:00:00 2001
d1681e
From: Raghavendra G <rgowdapp@redhat.com>
d1681e
Date: Fri, 13 Oct 2017 20:00:47 +0530
d1681e
Subject: [PATCH 109/128] mount/fuse: never fail open(dir) with ENOENT
d1681e
d1681e
open(dir) being an operation on inode should never fail with
d1681e
ENOENT. If gfid is not present, the appropriate error is ESTALE. This
d1681e
will enable kernel to retry open after a revalidate lookup.
d1681e
d1681e
Change-Id: I8d07d2ebb5a0da6c3ea478317442cb42f1797a4b
d1681e
BUG: 1492591
d1681e
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
d1681e
upstream patch: https://review.gluster.org/#/c/18521/
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/126510
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d1681e
---
d1681e
 xlators/mount/fuse/src/fuse-bridge.c | 7 +++++++
d1681e
 1 file changed, 7 insertions(+)
d1681e
d1681e
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
d1681e
index 74b59b8..a6dfd66 100644
d1681e
--- a/xlators/mount/fuse/src/fuse-bridge.c
d1681e
+++ b/xlators/mount/fuse/src/fuse-bridge.c
d1681e
@@ -1069,6 +1069,13 @@ fuse_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
d1681e
                 fd_bind (fd);
d1681e
         } else {
d1681e
         err:
d1681e
+                /* OPEN(DIR) being an operation on inode should never fail with
d1681e
+                 * ENOENT. If gfid is not present, the appropriate error is
d1681e
+                 * ESTALE.
d1681e
+                 */
d1681e
+                if (op_errno == ENOENT)
d1681e
+                        op_errno = ESTALE;
d1681e
+
d1681e
                 gf_log ("glusterfs-fuse", GF_LOG_WARNING,
d1681e
                         "%"PRIu64": %s() %s => -1 (%s)", frame->root->unique,
d1681e
                         gf_fop_list[frame->root->op], state->loc.path,
d1681e
-- 
d1681e
1.8.3.1
d1681e