summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2013-05-06 19:18:21 +0530
committerVijay Bellur <vbellur@redhat.com>2013-05-31 05:15:44 -0700
commitc9bf5e6d2897de488967f5d736a5b9898b3deb94 (patch)
tree35a9b8bedc8e1862d3550bf4024608fec6d490a3 /xlators
parentf162456794ae78d29edc42a2c040c1037145f24d (diff)
cluster/dht: Do not open fd in migration check/complete for non fd ops
if local->fd == NULL, then in dht_migration_check_complete, do not do open call. Let the layout get updated, and proceed with invoking the registered target_fn. if local->fd == NULL, do not call dht_rebalance_in_progress_check for truncate fop, but proceed with truncate2. Change-Id: Ia5a5d40bcea7bfb320ef7096af1e035b8847d4ff BUG: 960055 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.org/4958 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-helper.c2
-rw-r--r--xlators/cluster/dht/src/dht-inode-write.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 56c139aa911..23fc1ff962e 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -806,6 +806,8 @@ 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 */
ret = fd_ctx_del (local->fd, this, NULL);
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c
index b23434cdf3c..b87d2f73284 100644
--- a/xlators/cluster/dht/src/dht-inode-write.c
+++ b/xlators/cluster/dht/src/dht-inode-write.c
@@ -212,7 +212,7 @@ dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
dht_iatt_merge (this, &local->stbuf, postbuf, NULL);
dht_iatt_merge (this, &local->prebuf, prebuf, NULL);
ret = fd_ctx_get (local->fd, this, NULL);
- if (!ret) {
+ if (!ret || !local->fd) {
dht_truncate2 (this, frame, 0);
return 0;
}