summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-06-02 16:39:35 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-28 10:26:17 -0700
commite55579bdb1d04cca29f3e87427de5f2a5ab5e9b4 (patch)
treee94f93a66fccd2ac5ced8b3408c41d6a3d28b78f /xlators/features
parentdedf2bde88020adbabb80204830878f060fa614c (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>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/marker/src/marker-quota.c5
-rw-r--r--xlators/features/trash/src/trash.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index c3d838f7549..4dd457927d2 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -773,8 +773,10 @@ mq_dirty_inode_readdir (call_frame_t *frame,
return 0;
}
- if (local->fd == NULL)
+ if (local->fd == NULL) {
+ fd_bind (fd);
local->fd = fd_ref (fd);
+ }
STACK_WIND (frame,
mq_readdir_cbk,
@@ -3488,6 +3490,7 @@ mq_update_dirty_inode_task (void *opaque)
goto out;
}
+ fd_bind (fd);
INIT_LIST_HEAD (&entries.list);
while ((ret = syncop_readdirp (this, fd, 131072, offset, &entries,
NULL, NULL)) != 0) {
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 */