Laurence, > In the current code, If a device does not have protection, qla2xx will > land up defaulting to a BUG() and will panic the system when > sg_write_same is sent.This is because SCSI_PROT_NORMAL is matched and > falls through to the BUG() call. The write_same command to a device > without protection is not handled safely. I would like to understand why the driver PI code path was chosen for a SCSI_PROT_NORMAL cmnd. That doesn't seem right. > + case SCSI_PROT_NORMAL: > + total_bytes = data_bytes; > + break; > case SCSI_PROT_READ_INSERT: > case SCSI_PROT_WRITE_STRIP: > total_bytes = data_bytes; All this transfer size wrangling in the driver should be removed and replaced with a call to scsi_transfer_length() which takes the PI size into account. -- Martin K. Petersen Oracle Linux Engineering