Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77153
b: refs/heads/master
c: a0899d4
h: refs/heads/master
i:
  77151: 927825d
v: v3
  • Loading branch information
Hans de Goede authored and James Bottomley committed Jan 23, 2008
1 parent 6222bc6 commit 3d2c41d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b523381e325366cc54a2548df418c2a427b2f2ee
refs/heads/master: a0899d4df534d2bcf671b0f647b809842309a9ae
9 changes: 9 additions & 0 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
goto out;
}

/*
* Some devices (some sdcards for one) don't like it if the
* last sector gets read in a larger then 1 sector read.
*/
if (unlikely(sdp->last_sector_bug &&
rq->nr_sectors > sdp->sector_size / 512 &&
block + this_count == get_capacity(disk)))
this_count -= sdp->sector_size / 512;

SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n",
(unsigned long long)block));

Expand Down
1 change: 1 addition & 0 deletions trunk/include/scsi/scsi_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ struct scsi_device {
unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */
unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
unsigned last_sector_bug:1; /* Always read last sector in a 1 sector read */

DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
struct list_head event_list; /* asserted events */
Expand Down

0 comments on commit 3d2c41d

Please sign in to comment.