summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorBasavanagowda Kanur <gowda@gluster.com>2009-07-24 06:25:53 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-27 11:33:56 -0700
commit4929a0f2fb31570906a4eb795b6c7655d107d3a9 (patch)
tree832dc23e74aa9a5b83c3034310ca52511eda8802 /xlators/protocol
parent698a573bfb167d8d6c51d07089995d861dd7fbd3 (diff)
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 <avati@dev.gluster.com> BUG: 162 (Replication segfaults with many nodes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=162
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server-protocol.c9
1 files changed, 6 insertions, 3 deletions
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);
}