Date: Wed, 26 May 2021 20:37:43 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: fc7402d50da8 - releng/13.0 - pms(4): Do not return CAM_REQ_CMP on errors. Message-ID: <202105262037.14QKbhwD054358@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fc7402d50da8e072ded892d7ac024d939bc11fae commit fc7402d50da8e072ded892d7ac024d939bc11fae Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2021-04-16 19:16:09 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-05-26 19:30:13 +0000 pms(4): Do not return CAM_REQ_CMP on errors. It is a direct request for data corruptions, one report of which we have received. I am very surprised that only one. Approved by: so Security: EN-21:14.pms MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 8434a65ce49bd6bc6779f0e57b0ce0f4bc46f48e) (cherry picked from commit 4bc708e1e87b493551fc286e25477490b1a75b99) --- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index 69f488c4199b..4ce32d0ce6c0 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -2629,9 +2629,11 @@ static void agtiapi_PrepareSGListCB( void *arg, { AGTIAPI_PRINTK("agtiapi_PrepareSGListCB: error status 0x%x\n", error); bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); - bus_dmamap_destroy(pmcsc->buffer_dmat, pccb->CCB_dmamap); agtiapi_FreeCCB(pmcsc, pccb); - ccb->ccb_h.status = CAM_REQ_CMP; + if (error == EFBIG) + ccb->ccb_h.status = CAM_REQ_TOO_BIG; + else + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); return; } @@ -2643,9 +2645,8 @@ static void agtiapi_PrepareSGListCB( void *arg, " AGTIAPI_MAX_DMA_SEGS %d\n", nsegs, AGTIAPI_MAX_DMA_SEGS ); bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); - bus_dmamap_destroy(pmcsc->buffer_dmat, pccb->CCB_dmamap); agtiapi_FreeCCB(pmcsc, pccb); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done(ccb); return; } @@ -3689,9 +3690,11 @@ static void agtiapi_PrepareSMPSGListCB( void *arg, AGTIAPI_PRINTK( "agtiapi_PrepareSMPSGListCB: error status 0x%x\n", error ); bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); - bus_dmamap_destroy( pmcsc->buffer_dmat, pccb->CCB_dmamap ); agtiapi_FreeCCB( pmcsc, pccb ); - ccb->ccb_h.status = CAM_REQ_CMP; + if (error == EFBIG) + ccb->ccb_h.status = CAM_REQ_TOO_BIG; + else + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done( ccb ); return; } @@ -3703,9 +3706,8 @@ static void agtiapi_PrepareSMPSGListCB( void *arg, "AGTIAPI_MAX_DMA_SEGS %d\n", nsegs, AGTIAPI_MAX_DMA_SEGS ); bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); - bus_dmamap_destroy( pmcsc->buffer_dmat, pccb->CCB_dmamap ); agtiapi_FreeCCB( pmcsc, pccb ); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done( ccb ); return; } @@ -4410,7 +4412,7 @@ static int agtiapi_QueueSMP(struct agtiapi_softc *pmcsc, union ccb * ccb) if ((pccb = agtiapi_GetCCB(pmcsc)) == NULL) { AGTIAPI_PRINTK("agtiapi_QueueSMP: GetCCB ERROR\n"); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); return tiBusy; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105262037.14QKbhwD054358>