linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cdrom blocksize reset bug with 2.4.x kernels
@ 2003-07-01 22:25 Attila Kinali
  2003-07-02 11:18 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Attila Kinali @ 2003-07-01 22:25 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

Hi,

After some discussion on the mplayer-users mailinglist about
that for some scsi drives it's impossible to read a data cd
after reading a vcd/scvd until the next reboot.
(see http://mplayerhq.hu/pipermail/mplayer-users/2002-December/025696.html)

I found that there is a reset of the cdrom block size needed
for those drives which doesnt restet it themselfs if a new
cd is put in (looks like only a few scsi cdroms are affected)

Attached is a small patch for drivers/cdrom/cdrom.c that fixes 
this for the 2.4.20 kernel (and also for 2.4.21 as the code didn't
change). It's reseting the blocksize when a cdrom is opened for
the first time (meaning that a umount/mount cycle can reset
the blocksize).

I run this code now for about half a year and didnt have any problems.
But, as i didnt get any feadback from other people, i'm not sure if
everything is correct.

Greetings
			Attila Kinali

-- 
Emacs ist für mich kein Editor. Für mich ist das genau das gleiche, als wenn
ich nach einem Fahrrad (für die Sonntagbrötchen) frage und einen pangalaktischen
Raumkreuzer mit 10 km Gesamtlänge bekomme. Ich weiß nicht, was ich damit soll.
		-- Frank Klemm, de.comp.os.unix.discussion

[-- Attachment #2: cdrom-blocksize.patch --]
[-- Type: application/octet-stream, Size: 509 bytes --]

--- cdrom.c.orig	2003-01-05 15:02:53.000000000 +0100
+++ cdrom.c	2003-01-05 15:05:44.000000000 +0100
@@ -475,7 +475,15 @@
 	else
 		ret = open_for_data(cdi);
 
-	if (!ret) cdi->use_count++;
+	if (!ret)
+	{
+		cdi->use_count++;
+		if(cdi->use_count == 1)
+		{
+			/* reset blocksize in case it's wrong */
+			cdrom_switch_blocksize(cdi,CD_FRAMESIZE);
+		}
+	}
 
 	cdinfo(CD_OPEN, "Use count for \"/dev/%s\" now %d\n", cdi->name, cdi->use_count);
 	/* Do this on open.  Don't wait for mount, because they might

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

end of thread, other threads:[~2003-11-12 16:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-01 22:25 cdrom blocksize reset bug with 2.4.x kernels Attila Kinali
2003-07-02 11:18 ` Jens Axboe
2003-11-09 14:56   ` Tobias Diedrich
2003-11-12 16:06     ` Tobias Diedrich

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