bug fixed: must check store_path_index
parent
c25d3a7d01
commit
d1ba6c61db
3
HISTORY
3
HISTORY
|
|
@ -1,11 +1,12 @@
|
||||||
|
|
||||||
Version 5.07 2015-08-16
|
Version 5.07 2015-08-17
|
||||||
* schedule task add the "second" field
|
* schedule task add the "second" field
|
||||||
* make.sh changed, you must upgrade libfastcommon to V1.20 or later
|
* make.sh changed, you must upgrade libfastcommon to V1.20 or later
|
||||||
* bug fixed: storage_disk_recovery.c skip the first file (binlog first line)
|
* bug fixed: storage_disk_recovery.c skip the first file (binlog first line)
|
||||||
* bug fixed: should close connection after fetch binlog
|
* bug fixed: should close connection after fetch binlog
|
||||||
* fdfs_storaged.c: advance the position of daemon_init
|
* fdfs_storaged.c: advance the position of daemon_init
|
||||||
* set log rotate time format
|
* set log rotate time format
|
||||||
|
* bug fixed: must check store_path_index
|
||||||
|
|
||||||
Version 5.06 2015-05-12
|
Version 5.06 2015-05-12
|
||||||
* compile passed in mac OS Darwin
|
* compile passed in mac OS Darwin
|
||||||
|
|
|
||||||
|
|
@ -3758,6 +3758,15 @@ static int storage_server_trunk_alloc_space(struct fast_task_info *pTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
trunkInfo.path.store_path_index = *(in_buff+FDFS_GROUP_NAME_MAX_LEN+4);
|
trunkInfo.path.store_path_index = *(in_buff+FDFS_GROUP_NAME_MAX_LEN+4);
|
||||||
|
if (trunkInfo.path.store_path_index < 0 ||
|
||||||
|
trunkInfo.path.store_path_index >= g_fdfs_store_paths.count)
|
||||||
|
{
|
||||||
|
logError("file: "__FILE__", line: %d, " \
|
||||||
|
"client ip: %s, store_path_index: %d " \
|
||||||
|
"is invalid", __LINE__, \
|
||||||
|
pTask->client_ip, trunkInfo.path.store_path_index);
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
if ((result=trunk_alloc_space(file_size, &trunkInfo)) != 0)
|
if ((result=trunk_alloc_space(file_size, &trunkInfo)) != 0)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -3981,6 +3990,16 @@ static int storage_server_trunk_confirm_or_free(struct fast_task_info *pTask)
|
||||||
trunkInfo.file.offset = buff2int(pTrunkBuff->offset);
|
trunkInfo.file.offset = buff2int(pTrunkBuff->offset);
|
||||||
trunkInfo.file.size = buff2int(pTrunkBuff->size);
|
trunkInfo.file.size = buff2int(pTrunkBuff->size);
|
||||||
|
|
||||||
|
if (trunkInfo.path.store_path_index < 0 ||
|
||||||
|
trunkInfo.path.store_path_index >= g_fdfs_store_paths.count)
|
||||||
|
{
|
||||||
|
logError("file: "__FILE__", line: %d, " \
|
||||||
|
"client ip: %s, store_path_index: %d " \
|
||||||
|
"is invalid", __LINE__, \
|
||||||
|
pTask->client_ip, trunkInfo.path.store_path_index);
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (pHeader->cmd == STORAGE_PROTO_CMD_TRUNK_ALLOC_CONFIRM)
|
if (pHeader->cmd == STORAGE_PROTO_CMD_TRUNK_ALLOC_CONFIRM)
|
||||||
{
|
{
|
||||||
return trunk_alloc_confirm(&trunkInfo, pHeader->status);
|
return trunk_alloc_confirm(&trunkInfo, pHeader->status);
|
||||||
|
|
|
||||||
|
|
@ -750,6 +750,15 @@ static int storage_trunk_restore(const int64_t restore_offset)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (record.trunk.path.store_path_index < 0 ||
|
||||||
|
record.trunk.path.store_path_index >= g_fdfs_store_paths.count)
|
||||||
|
{
|
||||||
|
logError("file: "__FILE__", line: %d, " \
|
||||||
|
"store_path_index: %d is invalid", __LINE__, \
|
||||||
|
record.trunk.path.store_path_index);
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
line_count++;
|
line_count++;
|
||||||
if (record.op_type == TRUNK_OP_TYPE_ADD_SPACE)
|
if (record.op_type == TRUNK_OP_TYPE_ADD_SPACE)
|
||||||
{
|
{
|
||||||
|
|
@ -784,8 +793,7 @@ static int storage_trunk_restore(const int64_t restore_offset)
|
||||||
logError("file: "__FILE__", line: %d, "\
|
logError("file: "__FILE__", line: %d, "\
|
||||||
"avl_tree_insert fail, " \
|
"avl_tree_insert fail, " \
|
||||||
"errno: %d, error info: %s", \
|
"errno: %d, error info: %s", \
|
||||||
__LINE__, result, \
|
__LINE__, result, STRERROR(result));
|
||||||
STRERROR(result));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else if (result == 0)
|
else if (result == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue