From 4929a0f2fb31570906a4eb795b6c7655d107d3a9 Mon Sep 17 00:00:00 2001 From: Basavanagowda Kanur Date: Fri, 24 Jul 2009 06:25:53 +0000 Subject: protocol/server: add checks for updatation of loc->parent in entrylk() or inodelk(). entrylk() and inodelk() should try to update loc->parent only if parent is not-NULL. because it is not an error to have loc->parent == NULL for entrylk() and inodelk() operations. Signed-off-by: Anand V. Avati BUG: 162 (Replication segfaults with many nodes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=162 --- xlators/protocol/server/src/server-protocol.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xlators/protocol/server/src/server-protocol.c') diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index e4cb366fc..a7ac5be77 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -3331,7 +3331,8 @@ server_stub_resume (call_stub_t *stub, int32_t op_ret, int32_t op_errno, break; } - if (stub->args.entrylk.loc.parent == NULL) + if ((stub->args.entrylk.loc.parent == NULL) + && (parent)) stub->args.entrylk.loc.parent = inode_ref (parent); if (server_inode && (stub->args.entrylk.loc.inode == NULL)) { @@ -3359,7 +3360,8 @@ server_stub_resume (call_stub_t *stub, int32_t op_ret, int32_t op_errno, break; } - if (stub->args.inodelk.loc.parent == NULL) + if ((stub->args.inodelk.loc.parent == NULL) + && (parent)) stub->args.inodelk.loc.parent = inode_ref (parent); if (server_inode && (stub->args.inodelk.loc.inode == NULL)) { @@ -5618,7 +5620,8 @@ server_inodelk_resume (call_frame_t *frame, xlator_t *this, state->loc.inode = inode_ref (loc->inode); } - if (state->loc.parent == NULL) { + if ((state->loc.parent == NULL) + && (loc->parent)) { state->loc.parent = inode_ref (loc->parent); } -- cgit