a3470f
From de1ee9800f8e20d0c0a8adb1994f208d2dc8ae09 Mon Sep 17 00:00:00 2001
a3470f
From: Raghavendra G <rgowdapp@redhat.com>
a3470f
Date: Tue, 10 Oct 2017 11:29:04 +0530
a3470f
Subject: [PATCH 110/128] Revert "mount/fuse: report ESTALE as ENOENT"
a3470f
a3470f
This reverts commit 26d16b90ec7f8acbe07e56e8fe1baf9c9fa1519e.
a3470f
a3470f
Consider rename (index.new, store.idx) and open (store.idx) being
a3470f
executed in parallel. When we break down operations following sequence
a3470f
is possible.
a3470f
a3470f
* lookup (store.idx) - as part of open(store.idx) returns gfid1 as the
a3470f
  result.
a3470f
* rename (index.new, store.idx) changes gfid of store.idx to
a3470f
  gfid2. Note that gfid2 was the nodeid of index.new. Since rename is
a3470f
  successful, gfid2 is associated with store.idx.
a3470f
* open (store.idx) resumes and issues open fop to glusterfs with
a3470f
  gfid1. open in glusterfs fails as gfid1 doesn't exist and the error
a3470f
  returned by glusterfs to kernel-fuse is ENOENT.
a3470f
* kernel passes back the same error to application as a result to
a3470f
  open.
a3470f
a3470f
This error could've been prevented if kernel retries open with
a3470f
gfid2. Interestingly kernel do retry open when it receives ESTALE
a3470f
error. Even though failure to find gfid resulted in ESTALE error,
a3470f
commit 26d16b90ec7f8acb converted that error to ENOENT while sending
a3470f
an error reply to kernel. This prevented kernel from retrying open
a3470f
resulting in error.
a3470f
a3470f
Change-Id: I2e752ca60dd8af1b989dd1d29c7b002ee58440b4
a3470f
BUG: 1492591
a3470f
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
a3470f
upstream patch: https://review.gluster.org/#/c/18463/
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/126509
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
a3470f
---
a3470f
 xlators/mount/fuse/src/fuse-bridge.c | 3 ---
a3470f
 1 file changed, 3 deletions(-)
a3470f
a3470f
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
a3470f
index a6dfd66..03d26eb 100644
a3470f
--- a/xlators/mount/fuse/src/fuse-bridge.c
a3470f
+++ b/xlators/mount/fuse/src/fuse-bridge.c
a3470f
@@ -421,9 +421,6 @@ send_fuse_err (xlator_t *this, fuse_in_header_t *finh, int error)
a3470f
         struct iovec iov_out;
a3470f
         inode_t  *inode = NULL;
a3470f
 
a3470f
-        if (error == ESTALE)
a3470f
-                error = ENOENT;
a3470f
-
a3470f
         fouh.error = -error;
a3470f
         iov_out.iov_base = &fou;;
a3470f
 
a3470f
-- 
a3470f
1.8.3.1
a3470f