diff options
| -rw-r--r-- | drivers/scsi/sd.c | 9 | ||||
| -rw-r--r-- | include/scsi/scsi_device.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 212f6bcfd457..24eba3118b5a 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
| @@ -395,6 +395,15 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
| 395 | goto out; | 395 | goto out; |
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | /* | ||
| 399 | * Some devices (some sdcards for one) don't like it if the | ||
| 400 | * last sector gets read in a larger then 1 sector read. | ||
| 401 | */ | ||
| 402 | if (unlikely(sdp->last_sector_bug && | ||
| 403 | rq->nr_sectors > sdp->sector_size / 512 && | ||
| 404 | block + this_count == get_capacity(disk))) | ||
| 405 | this_count -= sdp->sector_size / 512; | ||
| 406 | |||
| 398 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n", | 407 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n", |
| 399 | (unsigned long long)block)); | 408 | (unsigned long long)block)); |
| 400 | 409 | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e0c645ac5014..3c8f898b160e 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -139,6 +139,7 @@ struct scsi_device { | |||
| 139 | unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ | 139 | unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ |
| 140 | unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ | 140 | unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ |
| 141 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ | 141 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ |
| 142 | unsigned last_sector_bug:1; /* Always read last sector in a 1 sector read */ | ||
| 142 | 143 | ||
| 143 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 144 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |
| 144 | struct list_head event_list; /* asserted events */ | 145 | struct list_head event_list; /* asserted events */ |
