--- ./source/private_module/pmgr/pmgr_event_handle.c	2018-03-23 03:46:56.000000000 +0000
+++ ./source/private_module/pmgr/pmgr_event_handle.c.hotpatch	2019-03-24 07:48:26.000000000 +0000
@@ -3237,7 +3237,7 @@
     TASK_CALL_ACTION_DONE_ASYNC_WITH_RESULT(task, RETURN_OK);
     return RETURN_OK;
 }
-
+extern void pmgrCheckDiskPoolMixFormatTaskNew(void);
 /**************************************************************************
     :  ʱع
 :  context    ʱ
@@ -3249,7 +3249,7 @@
 {
     PMGR_EH_TASK *ehTask = NULL;
     UNREFERENCE_PARAM(context);
-    
+    pmgrCheckDiskPoolMixFormatTaskNew();
     if (0 < atomic_read(&g_stopScheduleLevelingTimeLen))
     {
         atomic_dec(&g_stopScheduleLevelingTimeLen);
@@ -3328,5 +3328,240 @@
     return;    
 }
 
+#ifdef _DEBUG
+#define TEST_DEBUGLOG(LogID, ...) DBG_LogInfo((LogID), __VA_ARGS__)
+#else
+#define TEST_DEBUGLOG(LogID, ...)
+#endif
+uint64_t g_simuAllocMsgFailNew = 0;
+/**************************************************************************
+    :  װmixformattlvϢ
+:  poolId           POOL ID
+:  void **tlvMsg  Ϣ
+           uint32_t *len  Ϣ
+ֵ  :  RETURN_OK     óɹ
+           RETURN_ERROR  ʧ
+    :  
+**************************************************************************/
+int32_t createMixFormatOmTlvMsgNew(poolid_t poolId, void **tlvMsg, uint32_t *len)
+{
+    void        *pMsg   = NULL;
+    void        *msgObj = NULL;
+    int32_t     result  = 0;
+    uint32_t    msgLen  = 0;
+    char    temp[10] = "\0";
+
+    if (0 != g_simuAllocMsgFailNew)
+    {
+        DBG_LogError(DBG_LOGID_NEW, "Simulate MSG create fail, pool(%u).", poolId);
+        return RETURN_ERROR;
+    }
+
+    msgObj = MSGOBJ_CreateNonBlock(1, cmo_diskpool_butt);
+    if (NULL == msgObj)
+    {
+        DBG_LogError(DBG_LOGID_NEW, "MSGOBJ_Create Fail.pool(%u).", poolId);
+        return RETURN_ERROR;
+    }
+
+    /* OPCODE */
+    MSGOBJ_SetRecordOpcodeNonBlock(msgObj, 0, OM_OPCODE_MODIFY);
+
+    /*  */
+    MSGOBJ_SetItemUnsignedNonBlock(msgObj, 0, cmo_type,
+                           (uint64_t)OM_OBJ_DISKPOOL, sizeof(int32_t));
+    snprintf(temp, 10, "%u", poolId);
+    MSGOBJ_SetItemStringNonBlock(msgObj, 0, cmo_id, temp);
+    MSGOBJ_SetItemUnsignedNonBlock(msgObj, 0, cmo_diskpool_mixFormatType, (uint64_t)DISK_EXTENT_FORMAT, sizeof(uint8_t));
+
+    /*  жǷɹ */
+    /* ¼ */
+    result = MSGOBJ_GetLastErrorNonBlock(msgObj);
+    if (unlikely(RETURN_OK != result))
+    {
+        DBG_LogError(DBG_LOGID_NEW, "Encode msg item to SYS failed(%d).pool(%u).", result, poolId);
+        MSGOBJ_ClearErrorNonBlock(msgObj);
+        MSGOBJ_DestroyNonBlock(msgObj);
+        return result;
+    }
+
+    /* ȡĳ */
+    result = MSGOBJ_GetObjInfoNonBlock(msgObj, &msgLen, NULL, NULL);
+    if (unlikely(RETURN_OK != result))
+    {
+        MSGOBJ_DestroyNonBlock(msgObj);
+        DBG_LogError(DBG_LOGID_NEW, "Get om msg object info failed(%d).pool(%u).", result, poolId);
+        return RETURN_ERROR;
+    }
+
+    /* նĳȣϢռ */
+    pMsg = MSG_AllocMsgNonBlock(msgLen);
+    if (unlikely(NULL == pMsg))
+    {
+        MSGOBJ_DestroyNonBlock(msgObj);
+        DBG_LogError(DBG_LOGID_NEW, "Malloc msg failed, len(%d).pool(%u).", msgLen, poolId);
+        return RETURN_ERROR;
+    }
+
+    /* Ϣ */
+    result = MSGOBJ_EncodeNonBlock(msgObj, pMsg, msgLen);
+    if (unlikely(RETURN_OK != result))
+    {
+        MSG_FreeMsg(pMsg);
+        MSGOBJ_DestroyNonBlock(msgObj);
+        DBG_LogError(DBG_LOGID_NEW, "Encode msg failed(%d).pool(%u).", result, poolId);
+        return RETURN_ERROR;
+    }
+
+    *tlvMsg = pMsg;
+    *len    = msgLen;
+    /* ʹɣͷϢ */
+    MSGOBJ_DestroyNonBlock(msgObj);
+    msgObj = NULL;    
+
+    return RETURN_OK;
+}
+
+FN_getGlbMasterNodeId g_getGlbMasterNodeIdNew = NULL;
+
+int32_t pmgrGetGlbMasterNodeIdNew(nid_t* nodeId)
+{
+    if(NULL == g_getGlbMasterNodeIdNew)
+    {
+        g_getGlbMasterNodeIdNew = (FN_getGlbMasterNodeId)(ptrdiff_t)lookupIntfMethod(INTF_SYSCTRL_INTF,
+            METHOD_getGlbMasterNodeId, ANONYMOUS_SERVER_ID, 0);
+    }
+
+    if (unlikely(NULL == g_getGlbMasterNodeIdNew))
+    {
+        return RETURN_ERROR;
+    }
+
+    return g_getGlbMasterNodeIdNew(nodeId);
+}
 
