lkml.org 
[lkml]   [2009]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ide-cd: document capacity hack
Hello.

Bartlomiej Zolnierkiewicz wrote:

> 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>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> Index: b/drivers/ide/ide-cd.c
> ===================================================================
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -189,6 +189,14 @@ static void cdrom_analyze_sense_data(ide
> 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.

Oh horror... :-)

> + * 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);

Would be nice if the CHS capacity workround was finally documented too? ;-)

MBR, Sergei


\
 
 \ /
  Last update: 2009-02-18 20:37    [W:0.097 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site