diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index 0e6638815804..761478f8361e 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -1727,6 +1727,12 @@ static void relayfence_request_cb (flux_t *h, flux_msg_handler_t *mh, } } + if (fence_get_flags (f) != flags + || fence_get_nprocs (f) != nprocs) { + errno = EINVAL; + goto error; + } + if (fence_add_request_data (f, ops) < 0) { flux_log_error (h, "%s: fence_add_request_data", __FUNCTION__); goto error; @@ -1792,8 +1798,12 @@ static void fence_request_cb (flux_t *h, flux_msg_handler_t *mh, goto error; } } - else - fence_set_flags (f, fence_get_flags (f) | flags); + + if (fence_get_flags (f) != flags + || fence_get_nprocs (f) != nprocs) { + errno = EINVAL; + goto error; + } if (fence_add_request_copy (f, msg) < 0) goto error;