e7a346
From 3a392704f61915217f4f8210e1dd94901d6938bb Mon Sep 17 00:00:00 2001
e7a346
From: Raghavendra G <rgowdapp@redhat.com>
e7a346
Date: Tue, 11 Sep 2018 10:31:27 +0530
e7a346
Subject: [PATCH 368/385] mount/fuse: convert ENOENT to ESTALE in
e7a346
 open(dir)_resume
e7a346
e7a346
This patch is continuation of commit
e7a346
fb4b914ce84bc83a5f418719c5ba7c25689a9251.
e7a346
e7a346
<snip>
e7a346
mount/fuse: never fail open(dir) with ENOENT
e7a346
e7a346
    open(dir) being an operation on inode should never fail with
e7a346
    ENOENT. If gfid is not present, the appropriate error is
e7a346
    ESTALE. This will enable kernel to retry open after a revalidate
e7a346
    lookup.
e7a346
</snip>
e7a346
e7a346
Earlier commit failed to fix codepath where error response is sent
e7a346
back on gfid resolution failures in fuse_open(dir)_resume. Current
e7a346
patch completes that work
e7a346
e7a346
>Change-Id: Ia07e3cece404811703c8cfbac9b402ca5fe98c1e
e7a346
>Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
e7a346
>updates: bz#1627620
e7a346
e7a346
Change-Id: Ia07e3cece404811703c8cfbac9b402ca5fe98c1e
e7a346
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
e7a346
BUG: 1627617
e7a346
upstream patch: https://review.gluster.org/#/c/glusterfs/+/21146/
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/150109
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e7a346
---
e7a346
 xlators/mount/fuse/src/fuse-bridge.c | 9 +++++++++
e7a346
 1 file changed, 9 insertions(+)
e7a346
e7a346
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
e7a346
index b767ea4..85cee73 100644
e7a346
--- a/xlators/mount/fuse/src/fuse-bridge.c
e7a346
+++ b/xlators/mount/fuse/src/fuse-bridge.c
e7a346
@@ -2235,6 +2235,10 @@ fuse_open_resume (fuse_state_t *state)
e7a346
                         "%"PRIu64": OPEN %s resolution failed",
e7a346
                         state->finh->unique, uuid_utoa (state->resolve.gfid));
e7a346
 
e7a346
+                /* facilitate retry from VFS */
e7a346
+                if (state->resolve.op_errno == ENOENT)
e7a346
+                        state->resolve.op_errno = ESTALE;
e7a346
+
e7a346
                 send_fuse_err (state->this, state->finh,
e7a346
                                state->resolve.op_errno);
e7a346
                 free_fuse_state (state);
e7a346
@@ -2687,6 +2691,11 @@ fuse_opendir_resume (fuse_state_t *state)
e7a346
                 gf_log ("glusterfs-fuse", GF_LOG_WARNING,
e7a346
                         "%"PRIu64": OPENDIR (%s) resolution failed",
e7a346
                         state->finh->unique, uuid_utoa (state->resolve.gfid));
e7a346
+
e7a346
+                /* facilitate retry from VFS */
e7a346
+                if (state->resolve.op_errno == ENOENT)
e7a346
+                        state->resolve.op_errno = ESTALE;
e7a346
+
e7a346
                 send_fuse_err (state->this, state->finh,
e7a346
                                state->resolve.op_errno);
e7a346
                 free_fuse_state (state);
e7a346
-- 
e7a346
1.8.3.1
e7a346