12a457
From e7c003c517773fb5daa14dac6bde13e850e5df90 Mon Sep 17 00:00:00 2001
12a457
From: Raghavendra G <rgowdapp@redhat.com>
12a457
Date: Wed, 23 Mar 2016 13:47:27 +0530
12a457
Subject: [PATCH 083/104] mount/fuse: report ESTALE as ENOENT
12a457
12a457
When the inode/gfid is missing, brick report back as an ESTALE
12a457
error. However, most of the applications don't accept ESTALE as an
12a457
error for a file-system object missing, changing their behaviour.
12a457
12a457
For eg., rm -rf ignores ENOENT errors during unlink of
12a457
files/directories. But with ESTALE error it doesn't send rmdir on a
12a457
directory if unlink had failed with ESTALE for any of the files or
12a457
directories within it.
12a457
12a457
BUG: 1115367
12a457
Change-Id: I5e56bc0c53f52179940b4691acf6b3db853965df
12a457
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
12a457
Reviewed-on: https://code.engineering.redhat.com/gerrit/72724
12a457
---
12a457
 xlators/mount/fuse/src/fuse-bridge.c |    3 +++
12a457
 1 files changed, 3 insertions(+), 0 deletions(-)
12a457
12a457
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
12a457
index 85b212a..2fbea13 100644
12a457
--- a/xlators/mount/fuse/src/fuse-bridge.c
12a457
+++ b/xlators/mount/fuse/src/fuse-bridge.c
12a457
@@ -348,6 +348,9 @@ send_fuse_err (xlator_t *this, fuse_in_header_t *finh, int error)
12a457
         struct iovec iov_out;
12a457
         inode_t  *inode = NULL;
12a457
 
12a457
+        if (error == ESTALE)
12a457
+                error = ENOENT;
12a457
+
12a457
         fouh.error = -error;
12a457
         iov_out.iov_base = &fou;;
12a457
 
12a457
-- 
12a457
1.7.1
12a457