glusterfs/0368-mount-fuse-convert-ENOENT-to-ESTALE-in-open-dir-_res.patch
Sunil Kumar Acharya be071b020b autobuild v3.12.2-19
Resolves: bz#1459709 bz#1610743 bz#1618221 bz#1619627 bz#1622649
Resolves: bz#1623749 bz#1623874 bz#1624444 bz#1625622 bz#1626780
Resolves: bz#1627098 bz#1627617 bz#1627639 bz#1630688
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
2018-09-21 23:36:36 -04:00

68 lines
2.6 KiB
Diff

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