summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
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/cluster
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/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-common.c1
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c4
-rw-r--r--xlators/cluster/dht/src/dht-rename.c1
-rw-r--r--xlators/cluster/ec/src/ec-inode-write.c1
4 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 9de1550f53b..c0241e94928 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -7307,6 +7307,7 @@ dht_rmdir_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->op_ret == -1)
goto err;
+ fd_bind (fd);
dict = dict_new ();
if (!dict) {
local->op_ret = -1;
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index e35a69e22d8..7c91d176ff3 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -504,6 +504,7 @@ __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struc
}
+ fd_bind (fd);
/*Reason of doing lookup after create again:
*In the create, there is some time-gap between opening fd at the
*server (posix_layer) and binding it in server (incrementing fd count),
@@ -777,6 +778,7 @@ __dht_rebalance_open_src_file (xlator_t *from, xlator_t *to, loc_t *loc,
goto out;
}
+ fd_bind (fd);
ret = -1;
dict = dict_new ();
if (!dict)
@@ -2243,6 +2245,7 @@ gf_defrag_process_dir (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,
goto out;
}
+ fd_bind (fd);
dir_dfmeta = GF_CALLOC (1, sizeof (*dir_dfmeta),
gf_common_mt_pointer);
if (!dir_dfmeta) {
@@ -2543,6 +2546,7 @@ gf_defrag_fix_layout (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,
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/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index 311dbf2d495..fbae72d7fc3 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -244,6 +244,7 @@ dht_rename_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
+ fd_bind (fd);
STACK_WIND (frame, dht_rename_readdir_cbk,
prev->this, prev->this->fops->readdir,
local->fd, 4096, 0, NULL);
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index e43313012b3..50d71082fad 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -881,6 +881,7 @@ int32_t ec_truncate_open_cbk(call_frame_t * frame, void * cookie,
int32_t err;
if (op_ret >= 0) {
+ fd_bind (fd);
err = ec_truncate_write(fop->parent, fop->answer->mask);
if (err != 0) {
fop->error = -err;