From: Bartlomiej Zolnierkiewicz Date: Wed, 25 Feb 2009 19:28:23 +0000 (+0100) Subject: ide-cd: document capacity hack X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d3dd7107f4d843d0f01d0f77d49a7c5449130577;p=linux-beck.git 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 Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- 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, bio_sectors = max(bio_sectors(failed_command->bio), 4U); sector &= ~(bio_sectors - 1); + /* + * The SCSI specification allows for the value + * returned by READ CAPACITY to be up to 75 2K + * sectors past the last readable block. + * Therefore, if we hit a medium error within the + * last 75 2K sectors, we decrease the saved size + * value. + */ if (sector < get_capacity(info->disk) && drive->probed_capacity - sector < 4 * 75) set_capacity(info->disk, sector);