summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-03-29 19:45:29 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-31 05:16:23 -0700
commitc078b9df8d8f44ca90e61566f83f83809ce5ac0f (patch)
tree73748a74bc8dbd5ef839c86f03b22c5c8c99ef77 /xlators/cluster/afr/src/afr-inode-write.c
parent66d430da4e3788aeb41eea46455ca25a2d19a626 (diff)
cluster/afr: Handle invalid inode in open_fd_fix
Change-Id: Ie009fb4b8b7745ebd5b76f7a40287998be35eef3 BUG: 804914 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3045 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 368a68bd6..7fa6d096c 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -348,6 +348,7 @@ afr_open_fd_fix (call_frame_t *frame, xlator_t *this, gf_boolean_t pause_fop)
int ret = 0;
int i = 0;
afr_fd_ctx_t *fd_ctx = NULL;
+ inode_t *inode = NULL;
gf_boolean_t need_self_heal = _gf_false;
int *need_open = NULL;
int need_open_count = 0;
@@ -360,7 +361,10 @@ afr_open_fd_fix (call_frame_t *frame, xlator_t *this, gf_boolean_t pause_fop)
GF_ASSERT (local->fd);
- if (fd_is_anonymous (local->fd)) {
+ inode = local->fd->inode;
+ //gfid is not set in rebalance, that case needs to be handled.
+ if (fd_is_anonymous (local->fd) ||
+ !inode || uuid_is_null (inode->gfid)) {
fop_continue = _gf_true;
goto out;
}