From c078b9df8d8f44ca90e61566f83f83809ce5ac0f Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 29 Mar 2012 19:45:29 +0530 Subject: cluster/afr: Handle invalid inode in open_fd_fix Change-Id: Ie009fb4b8b7745ebd5b76f7a40287998be35eef3 BUG: 804914 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3045 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-inode-write.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 368a68bd688..7fa6d096ca4 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; } -- cgit