Skip to contentSkip to conversation

don't set underflow for REQ_BLOCK_PC

PATCH In review Patrick Mansfield 2 participants 2 messages Sep 22, 2003 – Sep 24, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't set underflow for REQ_BLOCK_PC

I got underflow warnings and failures when sending an INQUIRY page 0x83 via the SG_IO REQ_BLOCK_PC interface.

The underflow field should only be set if we know for certain the size of the data being transfered, so fix this by leaving it at zero for scsi REQ_BLOCK_PC cases.

drivers/scsi/sd.c +0 -1
diff -uprN -X /home/patman/dontdiff bl-25/drivers/scsi/sd.c bl-25-sd_underflow-fix/drivers/scsi/sd.c
@@ -174,7 +174,6 @@ static int sd_init_command(struct scsi_c
 			timeout = rq->timeout;
 
 		SCpnt->transfersize = rq->data_len;
-		SCpnt->underflow = rq->data_len;
 		goto queue;
 	}
 
drivers/scsi/sr.c +0 -1
diff -uprN -X /home/patman/dontdiff bl-25/drivers/scsi/sr.c bl-25-sd_underflow-fix/drivers/scsi/sr.c
@@ -301,7 +301,6 @@ static int sr_init_command(struct scsi_c
 			timeout = rq->timeout;
 
 		SCpnt->transfersize = rq->data_len;
-		SCpnt->underflow = rq->data_len;
 		goto queue;
 	}
 

-- Patrick Mansfield

#1 lore raw
Quoted 22 lines · Patrick Mansfield

I got underflow warnings and failures when sending an INQUIRY page 0x83 via the SG_IO REQ_BLOCK_PC interface.

The underflow field should only be set if we know for certain the size of the data being transfered, so fix this by leaving it at zero for scsi REQ_BLOCK_PC cases.

diff -uprN -X /home/patman/dontdiff bl-25/drivers/scsi/sd.c bl-25-sd_underflow-fix/drivers/scsi/sd.c

drivers/scsi/sd.c +0 -1
@@ -174,7 +174,6 @@ static int sd_init_command(struct scsi_c
 			timeout = rq->timeout;
 
 		SCpnt->transfersize = rq->data_len;
-		SCpnt->underflow = rq->data_len;
 		goto queue;
 	}
 

diff -uprN -X /home/patman/dontdiff bl-25/drivers/scsi/sr.c bl-25-sd_underflow-fix/drivers/scsi/sr.c

drivers/scsi/sr.c static int sr_init_command(struct scsi_c · line 305

Quoted 6 lines
drivers/scsi/sr.c +0 -1
@@ -301,7 +301,6 @@ static int sr_init_command(struct scsi_c
 			timeout = rq->timeout;
 
 		SCpnt->transfersize = rq->data_len;
-		SCpnt->underflow = rq->data_len;
 		goto queue;
 	}

Agree, looks fine.

Signature · 1 line
Jens Axboe