diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-02-25 14:28:23 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-02-25 14:28:23 -0500 |
commit | d3dd7107f4d843d0f01d0f77d49a7c5449130577 (patch) | |
tree | 5bd38dea522f07b5e6594116ac75f43ded33e69f | |
parent | f38344b0a0898d2a8c13581ee61007719e16e1d7 (diff) |
ide-cd: document capacity hack
Just copy the comment from drivers/scsi/sr.c::sr_done()
(from which the capacity hack has been originated).
Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-cd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 0bfeb0c79d6e..690475b834de 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -194,6 +194,14 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, | |||
194 | bio_sectors = max(bio_sectors(failed_command->bio), 4U); | 194 | bio_sectors = max(bio_sectors(failed_command->bio), 4U); |
195 | sector &= ~(bio_sectors - 1); | 195 | sector &= ~(bio_sectors - 1); |
196 | 196 | ||
197 | /* | ||
198 | * The SCSI specification allows for the value | ||
199 | * returned by READ CAPACITY to be up to 75 2K | ||
200 | * sectors past the last readable block. | ||
201 | * Therefore, if we hit a medium error within the | ||
202 | * last 75 2K sectors, we decrease the saved size | ||
203 | * value. | ||
204 | */ | ||
197 | if (sector < get_capacity(info->disk) && | 205 | if (sector < get_capacity(info->disk) && |
198 | drive->probed_capacity - sector < 4 * 75) | 206 | drive->probed_capacity - sector < 4 * 75) |
199 | set_capacity(info->disk, sector); | 207 | set_capacity(info->disk, sector); |