From e55579bdb1d04cca29f3e87427de5f2a5ab5e9b4 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 2 Jun 2015 16:39:35 +0530 Subject: fd: Do fd_bind on successful open - fd_unref should decrement fd->inode->fd_count only if it is present in the inode's fd list. - successful open/opendir should perform fd_bind. Change-Id: I81dd04f330e2fee86369a6dc7147af44f3d49169 BUG: 1207735 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/11044 Reviewed-by: Anoop C S Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- xlators/features/trash/src/trash.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/features/trash/src') diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index d4d717b9ffc..18e36e7d6d9 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1240,6 +1240,8 @@ trash_truncate_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + fd_bind (fd); + local->cur_offset = 0; STACK_WIND (frame, trash_truncate_readv_cbk, @@ -1329,6 +1331,7 @@ trash_truncate_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + fd_bind (fd); flags = O_RDONLY; /* fd which represents source file for reading and writing from it */ -- cgit