From b605865986f19cf5e376a16b963f68f28d4aea44 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 25 Nov 2010 04:11:11 +0000 Subject: nfs3: Prevent second lookup on a fresh entry lookup Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 1756 (NFS must revalidate inode on first ESTALE on lookup) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1756 --- xlators/nfs/server/src/nfs3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/nfs/server/src/nfs3.c') diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 73293ed9f..4c2b47045 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -1055,6 +1055,7 @@ nfs3svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, struct nfs3_fh newfh = {{0}, }; nfsstat3 status = NFS3_OK; nfs3_call_state_t *cs = NULL; + inode_t *oldinode = NULL; cs = frame->local; if (op_ret == -1) { @@ -1063,7 +1064,8 @@ nfs3svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } nfs3_fh_build_child_fh (&cs->parent, buf, &newfh); - + oldinode = inode_link (inode, cs->resolvedloc.parent, cs->resolvedloc.name, buf); + inode_unref (oldinode); xmit_res: /* Only send fresh lookup if it was a revalidate that failed. */ if ((op_ret == -1) && (nfs3_is_revalidate_lookup (cs))) { -- cgit