From e979c0de9dde14fe18d0ad7298c6da9cc878bbab Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 30 Jan 2013 13:47:31 +0530 Subject: libglusterfs/syncop: do not hold ref on the fd in cbk * Do not do fd_ref in cbks of the fops which return a fd (such as open, opendir, create). Change-Id: Ic2f5b234c5c09c258494f4fb5d600a64813823ad BUG: 885008 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/4282 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/cluster/dht/src/dht-helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators/cluster/dht') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 8a38de475..c587daca7 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -627,6 +627,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, @@ -719,9 +722,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); @@ -805,6 +805,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, @@ -853,9 +856,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); -- cgit