Patchwork [BUG:1397,01/12] nfs3: Dont ref cached fd after fd_lookup

login
register
Submitter Shehjar Tikoo
Date 2010-08-31 12:20:26
Message ID <1283257237-18659-1-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/4416/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Shehjar Tikoo - 2010-08-31 12:20:26
From: Shehjar Tikoo <shehjart@gluster.com>

..because fd_lookup returns a ref'd fd_t.

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 feeeda0..116d145 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -1788,7 +1788,7 @@  nfs3_dir_open_and_resume (nfs3_call_state_t *cs, nfs3_resume_fn_t resume)
         fd = fd_lookup (cs->resolvedloc.inode, 0);
         if (fd) {
                 gf_log (GF_NFS3, GF_LOG_TRACE, "fd found in state: ref: %d", fd->refcount);
-                cs->fd = fd_ref (fd);    /* Gets unrefd when the call state is wiped. */
+                cs->fd = fd;    /* Gets unrefd when the call state is wiped. */
                 cs->resolve_ret = 0;
                 nfs3_call_resume (cs);
                 ret = 0;