Skip to content

Commit

Permalink
scsi: sd: Improve unaligned completion resid message
Browse files Browse the repository at this point in the history
For commands completing with a resid not aligned on the device logical
sector size, also print the command CDB in addition to the current message
to help debug hardware generating such incorrect command completion
information.

Link: https://lore.kernel.org/r/20190828053511.14818-1-damien.lemoal@wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Damien Le Moal authored and Martin K. Petersen committed Sep 7, 2019
1 parent 3ec24fb commit 670d8be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,7 @@ static int sd_done(struct scsi_cmnd *SCpnt)
sd_printk(KERN_INFO, sdkp,
"Unaligned partial completion (resid=%u, sector_sz=%u)\n",
resid, sector_size);
scsi_print_command(SCpnt);
resid = min(scsi_bufflen(SCpnt),
round_up(resid, sector_size));
scsi_set_resid(SCpnt, resid);
Expand Down

0 comments on commit 670d8be

Please sign in to comment.