summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrishna <ksriniva@redhat.com>2012-02-22 13:46:12 +0530
committerAnand Avati <avati@redhat.com>2012-03-19 15:29:37 -0700
commit326747aa892de2e345d7d74d76314d3f696430bb (patch)
tree5c800295548f81560085a30259fa4b83a943178b
parent0190bf4726773a83081eb0935697c7a616edf0dd (diff)
nfs: If entry is not found return ENOENT instead of entering an infinite loop.
Change-Id: I06d471cb996e18fb656a6470de38d2401d846318 BUG: 772542 Signed-off-by: krishna <ksriniva@redhat.com> Reviewed-on: http://review.gluster.com/2793 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index cb6f9ff..54e98b8 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -2503,6 +2503,14 @@ nfs3_fh_resolve_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
gf_dirent_t *entries);
+void
+nfs3_fh_resolve_not_found (nfs3_call_state_t *cs)
+{
+ cs->resolve_ret = -1;
+ cs->resolve_errno = ENOENT;
+ nfs3_call_resume (cs);
+}
+
int
nfs3_fh_resolve_found_entry (nfs3_call_state_t *cs, gf_dirent_t *candidate)
{
@@ -2813,7 +2821,6 @@ int
nfs3_fh_resolve_check_response (nfs3_call_state_t *cs)
{
int ret = -EFAULT;
- nfs_user_t nfu = {0, };
int response = GF_NFS3_FHRESOLVE_NOTFOUND;
if (!cs)
@@ -2834,10 +2841,7 @@ nfs3_fh_resolve_check_response (nfs3_call_state_t *cs)
break;
case GF_NFS3_FHRESOLVE_NOTFOUND:
- nfs_user_root_create (&nfu);
- nfs_readdirp (cs->nfsx, cs->vol, &nfu, cs->resolve_dir_fd,
- GF_NFS3_DTPREF, cs->lastentryoffset,
- nfs3_fh_resolve_readdir_cbk, cs);
+ nfs3_fh_resolve_not_found (cs);
break;
}