Unverified Commit 32ee1a2e authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

fix misuse of margo context_id

margo context id is not the id of the host that send the request. Is the
internal context id of local margo instance.
parent bb64eaf7
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -139,8 +139,8 @@ static hg_return_t rpc_srv_write_data(hg_handle_t handle) {
    auto hgi = margo_get_info(handle);
    auto hgi = margo_get_info(handle);
    auto mid = margo_hg_info_get_instance(hgi);
    auto mid = margo_hg_info_get_instance(hgi);
    auto bulk_size = margo_bulk_get_size(in.bulk_handle);
    auto bulk_size = margo_bulk_get_size(in.bulk_handle);
    ADAFS_DATA->spdlogger()->debug("{}() host: {}, path: {}, size: {}, offset: {}", __func__,
    ADAFS_DATA->spdlogger()->debug("{}() path: {}, size: {}, offset: {}", __func__,
                                   hgi->context_id, in.path, bulk_size, in.offset);
                                   in.path, bulk_size, in.offset);
    /*
    /*
     * 2. Set up buffers for pull bulk transfers
     * 2. Set up buffers for pull bulk transfers
     */
     */
@@ -331,8 +331,8 @@ static hg_return_t rpc_srv_read_data(hg_handle_t handle) {
    auto hgi = margo_get_info(handle);
    auto hgi = margo_get_info(handle);
    auto mid = margo_hg_info_get_instance(hgi);
    auto mid = margo_hg_info_get_instance(hgi);
    auto bulk_size = margo_bulk_get_size(in.bulk_handle);
    auto bulk_size = margo_bulk_get_size(in.bulk_handle);
    ADAFS_DATA->spdlogger()->debug("{}() host: {}, path: {}, size: {}, offset: {}", __func__,
    ADAFS_DATA->spdlogger()->debug("{}() path: {}, size: {}, offset: {}", __func__,
                                   hgi->context_id, in.path, bulk_size, in.offset);
                                   in.path, bulk_size, in.offset);


    /*
    /*
     * 2. Set up buffers for pull bulk transfers
     * 2. Set up buffers for pull bulk transfers
+3 −6
Original line number Original line Diff line number Diff line
@@ -29,8 +29,7 @@ static hg_return_t rpc_srv_mk_node(hg_handle_t handle) {
    if (ret != HG_SUCCESS)
    if (ret != HG_SUCCESS)
        ADAFS_DATA->spdlogger()->error("{}() Failed to retrieve input from handle", __func__);
        ADAFS_DATA->spdlogger()->error("{}() Failed to retrieve input from handle", __func__);
    assert(ret == HG_SUCCESS);
    assert(ret == HG_SUCCESS);
    ADAFS_DATA->spdlogger()->debug("{}() Got RPC (from local {}) with path {}", __func__,
    ADAFS_DATA->spdlogger()->debug("{}() Got RPC with path {}", __func__, in.path);
                                   (margo_get_info(handle)->context_id == ADAFS_DATA->host_id()), in.path);
    Metadata md(in.mode);
    Metadata md(in.mode);
    try {
    try {
        // create metadentry
        // create metadentry
@@ -309,8 +308,7 @@ static hg_return_t rpc_srv_get_dirents(hg_handle_t handle) {
    auto hgi = margo_get_info(handle);
    auto hgi = margo_get_info(handle);
    auto mid = margo_hg_info_get_instance(hgi);
    auto mid = margo_hg_info_get_instance(hgi);
    ADAFS_DATA->spdlogger()->debug(
    ADAFS_DATA->spdlogger()->debug(
            "{}() Got dirents RPC (local {}) with path {}", __func__,
            "{}() Got dirents RPC with path {}", __func__, in.path);
            (hgi->context_id == ADAFS_DATA->host_id()), in.path);
    auto bulk_size = margo_bulk_get_size(in.bulk_handle);
    auto bulk_size = margo_bulk_get_size(in.bulk_handle);


    //Get directory entries from local DB
    //Get directory entries from local DB
@@ -391,8 +389,7 @@ static hg_return_t rpc_srv_mk_symlink(hg_handle_t handle) {
    if (ret != HG_SUCCESS) {
    if (ret != HG_SUCCESS) {
        ADAFS_DATA->spdlogger()->error("{}() Failed to retrieve input from handle", __func__);
        ADAFS_DATA->spdlogger()->error("{}() Failed to retrieve input from handle", __func__);
    }
    }
    ADAFS_DATA->spdlogger()->debug("{}() Got RPC (from local {}) with path {}", __func__,
    ADAFS_DATA->spdlogger()->debug("{}() Got RPC with path {}", __func__, in.path);
                                   (margo_get_info(handle)->context_id == ADAFS_DATA->host_id()), in.path);


    try {
    try {
        Metadata md = {LINK_MODE, in.target_path};
        Metadata md = {LINK_MODE, in.target_path};