diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e95d84826c30ebb15d565133e180073b002bc1..2f476019bcdc86fb4191329c43315057e6a36f8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,11 +135,13 @@ set(DSS_SECUREC_INC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/huawei_secu set(DSS_OPENSSL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/openssl/include") set(DSS_CBB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/cbb/include") set(LIBAIO_INC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/libaio/include") +set(ZLIB_INC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/zlib/include") ## lib set(SECUREC_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/huawei_security/lib") set(OPENSSL_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/openssl/lib") set(CBB_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/cbb/lib") +set(ZLIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/library/zlib/lib") ## output path set (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/output/lib) @@ -158,7 +160,7 @@ IF (ENABLE_GLOBAL_CACHE STREQUAL "ON") ENDIF() ## add source -link_directories(${LIBRARY_OUTPUT_PATH} ${SECUREC_LIB_PATH} ${CBB_LIB_PATH}) +link_directories(${LIBRARY_OUTPUT_PATH} ${SECUREC_LIB_PATH} ${ZLIB_PATH} ${CBB_LIB_PATH}) IF (ENABLE_FUZZASAN) link_directories(${DSS_FUZZ_LIB_PATH}) set(fuzz_lib "libSecodefuzz.a") @@ -166,6 +168,7 @@ ENDIF() set(vpp_libsecurec "libsecurec.a") set(3rd_libccb "libcbb.a") +set(zlib "libz.a") if (ENABLE_GLOBAL_CACHE STREQUAL "ON") set(vpp_libipsi_crypto "") diff --git a/build/linux/opengauss/build.sh b/build/linux/opengauss/build.sh index fb84cea102c674fa96c46d6255b25680339ecdaf..b6cec0044723fa233b4904ae9d04363578b3a77a 100644 --- a/build/linux/opengauss/build.sh +++ b/build/linux/opengauss/build.sh @@ -118,6 +118,7 @@ export DSS_LIBRARYS=$(pwd)/../../../library [ -d "${DSS_LIBRARYS}" ] && rm -rf ${DSS_LIBRARYS} mkdir -p $DSS_LIBRARYS/huawei_security mkdir -p $DSS_LIBRARYS/openssl +mkdir -p $DSS_LIBRARYS/zlib mkdir -p $DSS_LIBRARYS/libaio/include mkdir -p $DSS_LIBRARYS/cbb @@ -127,9 +128,11 @@ COPT_LIB_PATH=${binarylib_dir}/kernel/component cp -r $P_LIB_PATH/Huawei_Secure_C/comm/lib $DSS_LIBRARYS/huawei_security/lib cp -r $LIB_PATH/openssl/comm/lib $DSS_LIBRARYS/openssl/lib +cp -r $LIB_PATH/zlib1.2.11/comm/lib $DSS_LIBRARYS/zlib/lib cp -r $P_LIB_PATH/Huawei_Secure_C/comm/include $DSS_LIBRARYS/huawei_security/include cp -r $LIB_PATH/openssl/comm/include $DSS_LIBRARYS/openssl/include +cp -r $LIB_PATH/zlib1.2.11/comm/include $DSS_LIBRARYS/zlib/include if [ -f "/usr/include/libaio.h" ];then echo "begin cp libaio.h from /usr/include/" diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index 9134ce851a56f02969e7ddb99246fb4c87960b40..eb33e4c61e13e64f01977485646cd69db5b8dc47 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -12,6 +12,7 @@ endif (ENABLE_FUZZASAN) ## other dependency include include_directories(${DSS_SECUREC_INC_PATH}) include_directories(${DSS_OPENSSL_PATH}) +include_directories(${ZLIB_INC_PATH}) include_directories(${DSS_CBB_PATH}) aux_source_directory(${DSS_COMMON_PATH} COMMON_SRC) @@ -34,17 +35,17 @@ set(COMMON_ALL_SRC ADD_EXECUTABLE(dsscmd ${COMMON_ALL_SRC}) if (ENABLE_FUZZASAN) - target_link_libraries(dsscmd dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${vpp_libipsi_crypto} ${fuzz_lib} -Wl,--no-whole-archive) + target_link_libraries(dsscmd dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${zlib} ${3rd_libccb} ${vpp_libipsi_crypto} ${fuzz_lib} -Wl,--no-whole-archive) else() - target_link_libraries(dsscmd dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${vpp_libipsi_crypto} -Wl,--no-whole-archive) + target_link_libraries(dsscmd dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${zlib} ${3rd_libccb} ${vpp_libipsi_crypto} -Wl,--no-whole-archive) endif(ENABLE_FUZZASAN) if (ENABLE_DSSTEST) add_library(dsscmd_test SHARED ${COMMON_ALL_SRC}) if (ENABLE_FUZZASAN) - target_link_libraries(dsscmd_dest dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${vpp_libipsi_crypto} ${fuzz_lib} -Wl,--no-whole-archive) + target_link_libraries(dsscmd_dest dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${zlib} ${3rd_libccb} ${vpp_libipsi_crypto} ${fuzz_lib} -Wl,--no-whole-archive) else() - target_link_libraries(dsscmd_test dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${vpp_libipsi_crypto} -Wl,--no-whole-archive) + target_link_libraries(dsscmd_test dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${zlib} ${3rd_libccb} ${vpp_libipsi_crypto} -Wl,--no-whole-archive) endif(ENABLE_FUZZASAN) endif(ENABLE_DSSTEST) diff --git a/src/cmd/dsscmd.c b/src/cmd/dsscmd.c index adc049c8f62cd5cf125d6133cf67ef0da7e1e73d..00e97b7087a906627f68fbd3ca995dcc56acc0d2 100644 --- a/src/cmd/dsscmd.c +++ b/src/cmd/dsscmd.c @@ -194,9 +194,16 @@ static status_t cmd_check_au_size(const char *au_size_str) { uint32 min_multiple = DSS_MIN_AU_SIZE / SIZE_K(1); uint32 max_multiple = DSS_MAX_AU_SIZE / SIZE_K(1); - int64 au_size = atol(au_size_str); - if (au_size != 0 && ((au_size < min_multiple) || au_size > max_multiple)) { - DSS_PRINT_ERROR("au_size %lld is error, au_size must greater than 2MB, smaller than 64MB!\n", au_size); + uint32 au_size; + status_t ret = cm_str2uint32(au_size_str, &au_size); + if (ret != CM_SUCCESS) { + DSS_PRINT_ERROR("au_size %s is error\n", au_size_str); + return CM_ERROR; + } + + if (au_size == 0 || au_size < min_multiple || au_size > max_multiple) { + DSS_PRINT_ERROR( + "au_size %u is error, au_size cannot be 0, au_size must greater than 2MB, smaller than 64MB!\n", au_size); return CM_ERROR; } return CM_SUCCESS; @@ -332,11 +339,16 @@ static status_t cmd_check_measure_type(const char *measure) static status_t cmd_check_inst_id(const char *inst_str) { - int64 inst_id = atoll(inst_str); - if (inst_id < DSS_MIN_INST_ID || inst_id >= DSS_MAX_INST_ID) { + uint32 inst_id; + status_t ret = cm_str2uint32(inst_str, &inst_id); + if (ret != CM_SUCCESS) { DSS_PRINT_ERROR("The value of inst_id is invalid.\n"); return CM_ERROR; } + if (inst_id < DSS_MIN_INST_ID || inst_id >= DSS_MAX_INST_ID) { + DSS_PRINT_ERROR("The value of inst_id should be in [%u, %u).\n", DSS_MIN_INST_ID, DSS_MAX_INST_ID); + return CM_ERROR; + } return CM_SUCCESS; } @@ -1677,7 +1689,6 @@ static status_t kickh_proc(void) } static dss_args_t cmd_reghl_args[] = { - {'i', "inst_id", CM_TRUE, CM_TRUE, cmd_check_inst_id, NULL, NULL, 0, NULL, NULL, 0}, {'D', "DSS_HOME", CM_FALSE, CM_TRUE, cmd_check_dss_home, cmd_check_convert_dss_home, cmd_clean_check_convert, 0, NULL, NULL, 0}, }; @@ -1689,31 +1700,28 @@ static dss_args_set_t cmd_reghl_args_set = { static void reghl_help(char *prog_name) { - (void)printf("\nUsage:%s reghl <-i inst_id> [-D DSS_HOME]\n", prog_name); + (void)printf("\nUsage:%s reghl [-D DSS_HOME]\n", prog_name); (void)printf("[manage command] register host to array\n"); - (void)printf("-i/--inst_id , , the id of the host to be registered\n"); (void)printf("-D/--DSS_HOME , [optional], the run path of dssserver, default value is $DSS_HOME\n"); } static status_t reghl_proc(void) { - int64 host_id = atoll(cmd_reghl_args[DSS_ARG_IDX_0].input_args); - char *home = cmd_reghl_args[DSS_ARG_IDX_1].input_args != NULL ? cmd_reghl_args[DSS_ARG_IDX_1].input_args : NULL; + char *home = cmd_reghl_args[DSS_ARG_IDX_0].input_args != NULL ? cmd_reghl_args[DSS_ARG_IDX_0].input_args : NULL; dss_vg_info_t vg_info; errno_t errcode = memset_s(&vg_info, sizeof(vg_info), 0, sizeof(vg_info)); securec_check_ret(errcode); - status_t status = dss_reghl_core(home, host_id, &vg_info); + status_t status = dss_reghl_core(home, &vg_info); if (status != CM_SUCCESS) { - DSS_PRINT_ERROR("Failed to register host %s.\n", cmd_reghl_args[DSS_ARG_IDX_0].input_args); + DSS_PRINT_ERROR("Failed to register.\n"); } else { - DSS_PRINT_INF("Succeed to register host %s.\n", cmd_reghl_args[DSS_ARG_IDX_0].input_args); + DSS_PRINT_INF("Succeed to register.\n"); } return status; } static dss_args_t cmd_unreghl_args[] = { - {'i', "inst_id", CM_TRUE, CM_TRUE, cmd_check_inst_id, NULL, NULL, 0, NULL, NULL, 0}, {'t', "type", CM_FALSE, CM_TRUE, NULL, NULL, NULL, 0, NULL, NULL, 0}, {'D', "DSS_HOME", CM_FALSE, CM_TRUE, cmd_check_dss_home, cmd_check_convert_dss_home, cmd_clean_check_convert, 0, NULL, NULL, 0}, @@ -1726,28 +1734,33 @@ static dss_args_set_t cmd_unreghl_args_set = { static void unreghl_help(char *prog_name) { - (void)printf("\nUsage:%s unreghl <-i inst_id> [-t type] [-D DSS_HOME]\n", prog_name); + (void)printf("\nUsage:%s unreghl [-t type] [-D DSS_HOME]\n", prog_name); (void)printf("[manage command] unregister host from array\n"); - (void)printf("-i/--inst_id , , the id of the host need to unregister\n"); (void)printf("-t/--type , [optional], value is int, 0 without lock, otherwise with lock\n"); (void)printf("-D/--DSS_HOME , [optional], the run path of dssserver, default value is $DSS_HOME\n"); } static status_t unreghl_proc(void) { - int64 host_id = atoll(cmd_unreghl_args[DSS_ARG_IDX_0].input_args); - int64 type = - cmd_unreghl_args[DSS_ARG_IDX_1].input_args != NULL ? atoll(cmd_unreghl_args[DSS_ARG_IDX_1].input_args) : 1; - char *home = cmd_unreghl_args[DSS_ARG_IDX_2].input_args != NULL ? cmd_unreghl_args[DSS_ARG_IDX_2].input_args : NULL; + int32 type = 1; + status_t status; + if (cmd_unreghl_args[DSS_ARG_IDX_0].input_args != NULL) { + status = cm_str2int(cmd_unreghl_args[DSS_ARG_IDX_0].input_args, &type); + if (status != CM_SUCCESS) { + DSS_PRINT_ERROR("The value of type is invalid.\n"); + return CM_ERROR; + } + } + char *home = cmd_unreghl_args[DSS_ARG_IDX_1].input_args != NULL ? cmd_unreghl_args[DSS_ARG_IDX_1].input_args : NULL; dss_vg_info_t vg_info; errno_t errcode = memset_s(&vg_info, sizeof(vg_info), 0, sizeof(vg_info)); securec_check_ret(errcode); - status_t status = dss_unreghl_core(home, host_id, &vg_info, (type == 0) ? CM_FALSE : CM_TRUE); + status = dss_unreghl_core(home, &vg_info, (type == 0) ? CM_FALSE : CM_TRUE); if (status != CM_SUCCESS) { - DSS_PRINT_ERROR("Failed to unregister host %s.\n", cmd_unreghl_args[DSS_ARG_IDX_0].input_args); + DSS_PRINT_ERROR("Failed to unregister.\n"); } else { - DSS_PRINT_INF("Succeed to unregister host %s.\n", cmd_unreghl_args[DSS_ARG_IDX_0].input_args); + DSS_PRINT_INF("Succeed to unregister.\n"); } return status; } diff --git a/src/cmd/dsscmd_inq.c b/src/cmd/dsscmd_inq.c index 071495102a095c9eb27683c31ebc1d25ccef47a7..d8bace2c13d8df4c78e673e758d46017aee4f635 100644 --- a/src/cmd/dsscmd_inq.c +++ b/src/cmd/dsscmd_inq.c @@ -32,7 +32,7 @@ extern "C" { static void print_dev_info(ptlist_t *devs) { - printf("%-20s%-20s%-20s%-20s%-15s%-20s\n", "Dev", "Vendor", "Model", "ArraySN", "LUNID", "LUNWWN"); + printf("%-20s %-20s %-20s %-20s %-15s %-20s\n", "Dev", "Vendor", "Model", "ArraySN", "LUNID", "LUNWWN"); uint32 i; dev_info_t *dev_info = NULL; @@ -48,7 +48,7 @@ static void print_dev_info(ptlist_t *devs) cm_str2text(dev_info->data.vendor_info.product, &text); cm_trim_text(&text); DSS_RETURN_DRIECT_IFERR(cm_text2str(&text, dev_info->data.vendor_info.product, CM_MAX_PRODUCT_LEN)); - printf("%-20s%-20s%-20s%-20s%-15d%-20s\n", dev_info->dev, dev_info->data.vendor_info.vendor, + printf("%-20s %-20s %-20s %-20s %-15d %-20s\n", dev_info->dev, dev_info->data.vendor_info.vendor, dev_info->data.vendor_info.product, dev_info->data.array_info.array_sn, dev_info->data.lun_info.lun_id, dev_info->data.lun_info.lun_wwn); } @@ -59,9 +59,9 @@ static void print_dev_info(ptlist_t *devs) static void print_reg_info_rely_resk(int64 resk) { if (resk > 0) { - printf("%-20lld", resk - 1); + printf("%-20lld ", resk - 1); } else { - printf("%-20c", '-'); + printf("%-20c ", '-'); } } @@ -75,7 +75,7 @@ static void print_reg_info_rely_key_count(iof_reg_in_t *reg_info) (void)memset_s(buff, sizeof(buff), 0, sizeof(buff)); text.len = 0; for (int32 j = 0; j < reg_info->key_count; j++) { - cm_concat_int32(&text, DSS_MAX_REKEY_BUFF, (uint32)(reg_info->reg_keys[j] - 1)); + cm_concat_int32(&text, DSS_MAX_REKEY_BUFF, (int32)(reg_info->reg_keys[j] - 1)); if (j + 1 < reg_info->key_count) { (void)cm_concat_string(&text, DSS_MAX_REKEY_BUFF, ","); } @@ -88,7 +88,7 @@ static void print_reg_info_rely_key_count(iof_reg_in_t *reg_info) static void print_reg_info(ptlist_t *regs) { - printf("%-20s%-20s%-20s%-20s\n", "Dev", "Generation", "RESKEY", "REGKEY"); + printf("%-20s %-20s %-20s %-20s\n", "Dev", "Generation", "RESKEY", "REGKEY"); uint32 i; iof_reg_in_t *reg_info = NULL; @@ -96,7 +96,7 @@ static void print_reg_info(ptlist_t *regs) for (i = 0; i < regs->count; i++) { reg_info = (iof_reg_in_t *)cm_ptlist_get(regs, i); if (reg_info != NULL) { - printf("%-20s%-20u", reg_info->dev, reg_info->generation); + printf("%-20s %-20u ", reg_info->dev, reg_info->generation); print_reg_info_rely_resk(reg_info->resk); print_reg_info_rely_key_count(reg_info); } @@ -142,6 +142,9 @@ status_t inq_regs(void) bool32 is_register(iof_reg_in_t *reg, int64 host_id, int64 *iofence_key) { for (int32 i = 0; i < reg->key_count; i++) { + if (reg->reg_keys[i] < 1 || reg->reg_keys[i] > CM_MAX_INSTANCES) { + continue; + } iofence_key[reg->reg_keys[i] - 1]++; } for (int32 i = 0; i < reg->key_count; i++) { @@ -283,7 +286,7 @@ static void dss_printf_iofence_key(int64 *iofence_key) * 3. get vg non entry info * 4. register vg non entry disk */ -status_t dss_reghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_info) +status_t dss_reghl_core(const char *home, dss_vg_info_t *vg_info) { #ifndef WIN32 dss_config_t inst_cfg; @@ -291,7 +294,7 @@ status_t dss_reghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_info) DSS_RETURN_IFERR2(status, DSS_PRINT_ERROR("Failed to get vg entry info when reghl, errcode is %d.\n", status)); for (uint32 i = 0; i < vg_info->group_num; i++) { - status = dss_iof_register_single(host_id, vg_info->volume_group[i].entry_path); + status = dss_iof_register_single(inst_cfg.params.inst_id, vg_info->volume_group[i].entry_path); if (status != CM_SUCCESS) { DSS_FREE_POINT(vg_info->volume_group[0].buffer_cache); DSS_PRINT_ERROR("Failed to register vg entry disk when reghl, errcode is %d.\n", status); @@ -303,7 +306,7 @@ status_t dss_reghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_info) DSS_PRINT_ERROR("Failed to get vg non entry info when reghl, errcode is %d.\n", status); return status; } - status = dss_reghl_inner(&vg_info->volume_group[i], host_id); + status = dss_reghl_inner(&vg_info->volume_group[i], inst_cfg.params.inst_id); if (status != CM_SUCCESS) { DSS_FREE_POINT(vg_info->volume_group[0].buffer_cache); DSS_PRINT_ERROR("Failed to reghl, errcode is %d.\n", status); @@ -333,7 +336,7 @@ static status_t dss_unreghl_inner(dss_vg_info_item_t *item, int64 host_id) * 4. unregister vg non entry disk * 5. unregister vg entry disk */ -status_t dss_unreghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_info, bool32 is_lock) +status_t dss_unreghl_core(const char *home, dss_vg_info_t *vg_info, bool32 is_lock) { #ifndef WIN32 bool32 is_reg; @@ -343,7 +346,8 @@ status_t dss_unreghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_inf DSS_RETURN_IFERR2(status, DSS_PRINT_ERROR("Failed to get vg entry info, errcode is %d.\n", status)); for (uint32 i = 0; i < vg_info->group_num; i++) { - status = dss_check_volume_register(vg_info->volume_group[i].entry_path, host_id, &is_reg, iofence_key); + status = dss_check_volume_register( + vg_info->volume_group[i].entry_path, inst_cfg.params.inst_id, &is_reg, iofence_key); if (status != CM_SUCCESS) { DSS_FREE_POINT(vg_info->volume_group[0].buffer_cache); DSS_PRINT_ERROR("Failed to check volume register when unreghl, errcode is %d.\n", status); @@ -358,7 +362,7 @@ status_t dss_unreghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_inf DSS_PRINT_ERROR("Failed to get vg entry info when unreghl, errcode is %d.\n", status); return status; } - status = dss_unreghl_inner(&vg_info->volume_group[i], host_id); + status = dss_unreghl_inner(&vg_info->volume_group[i], inst_cfg.params.inst_id); if (status != CM_SUCCESS) { DSS_FREE_POINT(vg_info->volume_group[0].buffer_cache); DSS_PRINT_ERROR("Failed to unreghl, errcode is %d.\n", status); diff --git a/src/cmd/dsscmd_inq.h b/src/cmd/dsscmd_inq.h index 48e4d77e4d4e345e1637db5dc6898d06e68c3a87..5e16ec6b229b9e071c328ec27016d253efaf722a 100644 --- a/src/cmd/dsscmd_inq.h +++ b/src/cmd/dsscmd_inq.h @@ -34,8 +34,8 @@ extern "C" { status_t inq_lun(void); status_t inq_regs(void); status_t dss_check_volume_register(char *entry_path, int64 host_id, bool32 *is_reg, int64 *iofence_key); -status_t dss_unreghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_info, bool32 is_lock); -status_t dss_reghl_core(const char *home, int64 host_id, dss_vg_info_t *vg_info); +status_t dss_unreghl_core(const char *home, dss_vg_info_t *vg_info, bool32 is_lock); +status_t dss_reghl_core(const char *home, dss_vg_info_t *vg_info); status_t dss_inq_reg_core(const char *home, int64 host_id, dss_vg_info_t *vg_info); bool32 is_register(iof_reg_in_t *reg, int64 host_id, int64 *iofence_key); status_t dss_clean_vg_lock(const char *home, int64 inst_id); diff --git a/src/common/dss_alloc_unit.c b/src/common/dss_alloc_unit.c index bad3c67065990bb15ce3841a9f5e6b16dab2e1d4..d47a8239c27bae9acf20a8ec5092d967323d7199 100644 --- a/src/common/dss_alloc_unit.c +++ b/src/common/dss_alloc_unit.c @@ -301,14 +301,14 @@ status_t dss_get_core_version(dss_vg_info_item_t *item, uint64 *version) // shoud lock in caller status_t dss_load_core_ctrl(dss_vg_info_item_t *item, dss_core_ctrl_t *core) { - bool32 remote = CM_FALSE; + bool32 remote_chksum = CM_TRUE; status_t status = - dss_load_vg_ctrl_part(item, (int64)DSS_CTRL_CORE_OFFSET, core, (int32)DSS_CORE_CTRL_SIZE, &remote); + dss_load_vg_ctrl_part(item, (int64)DSS_CTRL_CORE_OFFSET, core, (int32)DSS_CORE_CTRL_SIZE, &remote_chksum); if (status != CM_SUCCESS) { return status; } - if (remote == CM_FALSE) { + if (remote_chksum == CM_FALSE) { uint32 checksum = dss_get_checksum(core, DSS_CORE_CTRL_SIZE); dss_check_checksum(checksum, core->checksum); } diff --git a/src/common/dss_defs.c b/src/common/dss_defs.c index a36bfbbcb86f18f8e5068b3d6b5cbb89b7c85dec..9635304c79996a682e4911e845e254c139a02961 100644 --- a/src/common/dss_defs.c +++ b/src/common/dss_defs.c @@ -266,6 +266,11 @@ status_t cm_str2size(const char *str, int64 *value) status_t cm_str2int(const char *str, int32 *value) { char *err = NULL; + int ret = cm_check_is_number(str); + if (ret != CM_SUCCESS) { + CM_THROW_ERROR_EX(ERR_VALUE_ERROR, "Convert int failed, the text is not number, text = %s", str); + return CM_ERROR; + } int64 val_int64 = strtol(str, &err, CM_DEFAULT_DIGIT_RADIX); if (dss_is_err(err)) { CM_THROW_ERROR_EX(ERR_VALUE_ERROR, "Convert int failed, text = %s", str); diff --git a/src/common/dss_diskgroup.c b/src/common/dss_diskgroup.c index caf7c5ff99439b3e8cf531eeabf8f01fa881f2f6..1ce7428f66ff234d2eb3cff846a8dd7257d76587 100644 --- a/src/common/dss_diskgroup.c +++ b/src/common/dss_diskgroup.c @@ -1206,10 +1206,6 @@ static status_t dss_remove_volume_impl_core( if (dss_read_volume(&vg_item->volume_handle[id], 0, vol_head, (int32)DSS_ALIGN_SIZE) != CM_SUCCESS) { break; } - if (vol_head->valid_flag != DSS_CTRL_VALID_FLAG) { - DSS_THROW_ERROR(ERR_DSS_VOLUME_REMOVE_NOEXIST, volume_name, vg_item->vg_name); - break; - } vol_head->valid_flag = 0; vol_head->software_version = 0; @@ -1480,7 +1476,7 @@ uint64 dss_get_vg_latch_shm_offset(dss_vg_info_item_t *vg_item) // shoud lock in caller status_t dss_load_volume_ctrl(dss_vg_info_item_t *vg_item, dss_volume_ctrl_t *volume_ctrl) { - bool32 remote = CM_FALSE; + bool32 remote = CM_TRUE; status_t status = dss_load_vg_ctrl_part( vg_item, (int64)DSS_CTRL_VOLUME_OFFSET, volume_ctrl, (int32)DSS_VOLUME_CTRL_SIZE, &remote); if (status != CM_SUCCESS) { @@ -1700,10 +1696,9 @@ bool32 dss_need_exec_local() } status_t dss_read_volume_inst( - dss_vg_info_item_t *vg_item, dss_volume_t *volume, int64 offset, void *buf, int32 size, bool32 *remote) + dss_vg_info_item_t *vg_item, dss_volume_t *volume, int64 offset, void *buf, int32 size, bool32 *remote_chksum) { status_t status = CM_ERROR; - *remote = CM_FALSE; CM_ASSERT(offset % DSS_DISK_UNIT_SIZE == 0); CM_ASSERT(size % DSS_DISK_UNIT_SIZE == 0); CM_ASSERT(((uint64)buf) % DSS_DISK_UNIT_SIZE == 0); @@ -1711,7 +1706,7 @@ status_t dss_read_volume_inst( while (dss_need_load_remote(size) == CM_TRUE && status != CM_SUCCESS) { status = remote_read_proc(vg_item->vg_name, volume, offset, buf, size); if (status != CM_SUCCESS) { - LOG_RUN_ERR("Failed to load disk(%s) data from the active node, result:%d", volume->name_p, status); + LOG_RUN_WAR("Failed to load disk(%s) data from the active node, result:%d", volume->name_p, status); if (dss_need_exec_local()) { break; } @@ -1719,14 +1714,17 @@ status_t dss_read_volume_inst( continue; } - if (dss_read_remote_checksum(buf, size) != CM_TRUE) { - LOG_RUN_ERR("Failed to load disk(%s) data from the active node, checksum error", volume->name_p); - continue; + if (*remote_chksum == CM_TRUE) { + if (dss_read_remote_checksum(buf, size) != CM_TRUE) { + LOG_RUN_WAR("Failed to load disk(%s) data from the active node, checksum error", volume->name_p); + status = CM_ERROR; + continue; + } } - *remote = CM_TRUE; return status; } + *remote_chksum = CM_FALSE; status = dss_read_volume(volume, offset, buf, size); if (status != CM_SUCCESS) { LOG_RUN_ERR("Failed to load disk(%s) data, result:%d", volume->name_p, status); diff --git a/src/common/dss_file.c b/src/common/dss_file.c index c5b78aa9584ead0b28e420d0ddfb80f8dc2ab8d8..facf04d9bab117926c0c32e5f7f184330a9d894f 100644 --- a/src/common/dss_file.c +++ b/src/common/dss_file.c @@ -2154,7 +2154,7 @@ status_t dss_refresh_root_ft(dss_vg_info_item_t *vg_item, bool32 check_version, if (dss_is_readwrite() && !active_refresh) { return CM_SUCCESS; } - bool32 remote = CM_FALSE; + bool32 remote = CM_TRUE; dss_ctrl_t *dss_ctrl = vg_item->dss_ctrl; char *root = dss_ctrl->root; dss_root_ft_block_t *ft_block = (dss_root_ft_block_t *)(root); @@ -3064,6 +3064,9 @@ static status_t dss_refresh_file_core(dss_vg_info_item_t *vg_item, uint64 fid, f if (node->fid != fid) { DSS_RETURN_IFERR2(CM_ERROR, LOG_DEBUG_ERR("Fid is not match,(%llu,%llu).", node->fid, fid)); } + LOG_DEBUG_INF( + "Apply refresh file:%s, curr size:%llu, refresh ft id:%llu, refresh entry id:%llu, refresh block id:%llu.", + node->name, node->size, *(uint64 *)&ftid, *(uint64 *)&(node->entry), *(uint64 *)&blockid); // check the entry and load char *block = dss_find_block_in_shm(vg_item, node->entry, DSS_BLOCK_TYPE_FS, CM_TRUE, NULL, CM_FALSE); if (!block) { diff --git a/src/common/dss_log.c b/src/common/dss_log.c index b5294c70cc864fa8395d542d6cf28d332518ca2f..1164ec96b31d469a0138c1f8b1e5b8d3444e7c5b 100644 --- a/src/common/dss_log.c +++ b/src/common/dss_log.c @@ -98,6 +98,7 @@ const char *g_dss_error_desc[DSS_ERROR_COUNT] = { Eg:server_locator=\"UDS:UNIX_emserver.domain\"", [ERR_DSS_RECV_MSG_FAILED] = "Recv msg failed, errcode:%d, inst:%u.", [ERR_DSS_LINK_NOT_EXIST] = "The link %s of %s does not exist.", + [ERR_DSS_INVALID_ID] = "Invalid %s id : %llu.", }; static status_t dss_init_log_file(log_param_t *log_param, dss_config_t *inst_cfg) @@ -228,6 +229,7 @@ status_t dss_init_loggers(dss_config_t *inst_cfg, dss_log_def_t *log_def, uint32 char file_name[CM_MAX_PATH_LEN]; log_param_t *log_param = cm_log_param_instance(); log_param->log_level = 0; + log_param->log_compressed = DSS_TRUE; if (dss_init_log_home(inst_cfg, log_param) != CM_SUCCESS) { return CM_ERROR; @@ -249,6 +251,7 @@ status_t dss_init_loggers(dss_config_t *inst_cfg, dss_log_def_t *log_def, uint32 if (cm_log_init(log_def[i].log_id, file_name) != CM_SUCCESS) { return CM_ERROR; } + cm_log_open_compress(log_def[i].log_id, DSS_TRUE); } log_param->log_instance_startup = CM_TRUE; cm_init_error_handler(cm_set_log_error); diff --git a/src/common/dss_meta_buf.c b/src/common/dss_meta_buf.c index d79f025e5526e9b0d8c6cc5a9f8755ae0b38da0d..7e3a4494c77b462b3aed5528490ccc757b2029e4 100644 --- a/src/common/dss_meta_buf.c +++ b/src/common/dss_meta_buf.c @@ -125,7 +125,7 @@ void dss_unregister_buffer_cache(dss_vg_info_item_t *vg_item, dss_block_id_t blo status_t dss_get_block_from_disk( dss_vg_info_item_t *vg_item, dss_block_id_t block_id, char *buf, int64_t offset, int32 size, bool32 calc_checksum) { - bool32 remote = CM_FALSE; + bool32 remote = calc_checksum; CM_ASSERT(block_id.volume < DSS_MAX_VOLUMES); status_t status = dss_check_read_volume(vg_item, (uint32)block_id.volume, offset, buf, size, &remote); if (status != CM_SUCCESS) { diff --git a/src/common/dss_protocol.c b/src/common/dss_protocol.c index ccae8a96dfdec276b099861cb6e503a7ff30f18d..6f24c8c3d3889c8b004d6d92d11d871430606398 100644 --- a/src/common/dss_protocol.c +++ b/src/common/dss_protocol.c @@ -129,7 +129,7 @@ status_t dss_put_str_with_cutoff(dss_packet_t *pack, const char *str) status_t dss_write_packet(cs_pipe_t *pipe, dss_packet_t *pack) { if (pack->head->size > DSS_MAX_PACKET_SIZE) { - DSS_RETURN_IFERR2(CM_ERROR, CM_THROW_ERROR(ERR_BUFFER_OVERFLOW, "PACKET BUFFER OVERFLOW")); + DSS_RETURN_IFERR2(CM_ERROR, CM_THROW_ERROR(ERR_BUFFER_OVERFLOW, pack->head->size, DSS_MAX_PACKET_SIZE)); } status_t status = VIO_SEND_TIMED(pipe, pack->buf, pack->head->size, DSS_DEFAULT_NULL_VALUE); DSS_RETURN_IFERR2( diff --git a/src/common/dss_protocol.h b/src/common/dss_protocol.h index 9c74d47a1ea7b5cdad4e2b3084cd6981a79eeac5..b66c461c50fde60f70f01a0f781cc4ad8b929509 100644 --- a/src/common/dss_protocol.h +++ b/src/common/dss_protocol.h @@ -133,7 +133,7 @@ static inline status_t dss_put_str(dss_packet_t *pack, const char *str) size = (uint32)strlen(str); addr = DSS_WRITE_ADDR(pack); if (size >= DSS_REMAIN_SIZE(pack)) { - CM_THROW_ERROR(ERR_BUFFER_OVERFLOW, "PACKET OVERFLOW"); + CM_THROW_ERROR(ERR_BUFFER_OVERFLOW, size, DSS_REMAIN_SIZE(pack) - 1); return CM_ERROR; } if (size != 0) { @@ -182,7 +182,7 @@ static inline status_t dss_put_int32(dss_packet_t *pack, uint32 value) static inline status_t dss_pack_check_len(dss_packet_t *pack, uint32 inc) { if ((pack->offset + inc) > pack->head->size) { - CM_THROW_ERROR(ERR_BUFFER_OVERFLOW, "PACKET OVERFLOW"); + CM_THROW_ERROR(ERR_BUFFER_OVERFLOW, (pack->offset + inc), pack->head->size); return CM_ERROR; } diff --git a/src/common/dss_volume.c b/src/common/dss_volume.c index d001718b9380f4fe1d1507b70d734fad2496d9ce..49774560b15fe0f49aa8fbbee72bc0549ccba3b8 100644 --- a/src/common/dss_volume.c +++ b/src/common/dss_volume.c @@ -561,6 +561,7 @@ status_t dss_read_volume(dss_volume_t *volume, int64 offset, void *buf, int32 si total_size = 0; do { + curr_size = 0; #ifdef WIN32 ret = dss_try_read_volume(volume, (char *)buf + total_size, size - total_size, &curr_size); #else @@ -573,6 +574,12 @@ status_t dss_read_volume(dss_volume_t *volume, int64 offset, void *buf, int32 si return CM_ERROR; } + if ((curr_size == 0) && (total_size < size)) { + LOG_RUN_ERR("Read volume %s size error, begin:%d, volume id:%u, size:%d, offset:%lld.", volume->name_p, + total_size, volume->id, size - total_size, offset); + return CM_ERROR; + } + total_size += curr_size; } while (total_size < size); diff --git a/src/common_api/dss_api_impl.c b/src/common_api/dss_api_impl.c index 61f5cc8db4b6f12d480bf9858d5eaf9ac92ad89d..5696a8bc65d50c1489c7f1c2527dc5fff2f912fc 100644 --- a/src/common_api/dss_api_impl.c +++ b/src/common_api/dss_api_impl.c @@ -109,6 +109,10 @@ status_t dss_apply_refresh_file(dss_conn_t *conn, dss_file_context_t *context, d send_pack->head->cmd = DSS_CMD_REFRESH_FILE; send_pack->head->flags = 0; + LOG_DEBUG_INF( + "Apply refresh file:%s, curr size:%llu, refresh ft id:%llu, refresh entry id:%llu, refresh block id:%llu.", + context->node->name, context->node->size, *(uint64 *)&ftid, *(uint64 *)&(context->node->entry), + *(uint64 *)&blockid); // 1. fid CM_RETURN_IFERR(dss_put_int64(send_pack, fid)); // 2. ftid @@ -1401,8 +1405,17 @@ static status_t dss_alloc_block_core( vg_item, second_block_id, DSS_BLOCK_TYPE_FS, DSS_FALSE, NULL, CM_FALSE); if ((*second_block) == NULL) { DSS_UNLOCK_VG_META_S(context->vg_item, conn->session); - LOG_RUN_ERR("Failed to find block:%llu in mem.", DSS_ID_TO_U64(second_block_id)); - return CM_ERROR; + status = dss_apply_refresh_file(conn, context, second_block_id); + DSS_RETURN_IFERR2(status, LOG_RUN_ERR("Failed to refresh second fs block.")); + DSS_LOCK_VG_META_S_RETURN_ERROR(context->vg_item, conn->session, NULL); + *second_block = (dss_fs_block_t *)dss_find_block_in_shm( + vg_item, second_block_id, DSS_BLOCK_TYPE_FS, DSS_FALSE, NULL, CM_FALSE); + if ((*second_block) == NULL) { + DSS_UNLOCK_VG_META_S(context->vg_item, conn->session); + DSS_THROW_ERROR(ERR_DSS_INVALID_ID, "fs_block", *(uint64 *)&second_block_id); + LOG_RUN_ERR("Failed to find block:%llu in mem.", DSS_ID_TO_U64(second_block_id)); + return CM_ERROR; + } } } else { *second_block = (dss_fs_block_t *)dss_find_block_in_shm( @@ -1622,6 +1635,7 @@ status_t dss_read_write_file_core(dss_rw_param_t *param, void *buf, int32 size, return CM_SUCCESS; } DSS_UNLOCK_VG_META_S(context->vg_item, conn->session); + DSS_THROW_ERROR(ERR_DSS_INVALID_ID, "au", *(uint64 *)&auid); LOG_DEBUG_ERR("Auid is invalid, volume:%u, fname:%s, fsize:%llu, written_size:%llu.", (uint32)auid.volume, node->name, node->size, node->written_size); return CM_ERROR; @@ -2406,6 +2420,7 @@ static status_t get_fd(dss_rw_param_t *param, int32 size, bool32 is_read, int *f if (auid.volume >= DSS_MAX_VOLUMES) { DSS_UNLOCK_VG_META_S(context->vg_item, conn->session); + DSS_THROW_ERROR(ERR_DSS_INVALID_ID, "au", *(uint64 *)&auid); LOG_DEBUG_ERR("Auid is invalid, volume:%u, fname:%s, fsize:%llu, written_size:%llu.", (uint32)auid.volume, node->name, node->size, node->written_size); return CM_ERROR; diff --git a/src/interface/CMakeLists.txt b/src/interface/CMakeLists.txt index 8f9c5d164a193e9ad5249d3a553d92271c11c9fa..92d85eb765f703f5ffb7071b223c5b4d71fd6011 100644 --- a/src/interface/CMakeLists.txt +++ b/src/interface/CMakeLists.txt @@ -12,6 +12,7 @@ endif(ENABLE_FUZZASAN) ## other dependency include include_directories(${DSS_SECUREC_INC_PATH}) include_directories(${DSS_OPENSSL_PATH}) +include_directories(${ZLIB_INC_PATH}) include_directories(${LIBAIO_INC_PATH}) include_directories(${DSS_CBB_PATH}) @@ -39,8 +40,8 @@ set(COMMON_ALL_SRC add_library(dssapi SHARED ${COMMON_ALL_SRC}) if (ENABLE_FUZZASAN) - target_link_libraries(dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${fuzz_lib} -Wl,-Bstatic ${3rd_libccb} -Wl,-Bdynamic ${vpp_libipsi_crypto} -Wl,--no-whole-archive) + target_link_libraries(dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${zlib} ${fuzz_lib} -Wl,-Bstatic ${3rd_libccb} -Wl,-Bdynamic ${vpp_libipsi_crypto} -Wl,--no-whole-archive) else() - target_link_libraries(dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} -Wl,-Bstatic ${3rd_libccb} -Wl,-Bdynamic ${vpp_libipsi_crypto} -Wl,--no-whole-archive) + target_link_libraries(dssapi pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${zlib} -Wl,-Bstatic ${3rd_libccb} -Wl,-Bdynamic ${vpp_libipsi_crypto} -Wl,--no-whole-archive) endif(ENABLE_FUZZASAN) diff --git a/src/interface/dss_api.c b/src/interface/dss_api.c index 4b21362891bf1cb090ae2c05f432884b832b8103..80be3b52ce424bb283418b96633f10365aa6c26f 100644 --- a/src/interface/dss_api.c +++ b/src/interface/dss_api.c @@ -735,6 +735,7 @@ static int32 init_single_logger(log_param_t *log_param, log_type_t log_id) char file_name[CM_FILE_NAME_BUFFER_SIZE] = {'\0'}; CM_RETURN_IFERR(init_single_logger_core(log_param, log_id, file_name, CM_FILE_NAME_BUFFER_SIZE)); (void)cm_log_init(log_id, (const char *)file_name); + cm_log_open_compress(log_id, DSS_TRUE); return DSS_SUCCESS; } @@ -771,6 +772,11 @@ int32 dss_init_logger(char *log_home, unsigned int log_level, unsigned int log_b log_param->audit_backup_file_count = log_backup_file_count; log_param->max_log_file_size = log_max_file_size; log_param->max_audit_file_size = log_max_file_size; + log_param->log_compressed = DSS_TRUE; + log_param->log_compress_buf = malloc(CM_LOG_COMPRESS_BUFSIZE); + if (log_param->log_compress_buf == NULL) { + return ERR_DSS_INIT_LOGGER_FAILED; + } cm_log_set_file_permissions(600); cm_log_set_path_permissions(700); (void)cm_set_log_module_name("DSS", sizeof("DSS")); diff --git a/src/interface/dss_errno.h b/src/interface/dss_errno.h index 71b02adc55c7d44f19d1f8bf4971b012dbf91099..e8956b5166ac1ab4272ff97fa9b75f0a79db92aa 100644 --- a/src/interface/dss_errno.h +++ b/src/interface/dss_errno.h @@ -119,6 +119,7 @@ extern "C" { #define ERR_DSS_RECV_MSG_FAILED 2412 #define ERR_DSS_LINK_NOT_EXIST 2413 #define ERR_DSS_INIT_LOGGER_FAILED 2414 +#define ERR_DSS_INVALID_ID 2416 #define ERR_DSS_CEIL 2500 #ifdef __cplusplus diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index 449a6576d826ef8c387f6771558303f78a8b710c..facee20393cbac5cf6467b51625cf639b5d5323f 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -12,6 +12,7 @@ endif(ENABLE_FUZZASAN) include_directories(${DSS_SECUREC_INC_PATH}) include_directories(${DSS_OPENSSL_PATH}) include_directories(${DSS_CBB_PATH}) +include_directories(${ZLIB_INC_PATH}) aux_source_directory(${DSS_COMMON_PATH} COMMON_SRC) aux_source_directory(${DSS_SER_PATH} SER_SRC) @@ -29,7 +30,7 @@ set(COMMON_ALL_SRC ADD_EXECUTABLE(dssserver ${COMMON_ALL_SRC}) if (ENABLE_FUZZASAN) - target_link_libraries(dssserver pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${vpp_libipsi_crypto} ${fuzz_lib} -Wl,--no-whole-archive) + target_link_libraries(dssserver pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${zlib} ${vpp_libipsi_crypto} ${fuzz_lib} -Wl,--no-whole-archive) else() - target_link_libraries(dssserver pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${vpp_libipsi_crypto} -Wl,--no-whole-archive) + target_link_libraries(dssserver pthread dl rt -Wl,--whole-archive ${vpp_libsecurec} ${3rd_libssl} ${3rd_libccb} ${zlib} ${vpp_libipsi_crypto} -Wl,--no-whole-archive) endif(ENABLE_FUZZASAN) diff --git a/src/service/dss_mes.c b/src/service/dss_mes.c index 95901e196266c728d06804ae768b9d0165eeca19..bb169cf5f5a64cdc0058cd93f8419c8193b15ee4 100644 --- a/src/service/dss_mes.c +++ b/src/service/dss_mes.c @@ -784,29 +784,24 @@ static status_t dss_rec_msgs(dss_session_t *session, void *buf, int32 size) lastctrl.seq = 0; lastctrl.cursize = 0; big_packets_ctrl_t ctrl; - do { status_t ret = mes_allocbuf_and_recv_data((uint16)session->id, &msg, DSS_MES_WAIT_TIMEOUT); if (ret != CM_SUCCESS) { LOG_RUN_ERR("dss server receive msg from remote node failed, result:%d.", ret); - dss_set_master_id(DSS_INVALID_ID32); return ret; } if (msg.head->size < (sizeof(mes_message_head_t) + sizeof(big_packets_ctrl_t))) { LOG_RUN_ERR("dss server load disk from remote node failed, msg len(%d) error.", msg.head->size); - dss_set_master_id(DSS_INVALID_ID32); mes_release_message_buf(&msg); return CM_ERROR; } - ctrl = *(big_packets_ctrl_t *)(msg.buffer + sizeof(mes_message_head_t)); if (dss_packets_verify(bfirst, &lastctrl, &ctrl) == CM_FALSE) { mes_release_message_buf(&msg); LOG_RUN_ERR("dss server receive msg verify failed."); return CM_ERROR; } - errno_t errcode = memcpy_s((char *)buf + ctrl.offset, ctrl.cursize, msg.buffer + sizeof(mes_message_head_t) + sizeof(big_packets_ctrl_t), ctrl.cursize); mes_release_message_buf(&msg); @@ -853,7 +848,6 @@ status_t dss_read_volume_remote(const char *vg_name, dss_volume_t *volume, int64 LOG_RUN_ERR( "The dssserver fails to send messages to the remote node, src node (%u), dst node(%u).", currid, remoteid); dss_destroy_session(session); - dss_set_master_id(DSS_INVALID_ID32); return ret; } // 3. receive msg from remote diff --git a/src/service/dss_service.c b/src/service/dss_service.c index ad9700db436d6b8614c71f96ea53f1dc3be194ee..706d16c5ad6dc8569f9aee9b614e28efd80ab1b2 100644 --- a/src/service/dss_service.c +++ b/src/service/dss_service.c @@ -470,7 +470,7 @@ static status_t dss_process_truncate_file(dss_session_t *session) DSS_RETURN_IF_ERROR(dss_get_int32(&session->recv_pack, (int32 *)&vgid)); DSS_RETURN_IF_ERROR(dss_set_audit_resource(session->audit_info.resource, DSS_AUDIT_MODIFY, "vg_name:%s, fid:%llu, ftid:%llu", vg_name, fid, *(uint64 *)&ftid)); - + LOG_DEBUG_INF("Truncate file ft id:%llu, offset:%lld, length:%llu", *(uint64 *)&ftid, offset, length); return dss_truncate(session, fid, ftid, offset, length, vg_name); } diff --git a/src/service/dssserver.c b/src/service/dssserver.c index 474ab80003aeed9761dc6016713d065e6395b146..35750e066c8fbd35b1a1928dd443284e81a823ba 100644 --- a/src/service/dssserver.c +++ b/src/service/dssserver.c @@ -103,6 +103,7 @@ static void dss_clean_server() (void)cm_unlock_fd(g_dss_instance.lock_fd); cm_close_file(g_dss_instance.lock_fd); } + CM_FREE_PTR(cm_log_param_instance()->log_compress_buf); } static void handle_main_wait(void)