[SCSI] lpfc 8.3.42: Fixed driver iocbq structure's iocb_flag field running out of space

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

James Smart and committed by
James Bottomley
1b8d11ab ec2087a7

+9 -10
+7 -7
drivers/scsi/lpfc/lpfc_bsg.c
··· 319 320 /* Close the timeout handler abort window */ 321 spin_lock_irqsave(&phba->hbalock, flags); 322 - cmdiocbq->iocb_aux_flag &= ~LPFC_IO_CMD_OUTSTANDING; 323 spin_unlock_irqrestore(&phba->hbalock, flags); 324 325 iocb = &dd_data->context_un.iocb; ··· 513 /* make sure the I/O had not been completed yet */ 514 if (cmdiocbq->iocb_flag & LPFC_IO_LIBDFC) { 515 /* open up abort window to timeout handler */ 516 - cmdiocbq->iocb_aux_flag |= LPFC_IO_CMD_OUTSTANDING; 517 } 518 spin_unlock_irqrestore(&phba->hbalock, flags); 519 return 0; /* done for now */ ··· 595 596 /* Close the timeout handler abort window */ 597 spin_lock_irqsave(&phba->hbalock, flags); 598 - cmdiocbq->iocb_aux_flag &= ~LPFC_IO_CMD_OUTSTANDING; 599 spin_unlock_irqrestore(&phba->hbalock, flags); 600 601 rsp = &rspiocbq->iocb; ··· 748 /* make sure the I/O had not been completed/released */ 749 if (cmdiocbq->iocb_flag & LPFC_IO_LIBDFC) { 750 /* open up abort window to timeout handler */ 751 - cmdiocbq->iocb_aux_flag |= LPFC_IO_CMD_OUTSTANDING; 752 } 753 spin_unlock_irqrestore(&phba->hbalock, flags); 754 return 0; /* done for now */ ··· 1404 1405 /* Close the timeout handler abort window */ 1406 spin_lock_irqsave(&phba->hbalock, flags); 1407 - cmdiocbq->iocb_aux_flag &= ~LPFC_IO_CMD_OUTSTANDING; 1408 spin_unlock_irqrestore(&phba->hbalock, flags); 1409 1410 ndlp = dd_data->context_un.iocb.ndlp; ··· 1585 /* make sure the I/O had not been completed/released */ 1586 if (ctiocb->iocb_flag & LPFC_IO_LIBDFC) { 1587 /* open up abort window to timeout handler */ 1588 - ctiocb->iocb_aux_flag |= LPFC_IO_CMD_OUTSTANDING; 1589 } 1590 spin_unlock_irqrestore(&phba->hbalock, flags); 1591 return 0; /* done for now */ ··· 5338 5339 spin_lock_irqsave(&phba->hbalock, flags); 5340 /* make sure the I/O abort window is still open */ 5341 - if (!(cmdiocb->iocb_aux_flag & LPFC_IO_CMD_OUTSTANDING)) { 5342 spin_unlock_irqrestore(&phba->hbalock, flags); 5343 return -EAGAIN; 5344 }
··· 319 320 /* Close the timeout handler abort window */ 321 spin_lock_irqsave(&phba->hbalock, flags); 322 + cmdiocbq->iocb_flag &= ~LPFC_IO_CMD_OUTSTANDING; 323 spin_unlock_irqrestore(&phba->hbalock, flags); 324 325 iocb = &dd_data->context_un.iocb; ··· 513 /* make sure the I/O had not been completed yet */ 514 if (cmdiocbq->iocb_flag & LPFC_IO_LIBDFC) { 515 /* open up abort window to timeout handler */ 516 + cmdiocbq->iocb_flag |= LPFC_IO_CMD_OUTSTANDING; 517 } 518 spin_unlock_irqrestore(&phba->hbalock, flags); 519 return 0; /* done for now */ ··· 595 596 /* Close the timeout handler abort window */ 597 spin_lock_irqsave(&phba->hbalock, flags); 598 + cmdiocbq->iocb_flag &= ~LPFC_IO_CMD_OUTSTANDING; 599 spin_unlock_irqrestore(&phba->hbalock, flags); 600 601 rsp = &rspiocbq->iocb; ··· 748 /* make sure the I/O had not been completed/released */ 749 if (cmdiocbq->iocb_flag & LPFC_IO_LIBDFC) { 750 /* open up abort window to timeout handler */ 751 + cmdiocbq->iocb_flag |= LPFC_IO_CMD_OUTSTANDING; 752 } 753 spin_unlock_irqrestore(&phba->hbalock, flags); 754 return 0; /* done for now */ ··· 1404 1405 /* Close the timeout handler abort window */ 1406 spin_lock_irqsave(&phba->hbalock, flags); 1407 + cmdiocbq->iocb_flag &= ~LPFC_IO_CMD_OUTSTANDING; 1408 spin_unlock_irqrestore(&phba->hbalock, flags); 1409 1410 ndlp = dd_data->context_un.iocb.ndlp; ··· 1585 /* make sure the I/O had not been completed/released */ 1586 if (ctiocb->iocb_flag & LPFC_IO_LIBDFC) { 1587 /* open up abort window to timeout handler */ 1588 + ctiocb->iocb_flag |= LPFC_IO_CMD_OUTSTANDING; 1589 } 1590 spin_unlock_irqrestore(&phba->hbalock, flags); 1591 return 0; /* done for now */ ··· 5338 5339 spin_lock_irqsave(&phba->hbalock, flags); 5340 /* make sure the I/O abort window is still open */ 5341 + if (!(cmdiocb->iocb_flag & LPFC_IO_CMD_OUTSTANDING)) { 5342 spin_unlock_irqrestore(&phba->hbalock, flags); 5343 return -EAGAIN; 5344 }
+2 -3
drivers/scsi/lpfc/lpfc_sli.h
··· 58 59 IOCB_t iocb; /* IOCB cmd */ 60 uint8_t retry; /* retry counter for IOCB cmd - if needed */ 61 - uint16_t iocb_flag; 62 #define LPFC_IO_LIBDFC 1 /* libdfc iocb */ 63 #define LPFC_IO_WAKE 2 /* Synchronous I/O completed */ 64 #define LPFC_IO_WAKE_TMO LPFC_IO_WAKE /* Synchronous I/O timed out */ ··· 73 #define LPFC_IO_DIF_PASS 0x400 /* T10 DIF IO pass-thru prot */ 74 #define LPFC_IO_DIF_STRIP 0x800 /* T10 DIF IO strip prot */ 75 #define LPFC_IO_DIF_INSERT 0x1000 /* T10 DIF IO insert prot */ 76 77 #define LPFC_FIP_ELS_ID_MASK 0xc000 /* ELS_ID range 0-3, non-shifted mask */ 78 #define LPFC_FIP_ELS_ID_SHIFT 14 79 80 - uint8_t iocb_aux_flag; 81 - #define LPFC_IO_CMD_OUTSTANDING 0x01 /* timeout handler abort window */ 82 uint32_t drvrTimeout; /* driver timeout in seconds */ 83 uint32_t fcp_wqidx; /* index to FCP work queue */ 84 struct lpfc_vport *vport;/* virtual port pointer */
··· 58 59 IOCB_t iocb; /* IOCB cmd */ 60 uint8_t retry; /* retry counter for IOCB cmd - if needed */ 61 + uint32_t iocb_flag; 62 #define LPFC_IO_LIBDFC 1 /* libdfc iocb */ 63 #define LPFC_IO_WAKE 2 /* Synchronous I/O completed */ 64 #define LPFC_IO_WAKE_TMO LPFC_IO_WAKE /* Synchronous I/O timed out */ ··· 73 #define LPFC_IO_DIF_PASS 0x400 /* T10 DIF IO pass-thru prot */ 74 #define LPFC_IO_DIF_STRIP 0x800 /* T10 DIF IO strip prot */ 75 #define LPFC_IO_DIF_INSERT 0x1000 /* T10 DIF IO insert prot */ 76 + #define LPFC_IO_CMD_OUTSTANDING 0x2000 /* timeout handler abort window */ 77 78 #define LPFC_FIP_ELS_ID_MASK 0xc000 /* ELS_ID range 0-3, non-shifted mask */ 79 #define LPFC_FIP_ELS_ID_SHIFT 14 80 81 uint32_t drvrTimeout; /* driver timeout in seconds */ 82 uint32_t fcp_wqidx; /* index to FCP work queue */ 83 struct lpfc_vport *vport;/* virtual port pointer */