From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Borislav Petkov <petkovbb@gmail.com>
Subject: Re: [PATCH] ide-cd: document capacity hack
Date: Wed, 18 Feb 2009 22:35:27 +0300 [thread overview]
Message-ID: <499C62FF.1090805@ru.mvista.com> (raw)
In-Reply-To: <200902182018.52195.bzolnier@gmail.com>
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
next prev parent reply other threads:[~2009-02-18 19:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 19:18 [PATCH] ide-cd: document capacity hack Bartlomiej Zolnierkiewicz
2009-02-18 19:35 ` Sergei Shtylyov [this message]
2009-02-18 20:38 ` Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=499C62FF.1090805@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=petkovbb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).