summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/syncop.c6
-rw-r--r--xlators/cluster/dht/src/dht-helper.c14
2 files changed, 6 insertions, 14 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 4be002198..0c4620643 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -931,9 +931,6 @@ syncop_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
args->op_ret = op_ret;
args->op_errno = op_errno;
- if (op_ret != -1)
- fd_ref (fd);
-
__wake (args);
return 0;
@@ -1079,9 +1076,6 @@ syncop_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
args->op_ret = op_ret;
args->op_errno = op_errno;
- if (op_ret != -1)
- fd_ref (fd);
-
__wake (args);
return 0;
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index d866a2cd1..18a0d9de2 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -711,6 +711,9 @@ dht_migration_complete_check_task (void *data)
src_node = local->cached_subvol;
+ if (!local->loc.inode && !local->fd)
+ goto out;
+
/* getxattr on cached_subvol for 'linkto' value */
if (!local->loc.inode)
ret = syncop_fgetxattr (src_node, local->fd, &dict,
@@ -803,9 +806,6 @@ dht_migration_complete_check_task (void *data)
local->cached_subvol = dst_node;
ret = 0;
- if (!local->fd)
- goto out;
-
/* once we detect the migration complete, the fd-ctx is no more
required.. delete the ctx, and do one extra 'fd_unref' for open fd */
ret = fd_ctx_del (local->fd, this, NULL);
@@ -838,8 +838,6 @@ dht_migration_complete_check_task (void *data)
goto out;
}
- /* need this unref for the fd on src_node */
- fd_unref (local->fd);
ret = 0;
out:
@@ -890,6 +888,9 @@ dht_rebalance_inprogress_task (void *data)
src_node = local->cached_subvol;
+ if (!local->loc.inode && !local->fd)
+ goto out;
+
/* getxattr on cached_subvol for 'linkto' value */
if (local->loc.inode)
ret = syncop_getxattr (src_node, &local->loc, &dict,
@@ -938,9 +939,6 @@ dht_rebalance_inprogress_task (void *data)
ret = 0;
- if (!local->fd)
- goto out;
-
if (local->loc.inode) {
ret = syncop_open (dst_node, &local->loc,
local->fd->flags, local->fd);