diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-06-02 16:39:35 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-10-05 23:11:02 -0700 |
commit | c3dd76e9da783d879258cde17680f7d8747506f8 (patch) | |
tree | a839bcfd5de5375f83f9bad5bb8f8f316ebe5a3d /xlators/features/trash | |
parent | df06d94fae1e4a5e93f00c26d4b377bd8d1bd352 (diff) |
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 <pkarampu@redhat.com>
>Reviewed-on: http://review.gluster.org/11044
>Reviewed-by: Anoop C S <anoopcs@redhat.com>
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
BUG: 1259697
Change-Id: I73b79dd3519aa085fb84dde74b321511cbccce1a
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/12100
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/trash')
-rw-r--r-- | xlators/features/trash/src/trash.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index dafeb183f87..ab008651e1a 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1244,6 +1244,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, @@ -1333,6 +1335,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 */ |