From 2bdd6ba17aa81f3e1b25698954540173583162e9 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Thu, 14 Jan 2016 13:16:23 -0600 Subject: [PATCH] correctly free some buffers, and ensure that lustre_stripe_size and stripe_count are always read from the file system. --- .../fcoll_dynamic_gen2_file_write_all.c | 9 +++++- ompi/mca/fs/lustre/fs_lustre_file_open.c | 28 ++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c index 85a911416e..46df8865ed 100644 --- a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c +++ b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c @@ -530,7 +530,14 @@ exit : } free(displs); free(decoded_iov); - + free(broken_counts); + free(broken_iov_counts); + free(broken_decoded_iovs); // decoded_iov arrays[i] were freed as aggr_data[i]->decoded_iov; + for (i=0; i 0 && fs_lustre_stripe_width>0) { - fh->f_stripe_size = fs_lustre_stripe_size; - fh->f_stripe_count = fs_lustre_stripe_width; - } - else { - lump = alloc_lum(); - if (NULL == lump ){ + lump = alloc_lum(); + if (NULL == lump ){ fprintf(stderr,"Cannot allocate memory for extracting stripe size\n"); return OMPI_ERROR; - } - rc = llapi_file_get_stripe(filename, lump); - if (rc != 0) { - opal_output(1, "get_stripe failed: %d (%s)\n", errno, strerror(errno)); - return OMPI_ERROR; - } - fh->f_stripe_size = lump->lmm_stripe_size; - fh->f_stripe_count = lump->lmm_stripe_count; - + } + rc = llapi_file_get_stripe(filename, lump); + if (rc != 0) { + opal_output(1, "get_stripe failed: %d (%s)\n", errno, strerror(errno)); + return OMPI_ERROR; + } + fh->f_stripe_size = lump->lmm_stripe_size; + fh->f_stripe_count = lump->lmm_stripe_count; + // if ( NULL != lump ) { // free ( lump ); // } - } return OMPI_SUCCESS; }