From a8270c537c257da13c4b48c1524ecb77ee67308f Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 29 Sep 2011 11:04:35 +0530 Subject: protocol/server: check for the fd being NULL and unwind Change-Id: I400e515431cf739fe0b2f90840359496a2b529d2 BUG: 3158 Reviewed-on: http://review.gluster.com/528 Tested-by: Gluster Build System Reviewed-by: Shishir Gowda --- xlators/protocol/server/src/server3_1-fops.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/protocol/server/src/server3_1-fops.c') diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 289489e50..a23efaadd 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -2514,6 +2514,14 @@ server_create_resume (call_frame_t *frame, xlator_t *bound_xl) state->loc.inode = inode_new (state->itable); state->fd = fd_create (state->loc.inode, frame->root->pid); + if (!state->fd) { + gf_log ("server", GF_LOG_ERROR, "fd creation for the inode %s " + "failed", state->loc.inode? + uuid_utoa (state->loc.inode->gfid):NULL); + state->resolve.op_ret = -1; + state->resolve.op_errno = ENOMEM; + goto err; + } state->fd->flags = state->flags; STACK_WIND (frame, server_create_cbk, -- cgit