From c9bf5e6d2897de488967f5d736a5b9898b3deb94 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Mon, 6 May 2013 19:18:21 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/4958 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-helper.c | 2 ++ xlators/cluster/dht/src/dht-inode-write.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 56c139aa..23fc1ff9 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 b23434cd..b87d2f73 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; } -- cgit