From f2a067c4fe92f7aefc5f64ea1e5b000c16af0946 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 13 Jan 2011 03:38:51 +0000 Subject: nfs3: Handle root resolution failures ..to prevent a second reply to the client which results in accessing a call state structure that gets freed on the first reply. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 2286 ([glusterfs 3.1.2qa3]: Crash due to corruption in gf_dirent_free) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2286 --- xlators/nfs/server/src/nfs3-helpers.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 05baee3aaeb..8697487945e 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -3116,11 +3116,7 @@ nfs3_fh_resolve_entry (nfs3_call_state_t *cs) if (!cs) return ret; - ret = nfs3_fh_resolve_entry_hard (cs); - if (ret < 0) - nfs3_call_resume_estale (cs); - - return 0; + return nfs3_fh_resolve_entry_hard (cs); } @@ -3141,8 +3137,12 @@ nfs3_fh_resolve_resume (nfs3_call_state_t *cs) ret = nfs3_fh_resolve_entry (cs); err_resume_call: - if (ret < 0) + if (ret < 0) { + cs->resolve_ret = -1; + cs->resolve_errno = EFAULT; nfs3_call_resume (cs); + ret = 0; + } return ret; } @@ -3162,11 +3162,11 @@ nfs3_fh_resolve_root_lookup_cbk (call_frame_t *frame, void *cookie, cs->resolve_errno = op_errno; if (op_ret == -1) { - gf_log (GF_NFS3, GF_LOG_TRACE, "Lookup failed: %s: %s", - cs->resolvedloc.path, strerror (op_errno)); + gf_log (GF_NFS3, GF_LOG_TRACE, "Root lookup failed: %s", + strerror (op_errno)); goto err; } else - gf_log (GF_NFS3, GF_LOG_TRACE, "Entry looked up: %s", + gf_log (GF_NFS3, GF_LOG_TRACE, "Root looked up: %s", cs->resolvedloc.path); nfs3_set_root_looked_up (cs->nfs3state, &cs->resolvefh); -- cgit