linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide-cd: document capacity hack
@ 2009-02-18 19:18 Bartlomiej Zolnierkiewicz
  2009-02-18 19:35 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-18 19:18 UTC (permalink / raw)
  To: linux-ide; +Cc: linux-kernel, Borislav Petkov

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] 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>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-cd.c |    8 ++++++++
 1 file changed, 8 insertions(+)

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-18 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-18 19:18 [PATCH] ide-cd: document capacity hack Bartlomiej Zolnierkiewicz
2009-02-18 19:35 ` Sergei Shtylyov
2009-02-18 20:38   ` Bartlomiej Zolnierkiewicz

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).