From dda251448ebd488c1f6bb19ea4d0b745556c4ea5 Mon Sep 17 00:00:00 2001 From: Ali Mohammed <ali.mohammed@hpe.com> Date: Mon, 23 Jan 2023 18:16:40 +0100 Subject: [PATCH] avoid race by firing rdma read after updating attributes --- maestro/subscription_registry.c | 2 +- transport/transport.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/maestro/subscription_registry.c b/maestro/subscription_registry.c index 8a11dec2..9bb7f500 100644 --- a/maestro/subscription_registry.c +++ b/maestro/subscription_registry.c @@ -190,7 +190,7 @@ mstro__subscr_resolver_notice_cdoid(const char *name, /** drop all entries from resolver table */ static inline mstro_status -mstro__subscr_resolver_finalize() +mstro__subscr_resolver_finalize(void) { WITH_LOCKED_RESOLVER_TABLE({ struct cdo_resolver_table_entry *tmp=NULL, *e=NULL; diff --git a/transport/transport.c b/transport/transport.c index 2587770d..b504b005 100644 --- a/transport/transport.c +++ b/transport/transport.c @@ -500,16 +500,6 @@ mstro_transport_execute( cdo, cdo->name, idstr);}); } - if (ticket->data_size > 0) { - s=f(cdo, ticket); - if(s!=MSTRO_OK) { - ERR("Incoming transfer failed\n"); - goto BAILOUT; - } - } else { - DEBUG("Skipping (DST-side) 0-length transfer\n"); - } - /* FIXME: this assumption is likely wrong at this time. It's * nontrivial to fix also, because the transformation interface * requires SRC and DST cdo handles, and for transport we really @@ -519,7 +509,7 @@ mstro_transport_execute( /* layout-related attributes and a few more are always precious, as * transformations will have handled them */ -#define NUM_PRECIOUS 8 + #define NUM_PRECIOUS 8 const size_t num_precious_attr = NUM_PRECIOUS; const char *precious_attributes[NUM_PRECIOUS] = { MSTRO_ATTR_CORE_CDO_RAW_PTR, @@ -542,6 +532,16 @@ mstro_transport_execute( goto BAILOUT; } + if (ticket->data_size > 0) { + s=f(cdo, ticket); + if(s!=MSTRO_OK) { + ERR("Incoming transfer failed\n"); + goto BAILOUT; + } + } else { + DEBUG("Skipping (DST-side) 0-length transfer\n"); + } + // OFI has a callback to handle CDO state updates and SRC/PM completion notification: if ( ticket->method == MSTRO__POOL__TRANSPORT_KIND__OFI && ticket->data_size > 0) { -- GitLab