summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantosh Kumar Pradhan <spradhan@redhat.com>2013-09-25 11:24:28 +0530
committerVijay Bellur <vbellur@redhat.com>2013-09-24 23:49:41 -0700
commit22e982e31bc232f3d9597a41f49e715428e010ce (patch)
tree7cb0cf844ebb294a1339ef9a89414d2e3d3513ca
parent04163fc4ba5c66099c0d0c764c146f2f15f40cda (diff)
gNFS: avoid double fd unref in opendir
Noticed that the fd_unref was called on the fd regardless of the return value at nfs3svc_opendir_readdir_cbk(), hence removing an extra unref in the negative case in nfs_inode_opendir_cbk, which fixes the spurious fd_unref(). Back port of: http://review.gluster.org/4943 (Rajesh Amaravathi) Change-Id: Ibddf487c7890407d01befedd65eefb10cb9c989f BUG: 1011761 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/5996 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/nfs/server/src/nfs-inodes.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/nfs-inodes.c b/xlators/nfs/server/src/nfs-inodes.c
index a68f8b227a4..291152f857e 100644
--- a/xlators/nfs/server/src/nfs-inodes.c
+++ b/xlators/nfs/server/src/nfs-inodes.c
@@ -572,9 +572,7 @@ nfs_inode_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
struct nfs_fop_local *nfl = NULL;
fop_open_cbk_t progcbk = NULL;
- if ((op_ret == -1) && (fd))
- fd_unref (fd);
- else
+ if (op_ret != -1)
fd_bind (fd);
inodes_nfl_to_prog_data (nfl, progcbk, frame);