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