【重要Bug修复】延迟删除机制与Rulescan延迟更新机制发生冲突。当两次删除配置删除间隔小于rulescan延迟更新时间时,会导致扫描线程访问已释放的group_rule,轻则崩溃,重则思索。
This commit is contained in:
@@ -2623,7 +2623,7 @@ void garbage_bagging(enum maat_garbage_type type,void *p,MESA_lqueue_head garbag
|
|||||||
MESA_lqueue_join_tail(garbage_q,&bag,sizeof(void*));
|
MESA_lqueue_join_tail(garbage_q,&bag,sizeof(void*));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void garbage_bury(MESA_lqueue_head garbage_q,void *logger)
|
void garbage_bury(MESA_lqueue_head garbage_q,int timeout,void *logger)
|
||||||
{
|
{
|
||||||
MESA_queue_errno_t q_ret=MESA_QUEUE_RET_OK;
|
MESA_queue_errno_t q_ret=MESA_QUEUE_RET_OK;
|
||||||
_maat_garbage_t* bag=NULL;
|
_maat_garbage_t* bag=NULL;
|
||||||
@@ -2638,7 +2638,7 @@ void garbage_bury(MESA_lqueue_head garbage_q,void *logger)
|
|||||||
data_size=sizeof(void*);
|
data_size=sizeof(void*);
|
||||||
q_ret=(MESA_queue_errno_t)MESA_lqueue_get_head(garbage_q,&bag,&data_size);
|
q_ret=(MESA_queue_errno_t)MESA_lqueue_get_head(garbage_q,&bag,&data_size);
|
||||||
assert(data_size==sizeof(void*)&&q_ret==MESA_QUEUE_RET_OK);
|
assert(data_size==sizeof(void*)&&q_ret==MESA_QUEUE_RET_OK);
|
||||||
if(now-bag->create_time<10)
|
if(now-bag->create_time<timeout)
|
||||||
{
|
{
|
||||||
MESA_lqueue_join_tail(garbage_q,&bag,sizeof(void*));
|
MESA_lqueue_join_tail(garbage_q,&bag,sizeof(void*));
|
||||||
continue;
|
continue;
|
||||||
@@ -3042,7 +3042,7 @@ void *thread_rule_monitor(void *arg)
|
|||||||
feather->scanner->version,feather->scanner->cfg_num);
|
feather->scanner->version,feather->scanner->cfg_num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
garbage_bury(feather->garbage_q,feather->logger);
|
garbage_bury(feather->garbage_q,feather->effect_interval_ms/1000+10,feather->logger);
|
||||||
if(feather->stat_on==1&&scan_dir_cnt%2==0)//output every 2 seconds
|
if(feather->stat_on==1&&scan_dir_cnt%2==0)//output every 2 seconds
|
||||||
{
|
{
|
||||||
maat_stat_output(feather);
|
maat_stat_output(feather);
|
||||||
@@ -3051,7 +3051,7 @@ void *thread_rule_monitor(void *arg)
|
|||||||
|
|
||||||
MESA_htable_destroy(feather->map_tablename2id,free);
|
MESA_htable_destroy(feather->map_tablename2id,free);
|
||||||
destroy_maat_scanner(feather->scanner);
|
destroy_maat_scanner(feather->scanner);
|
||||||
garbage_bury(feather->garbage_q,feather->logger);
|
garbage_bury(feather->garbage_q,feather->effect_interval_ms/1000+10,feather->logger);
|
||||||
MESA_lqueue_destroy(feather->garbage_q,lqueue_destroy_cb,NULL);
|
MESA_lqueue_destroy(feather->garbage_q,lqueue_destroy_cb,NULL);
|
||||||
FS_stop(&(feather->stat_handle));
|
FS_stop(&(feather->stat_handle));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user