diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-09-29 11:04:35 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-29 09:06:56 -0700 |
commit | a8270c537c257da13c4b48c1524ecb77ee67308f (patch) | |
tree | 78615dafd0cd71125cfcd938bee2b181c274cac7 | |
parent | fb648cf39c8715e5a25752defdfc95ec0ba04217 (diff) |
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 <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
-rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 289489e506e..a23efaadd39 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, |