Changeset 8595

Show
Ignore:
Timestamp:
10/26/10 15:17:21 (3 years ago)
Author:
bligon
Message:

In the call to trove_collection_lookup() from server_initialize_subsystems(), I passed in the address
of a local variable, orig_fsid, instead of the address of cur_fs->coll_id, because this variable
is modified in the lookup at the same time the trove_thread_function() tries to read it,
causing a data race condition.

Files:
1 modified

Legend:

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

    r8494 r8595  
    678678    TROVE_context_id trove_context = -1; 
    679679    char buf[16] = {0}; 
    680     PVFS_fs_id orig_fsid; 
     680    PVFS_fs_id orig_fsid=0; 
    681681    PVFS_ds_flags init_flags = 0; 
    682682    int bmi_flags = BMI_INIT_SERVER; 
     
    874874        } 
    875875 
    876         orig_fsid = cur_fs->coll_id; 
    877876        ret = trove_collection_lookup( 
    878877            cur_fs->trove_method, 
    879             cur_fs->file_system_name, &(cur_fs->coll_id), NULL, NULL); 
     878            cur_fs->file_system_name, &(orig_fsid), NULL, NULL); 
    880879 
    881880        if (ret < 0) 
     
    889888        { 
    890889            gossip_err("Error: configuration file does not match storage collection.\n"); 
    891             gossip_err("   config file fs_id: %d\n", (int)orig_fsid); 
    892             gossip_err("   storage fs_id: %d\n", (int)cur_fs->coll_id); 
     890            gossip_err("   storage file fs_id: %d\n", (int)orig_fsid); 
     891            gossip_err("   config  file fs_id: %d\n", (int)cur_fs->coll_id); 
    893892            gossip_err("Warning: This most likely means that the configuration\n"); 
    894893            gossip_err("   files have been regenerated without destroying and\n");