Patchwork [BUG:854,2/5] nfs3: Return ESTALE when fh resolver exhausts dirents

login
register
Submitter Shehjar Tikoo
Date 2010-07-27 11:46:50
Message ID <1280231213-3137-2-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/3920/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Shehjar Tikoo - 2010-07-27 11:46:50
From: Shehjar Tikoo <shehjart@gluster.com>

During hard fh resolution, if a directory traversal goes right
through to end-of-dir without finding a hash match, we need to return
an ESTALE, not ENOENT.

Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
---
 xlators/nfs/server/src/nfs3-helpers.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 0c4ca10..699a290 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -2861,7 +2861,7 @@  nfs3_fh_resolve_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                 gf_log (GF_NFS3, GF_LOG_TRACE, "Directory read done: %s: %s",
                         cs->resolvedloc.path, strerror (op_ret));
                 cs->resolve_ret = -1;
-                cs->resolve_errno = ENOENT;
+                cs->resolve_errno = ESTALE;
                 nfs3_call_resume (cs);
                 goto err;
         }