From adc8aeb16cdee8d2f58aa8f2fce1dd637f264e51 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 23 Mar 2016 13:47:27 +0530 Subject: mount/fuse: report ESTALE as ENOENT When the inode/gfid is missing, brick report back as an ESTALE error. However, most of the applications don't accept ESTALE as an error for a file-system object missing, changing their behaviour. For eg., rm -rf ignores ENOENT errors during unlink of files/directories. But with ESTALE error it doesn't send rmdir on a directory if unlink had failed with ESTALE for any of the files or directories within it. BUG: 1257894 Change-Id: I5e56bc0c53f52179940b4691acf6b3db853965df Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/14027 Tested-by: N Balachandran Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: N Balachandran CentOS-regression: Gluster Build System --- xlators/mount/fuse/src/fuse-bridge.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 85b212af951..2fbea1383d8 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -348,6 +348,9 @@ send_fuse_err (xlator_t *this, fuse_in_header_t *finh, int error) struct iovec iov_out; inode_t *inode = NULL; + if (error == ESTALE) + error = ENOENT; + fouh.error = -error; iov_out.iov_base = &fouh; -- cgit