--- ./source/private_module/spa/node_mgr/nmgr_ctrl.c	2018-02-09 13:47:03.000000000 +0000
+++ ./source/private_module/spa/node_mgr/nmgr_ctrl.c.hotpatch	2019-03-16 13:11:07.000000000 +0000
@@ -2893,7 +2893,7 @@
 
     return ;
 }
-
+int32_t countCanceledSegNum(NODE_MGR_S *nodeInst, uint32_t *dirtySegNum);
 static int32_t trimAllocSegList(NODE_MGR_S *nodeInst, uint32_t *dirtySegNum)
 {
     uint64_t         *nextAllocSegId = NULL;
@@ -2902,24 +2902,24 @@
     NMGR_SEG_HDR_S   *prvSegHdr = NULL;
     uint32_t         *flags  = NULL;
     uint32_t         allocSegNum = 0;
-
     *dirtySegNum = 0;
     if (list_empty(&nodeInst->allocSegList))
     {
         //DBG_ASSERT(0 == nodeInst->maxNodeNum);
         return RETURN_OK;
     }
-
+    /* ȡգϵSEGݣڴǳʼݣҪڴSEGϢ */
+    if (NMGR_HDR_FLAG_CANCEL & nodeInst->flags){ SPA_LIMIT_PRINT_ERROR(NO_LOGID, "wqy:");
+        return countCanceledSegNum(nodeInst, dirtySegNum);
+    }
     /* ûձǺȡ̲ REMOVE */
     if ((NMGR_HDR_FLAG_RECLAIM & nodeInst->flags) || 
         (NMGR_HDR_FLAG_CANCEL & nodeInst->flags))
     {
         return RETURN_OK;
     }
-
     nextAllocSegId = &nodeInst->pendRootAllocSegId;
     flags          = (uint32_t *)(ptrdiff_t)&nodeInst->flags;
-
     nodeInst->memAllocSegNum = 0;
     list_for_each(pos, &nodeInst->allocSegList)
     {
@@ -9511,3 +9511,23 @@
     return ;
 }
 EXPORT_SYMBOL(filterNodeByParseMetaExtentIntf);
+
+int32_t countCanceledSegNum(NODE_MGR_S *nodeInst, uint32_t *dirtySegNum)
+{
+    struct list_head *pos    = NULL;
+    NMGR_SEG_HDR_S   *segHdr = NULL;
+
+    list_for_each(pos, &nodeInst->allocSegList)
+    {
+        segHdr = list_entry(pos, NMGR_SEG_HDR_S, listNode);
+        spin_lock(&segHdr->lock);
+        if (POOL_TEST_BIT(NMGR_HDR_ISDIRTY, (void *)&segHdr->flags))
+        {
+            (*dirtySegNum)++;
+        }
+
+        spin_unlock(&segHdr->lock);
+    }
+    
+    return RETURN_OK;
+}
