diff options
| author | vinayak hegde <vinayak@gluster.com> | 2009-11-11 07:13:06 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-12 01:10:52 -0800 | 
| commit | 15a6e0be9bc1c56bd2a0a67c926b01f2f8631ae4 (patch) | |
| tree | fc856aed99b336d3d11d73d5720fb49bac92cd80 | |
| parent | 8b8691ef70f37d42100f502604ef94b8b9e5f5f8 (diff) | |
cluster/stripe: Set local->inode value before referring it.
Signed-off-by: Vinayak Hegde <vinayak@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 362 (GlusterFS crash while doing mkdir in stripe setup)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=362
| -rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 253d2f8f17f..c2d500e922d 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -492,7 +492,8 @@ stripe_stack_unwind_inode_cbk (call_frame_t *frame, void *cookie,                                 struct stat *postparent)  {          int32_t         callcnt = 0; -        stripe_local_t *local   = NULL; +        stripe_local_t  *local   = NULL; +        inode_t         *local_inode = NULL;          local = frame->local; @@ -512,6 +513,8 @@ stripe_stack_unwind_inode_cbk (call_frame_t *frame, void *cookie,                  if (op_ret >= 0) {                          local->op_ret = 0; +                        if (!local->inode) +                                local->inode = inode_ref (inode);                          if (!local->post_buf.st_blksize) {                                  local->post_buf = *buf; @@ -558,10 +561,13 @@ stripe_stack_unwind_inode_cbk (call_frame_t *frame, void *cookie,                  if (local->failed)                          local->op_ret = -1; +                local_inode = local->inode;                  STACK_UNWIND (frame, local->op_ret, local->op_errno,                                 local->inode, &local->post_buf,                                 &local->pre_parent_buf,                                 &local->post_parent_buf); +                if (local_inode) +                        inode_unref (local_inode);          }          return 0;  | 
