--- ./source/private_module/sio/sio_object.c	2018-02-09 07:36:26.000000000 +0000
+++ ./source/private_module/sio/sio_object.c.hotpatch	2020-04-23 08:49:58.000000000 +0000
@@ -216,7 +216,7 @@
         }
     }
 }
-
+void sioProcTrimMediumError(REQ_S *req);
 /**************************************************************************
    : sioGetBadSectorFromReq
      : ȡϢ
@@ -234,7 +234,7 @@
     {
         return;
     }
-    
+    sioProcTrimMediumError(req);
     err = SIO_REQ_TO_ERR(req);
     *lba = err->errInfo.sense.lba;
     *len = err->errInfo.sense.length;
@@ -1386,4 +1386,44 @@
     (void)sioQueueDispAlgmOpsInit((SIO_QUEUE_S *)queue);
 }
 
+/**************************************************************************
+   : sioProcTrimMediumError
+     : TRIM IO󣬽bdmByteֵ޸ΪBDM_INNER_ERROR_ABNORMAL
+                  ѭ
+ : REQ_S *req
+ : 
+   ֵ: 
+     : 
+**************************************************************************/
+void sioProcTrimMediumError(REQ_S *req)
+{
+    CFG_ERR_INFO_S* currentErrorInfo = NULL;
+
+    currentErrorInfo = SIO_REQ_TO_CFG_ERR(req);
+
+    if (req->opCode != OP_TRIM) {
+        return;
+    }
+
+    if ((currentErrorInfo->hostByte == 0) 
+        && (currentErrorInfo->msgByte == 0)
+        && (currentErrorInfo->bdmByte == 0)
+        && (currentErrorInfo->statusByte == 2)
+        && (currentErrorInfo->sk == 3)) {
+        currentErrorInfo->bdmByte = BDM_INNER_ERROR_ABNORMAL;
+        BDM_PRINT_LIMIT_PERIOD(SIO_LOG_INTERVAL_ONE_HOUR, 1, DBG_LOG_ERROR, LOG_ID_SIO_0118,
+                 "BDM_SPH019: req 0x%p, opCode %u, objectId %llu, objectLba %llu, error(%x,%x,%x,%x,%x,%x,%x,%x).",
+                 req, req->opCode, req->objectId, req->objectLba,
+                 currentErrorInfo->hostByte,
+                 currentErrorInfo->msgByte,
+                 currentErrorInfo->bdmByte,
+                 currentErrorInfo->statusByte,
+                 currentErrorInfo->sk,
+                 currentErrorInfo->asc,
+                 currentErrorInfo->ascq,
+                 currentErrorInfo->fru);
+        return;
+    }
+}
+
 
