--- ./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	2018-08-16 14:01:37.000000000 +0000
@@ -3237,7 +3237,7 @@
     TASK_CALL_ACTION_DONE_ASYNC_WITH_RESULT(task, RETURN_OK);
     return RETURN_OK;
 }
-
+extern void pmgrCheckDiskPoolMixFormatTask(void);
 /**************************************************************************
     :  ʱع
 :  context    ʱ
@@ -3249,7 +3249,7 @@
 {
     PMGR_EH_TASK *ehTask = NULL;
     UNREFERENCE_PARAM(context);
-    
+    pmgrCheckDiskPoolMixFormatTask();
     if (0 < atomic_read(&g_stopScheduleLevelingTimeLen))
     {
         atomic_dec(&g_stopScheduleLevelingTimeLen);
@@ -3328,5 +3328,236 @@
     return;    
 }
 
+#ifdef _DEBUG
+#define TEST_DEBUGLOG(LogID, ...) DBG_LogInfo((LogID), __VA_ARGS__)
+#else
+#define TEST_DEBUGLOG(LogID, ...)
+#endif
+uint64_t g_simuAllocMsgFail = 0;
+/**************************************************************************
+    :  װmixformattlvϢ
+:  poolId           POOL ID
+:  void **tlvMsg  Ϣ
+           uint32_t *len  Ϣ
+ֵ  :  RETURN_OK     óɹ
+           RETURN_ERROR  ʧ
+    :  
+**************************************************************************/
+int32_t createMixFormatOmTlvMsg(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_simuAllocMsgFail)
+    {
+        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_getGlbMasterNodeId = NULL;
 
+int32_t pmgrGetGlbMasterNodeId(nid_t* nodeId)
+{
+    if(NULL == g_getGlbMasterNodeId)
+    {
+        g_getGlbMasterNodeId = (FN_getGlbMasterNodeId)(ptrdiff_t)lookupIntfMethod(INTF_SYSCTRL_INTF,
+            METHOD_getGlbMasterNodeId, ANONYMOUS_SERVER_ID, 0);
+    }
+
+    if (unlikely(NULL == g_getGlbMasterNodeId))
+    {
+        return RETURN_ERROR;
+    }
+
+    return g_getGlbMasterNodeId(nodeId);
+}
+
+/**************************************************************************
+    :  зtlvϢģcli޸Disk PoolϸʽϢ
+:  poolId           POOL ID
+:  
+ֵ  :  RETURN_OK     óɹ
+           RETURN_ERROR  ʧ
+    :  
+**************************************************************************/
+int32_t patchSendCfgMixFormateMsg(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 = pmgrGetGlbMasterNodeId(&MasterNodeId);
+    if (unlikely(RETURN_OK != result))
+    {
+        DBG_LogInfo(DBG_LOGID_NEW, "Get master node error, result(%d).", result);
+        return result;
+    }
+    result = createMixFormatOmTlvMsg(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 checkDiskPoolMixFormatTask(void)
+{
+    poolid_t    diskPoolId;
+    uint8_t     fmtType = INVALID_VALUE8;
+    PMGR_OBJ_S *poolObj = NULL;
+    nid_t       MasterNodeId;
+    int32_t     result     = RETURN_ERROR;
+    TEST_DEBUGLOG(DBG_LOGID_NEW, "checkDiskPoolMixFormatTask begin.");
+
+    result = pmgrGetGlbMasterNodeId(&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);
+            fmtType = poolObj->diskPoolCfgPara.poolCfg.mixFormatType;
+            spin_unlock(&poolObj->poolObjLock);
+            TEST_DEBUGLOG(DBG_LOGID_NEW, "Found pool(%u) format type(%u).",
+                diskPoolId, fmtType);
+            if(UNIFIED_FORMAT == fmtType)
+            {
+                (void)patchSendCfgMixFormateMsg(diskPoolId);
+            }
+        }
+    }
+
+    return;
+}
+
+uint64_t g_setDomainMixFormatTimer = 0;
+uint64_t g_domainMixFormatTime = 30*24*6; /*һ£ʹ10Ӷʱʱ*/
+/**************************************************************************
+     :  ʱ(һ)domainΪϸʽ10ӵĶʱӵ
+ :  
+ :  
+ ֵ  :  
+     :  
+**************************************************************************/
+void pmgrCheckDiskPoolMixFormatTask(void)
+{
+    g_setDomainMixFormatTimer++;
+    if (0 == g_setDomainMixFormatTimer%g_domainMixFormatTime)
+    {
+        checkDiskPoolMixFormatTask();
+        g_domainMixFormatTime = 1;  /*һεú󣬸ĳÿ10Ӽ*/
+    }
+}
 
