Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

libata: Fixup n_elem initialization

Fixup the inialization of qc->n_elem. It currently gets
initialized to 1 for commands that do not transfer any data.
Fix this by initializing n_elem to 0 and only setting to 1
in ata_scsi_qc_new when there is data to transfer. This fixes
some problems seen with SATA devices attached to ipr adapters.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Brian King and committed by
Jeff Garzik
7a801184 07c53dac

+2 -1
+1 -1
drivers/ata/libata-scsi.c
··· 372 372 if (cmd->use_sg) { 373 373 qc->__sg = (struct scatterlist *) cmd->request_buffer; 374 374 qc->n_elem = cmd->use_sg; 375 - } else { 375 + } else if (cmd->request_bufflen) { 376 376 qc->__sg = &qc->sgent; 377 377 qc->n_elem = 1; 378 378 }
+1
include/linux/libata.h
··· 1149 1149 qc->cursect = qc->cursg = qc->cursg_ofs = 0; 1150 1150 qc->nsect = 0; 1151 1151 qc->nbytes = qc->curbytes = 0; 1152 + qc->n_elem = 0; 1152 1153 qc->err_mask = 0; 1153 1154 1154 1155 ata_tf_init(qc->dev, &qc->tf);