Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167221
b: refs/heads/master
c: 5915136
h: refs/heads/master
i:
  167219: 00ebf06
v: v3
  • Loading branch information
Tejun Heo authored and James Bottomley committed Oct 2, 2009
1 parent 538ddd5 commit 587c5da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53203244a4f9988f132ef481867ff47d6bd055b5
refs/heads/master: 5915136d4d3954867cced8a2297bddd16caf36a1
22 changes: 14 additions & 8 deletions trunk/drivers/scsi/sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,20 @@ static void get_sectorsize(struct scsi_cd *cd)
cd->capacity = 0x1fffff;
sector_size = 2048; /* A guess, just in case */
} else {
#if 0
if (cdrom_get_last_written(&cd->cdi,
&cd->capacity))
#endif
cd->capacity = 1 + ((buffer[0] << 24) |
(buffer[1] << 16) |
(buffer[2] << 8) |
buffer[3]);
long last_written;

cd->capacity = 1 + ((buffer[0] << 24) | (buffer[1] << 16) |
(buffer[2] << 8) | buffer[3]);
/*
* READ_CAPACITY doesn't return the correct size on
* certain UDF media. If last_written is larger, use
* it instead.
*
* http://bugzilla.kernel.org/show_bug.cgi?id=9668
*/
if (!cdrom_get_last_written(&cd->cdi, &last_written))
cd->capacity = max_t(long, cd->capacity, last_written);

sector_size = (buffer[4] << 24) |
(buffer[5] << 16) | (buffer[6] << 8) | buffer[7];
switch (sector_size) {
Expand Down

0 comments on commit 587c5da

Please sign in to comment.