+/**************************************************************************
+    :  зtlvϢģcli޸Disk PoolϸʽϢ
+:  poolId           POOL ID
+:  
+ֵ  :  RETURN_OK     óɹ
+           RETURN_ERROR  ʧ
+    :  
+**************************************************************************/
+int32_t patchSendCfgMixFormateMsgNew(poolid_t poolId)
+{
+    int32_t         result     = RETURN_ERROR;
+    uint32_t        msgLen     = 0;
+    void           *pMsg       = NULL;
+    MSG_INFO_S      stMsgInfo  = {0};
+    nid_t MasterNodeId;
+
+    DBG_LogInfo(DBG_LOGID_NEW, "Send pool(%u) mix format msg begin.", poolId);
+
+    result = pmgrGetGlbMasterNodeIdNew(&MasterNodeId);
+    if (unlikely(RETURN_OK != result))
+    {
+        DBG_LogInfo(DBG_LOGID_NEW, "Get master node error, result(%d).", result);
+        return result;
+    }
+    result = createMixFormatOmTlvMsgNew(poolId, &pMsg, &msgLen); 
+    if (unlikely(RETURN_OK != result))
+    {
+        return result;
+    }
+
+    /* ʼϢģ顢ģ */
+    MSG_InitMsgInfoNonBlock(&stMsgInfo);
+    stMsgInfo.usSenderPID   = PID_PMGR;
+    stMsgInfo.usReceiverBID = MasterNodeId;               /* Ⱥ */
+    stMsgInfo.usReceiverPID = OSP_SYS;                         /* Ϣģ */
+    stMsgInfo.uiMsgLength   = msgLen;
+    stMsgInfo.usMsgType     = MSG_TYPE_REQUEST;
+    stMsgInfo.uiMsgOPCode   = MSG_OP_MMT_TLV_REQUEST;      
+    stMsgInfo.uiMsgTimeout  = 60;                /* ʱʱ */
+    stMsgInfo.uiSessionKey  = INVALID_VALUE32;
+
+    /* 2.Ϣ */
+    result = MSG_PostAsyncMsgNonBlock(pMsg, &stMsgInfo, NULL);
+    if (unlikely(RETURN_OK != result))
+    {
+        DBG_LogError(DBG_LOGID_NEW, "Post OM message failed(%d) poolid(%u)",
+            result, poolId);
+        return result;
+    }
+
+    return RETURN_OK;
+}
+/**************************************************************************
+     :  ӲĻϸʽܲ裬и
+            fillGetDiskPoolBgrTaskAcions
+ :  task 
+ :  
+ ֵ  :  
+     :  
+**************************************************************************/
+void checkDiskPoolMixFormatTaskNew(void)
+{
+    poolid_t    diskPoolId;
+    uint8_t     mixFormatType = INVALID_VALUE8;
+    uint8_t     formatType = INVALID_VALUE8;
+    PMGR_OBJ_S *poolObj = NULL;
+    nid_t       MasterNodeId;
+    int32_t     result     = RETURN_ERROR;
+    TEST_DEBUGLOG(DBG_LOGID_NEW, "checkDiskPoolMixFormatTask begin.");
+
+    result = pmgrGetGlbMasterNodeIdNew(&MasterNodeId);
+    if (unlikely(RETURN_OK != result))
+    {
+        return ;
+    }
+
+    if (MasterNodeId != getLocalNid())
+    {
+        TEST_DEBUGLOG(DBG_LOGID_NEW, "Current node is not master.");
+        return;   /*ֻڼȺ*/
+    }
+
+    for (diskPoolId = 0; diskPoolId < g_MaxDiskPoolNum; diskPoolId++)
+    {
+        if (isDiskPoolExistIntf(diskPoolId))
+        {
+            poolObj = getPoolObj(diskPoolId);
+            spin_lock(&poolObj->poolObjLock);
+            mixFormatType = poolObj->diskPoolCfgPara.poolCfg.mixFormatType;
+            formatType = poolObj->diskPoolCfgPara.poolCfg.formatType;
+            spin_unlock(&poolObj->poolObjLock);
+            TEST_DEBUGLOG(DBG_LOGID_NEW, "Found pool(%u) format type(%u) mix type(%u).",
+                diskPoolId, formatType, mixFormatType);
+            if(UNIFIED_FORMAT == mixFormatType && CKG_DISK_FORMAT == formatType)
+            {
+                (void)patchSendCfgMixFormateMsgNew(diskPoolId);
+            }
+        }
+    }
+
+    return;
+}
+uint64_t g_domainMixFormatActiveTime = 0;
+uint64_t g_domainMixFormatTimeNew = 30*24*60*60; /* һ */
+/**************************************************************************
+     :  ʱ(һ)domainΪϸʽ10ӵĶʱӵãֻ
+            5Ρ
+ :  
+ :  
+ ֵ  :  
+     :  
+**************************************************************************/
+void pmgrCheckDiskPoolMixFormatTaskNew(void)
+{
+    uint64_t secondFrontControllerStart;
+    secondFrontControllerStart = jiffies / HZ;
+    TEST_DEBUGLOG(DBG_LOGID_NEW, "Start check mix format type at %lluS,actived %llu times.",
+                secondFrontControllerStart, g_domainMixFormatActiveTime);
+    if (secondFrontControllerStart > g_domainMixFormatTimeNew && g_domainMixFormatActiveTime < 5)
+    {
+        g_domainMixFormatActiveTime++;
+        checkDiskPoolMixFormatTaskNew();
+    }
+}
 
