Changeset 8494

Show
Ignore:
Timestamp:
09/06/10 16:30:50 (3 years ago)
Author:
bligon
Message:

Modified server-state-machine-complete function. Reversed execution of functions BMI_set_info and
BMI_unexpected_free to prevent a memory leak. If BMI_set_info removes the bmi addr information
from the cur_ref_list, then BMI_unexpected_free is unable to execute the deallocate function stored
in the bmi addr information.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/src/server/pvfs2-server.c

    r8484 r8494  
    20772077    } 
    20782078 
    2079     BMI_set_info(s_op->unexp_bmi_buff.addr, BMI_DEC_ADDR_REF, NULL); 
     2079    gossip_ldebug(GOSSIP_BMI_DEBUG_TCP,"server_state_machine_complete: smcb op code (%d).\n" 
     2080                                      ,s_op->op); 
     2081    gossip_ldebug(GOSSIP_BMI_DEBUG_TCP,"server_state_machine_complete: " 
     2082                                       "s_op->unexp_bmi_buff.buffer (%p) " 
     2083                                       "\tNULL(%s).\n" 
     2084                                      ,s_op->unexp_bmi_buff.buffer 
     2085                                      ,s_op->unexp_bmi_buff.buffer ? "NO" : "YES"); 
     2086 
     2087    /* BMI_unexpected_free MUST execute BEFORE BMI_set_info, because BMI_set_info will */ 
     2088    /* remove the addr info from the cur_ref_list if BMI_DEC_ADDR_REF causes the ref   */ 
     2089    /* count to become zero.  The addr info holds the "unexpected-free" function       */ 
     2090    /* pointer.                                                                        */ 
    20802091    BMI_unexpected_free(s_op->unexp_bmi_buff.addr,  
    20812092                        s_op->unexp_bmi_buff.buffer); 
     2093    BMI_set_info(s_op->unexp_bmi_buff.addr, BMI_DEC_ADDR_REF, NULL); 
    20822094    s_op->unexp_bmi_buff.buffer = NULL; 
    20832095