@@ -202,9 +202,12 @@ static int my_rank = -1;
202202#define ID_GLOB_SIZE (sizeof(daos_obj_id_t) + (2*sizeof(uuid_t)))
203203#define DFS_GEN_DARSHAN_REC_ID (__oid_p , __mnt_info , __rec_id ) do { \
204204 unsigned char __id_glob[ID_GLOB_SIZE]; \
205- memcpy(__id_glob, __mnt_info->pool_uuid, sizeof(__mnt_info->pool_uuid)); \
206- memcpy(__id_glob+sizeof(__mnt_info->pool_uuid), __mnt_info->cont_uuid, sizeof(__mnt_info->cont_uuid)); \
207- memcpy(__id_glob+sizeof(__mnt_info->pool_uuid)+sizeof(__mnt_info->cont_uuid), __oid_p, sizeof(*__oid_p)); \
205+ memset(__id_glob, 0, ID_GLOB_SIZE); \
206+ if(__mnt_info) { \
207+ memcpy(__id_glob, __mnt_info->pool_uuid, sizeof(uuid_t)); \
208+ memcpy(__id_glob+sizeof(uuid_t), __mnt_info->cont_uuid, sizeof(uuid_t)); \
209+ } \
210+ memcpy(__id_glob+(2*sizeof(uuid_t)), __oid_p, sizeof(*__oid_p)); \
208211 __rec_id = darshan_hash(__id_glob, ID_GLOB_SIZE, 0); \
209212} while(0)
210213
@@ -219,7 +222,6 @@ static int my_rank = -1;
219222 darshan_record_id __rec_id; \
220223 struct dfs_file_record_ref *__rec_ref; \
221224 DFS_GET_MOUNT_INFO(__dfs, __mnt_info); \
222- if(!__mnt_info) break; \
223225 if(dfs_obj2id(*__obj_p, &__oid)) break; \
224226 DFS_GEN_DARSHAN_REC_ID(&__oid, __mnt_info, __rec_id); \
225227 __rec_ref = darshan_lookup_record_ref(dfs_runtime->rec_id_hash, &__rec_id, sizeof(__rec_id)); \
@@ -677,28 +679,25 @@ int DARSHAN_DECL(dfs_remove)(dfs_t *dfs, dfs_obj_t *parent, const char *name, bo
677679
678680 DFS_PRE_RECORD ();
679681 DFS_GET_MOUNT_INFO (dfs , mnt_info );
680- if (mnt_info )
682+ DFS_GEN_DARSHAN_REC_ID (oid , mnt_info , rec_id );
683+ rec_ref = darshan_lookup_record_ref (dfs_runtime -> rec_id_hash ,
684+ & rec_id , sizeof (rec_id ));
685+ if (!rec_ref )
681686 {
682- DFS_GEN_DARSHAN_REC_ID (oid , mnt_info , rec_id );
683- rec_ref = darshan_lookup_record_ref (dfs_runtime -> rec_id_hash ,
684- & rec_id , sizeof (rec_id ));
685- if (!rec_ref )
687+ DFS_RESOLVE_OBJ_REC_NAME (parent , name , obj_rec_name );
688+ if (obj_rec_name )
686689 {
687- DFS_RESOLVE_OBJ_REC_NAME (parent , name , obj_rec_name );
688- if (obj_rec_name )
689- {
690- rec_ref = dfs_track_new_file_record (rec_id , obj_rec_name , mnt_info );
691- free (obj_rec_name );
692- }
693- }
694- if (rec_ref )
695- {
696- rec_ref -> file_rec -> counters [DFS_REMOVES ] += 1 ;
697- DARSHAN_TIMER_INC_NO_OVERLAP (
698- rec_ref -> file_rec -> fcounters [DFS_F_META_TIME ],
699- tm1 , tm2 , rec_ref -> last_meta_end );
690+ rec_ref = dfs_track_new_file_record (rec_id , obj_rec_name , mnt_info );
691+ free (obj_rec_name );
700692 }
701693 }
694+ if (rec_ref )
695+ {
696+ rec_ref -> file_rec -> counters [DFS_REMOVES ] += 1 ;
697+ DARSHAN_TIMER_INC_NO_OVERLAP (
698+ rec_ref -> file_rec -> fcounters [DFS_F_META_TIME ],
699+ tm1 , tm2 , rec_ref -> last_meta_end );
700+ }
702701 DFS_POST_RECORD ();
703702
704703 return (ret );
@@ -895,8 +894,11 @@ static struct dfs_file_record_ref *dfs_track_new_file_record(
895894 /* registering this file record was successful, so initialize some fields */
896895 file_rec -> base_rec .id = rec_id ;
897896 file_rec -> base_rec .rank = my_rank ;
898- uuid_copy (file_rec -> pool_uuid , mnt_info -> pool_uuid );
899- uuid_copy (file_rec -> cont_uuid , mnt_info -> cont_uuid );
897+ if (mnt_info )
898+ {
899+ uuid_copy (file_rec -> pool_uuid , mnt_info -> pool_uuid );
900+ uuid_copy (file_rec -> cont_uuid , mnt_info -> cont_uuid );
901+ }
900902 rec_ref -> file_rec = file_rec ;
901903 dfs_runtime -> file_rec_count ++ ;
902904
0 commit comments