Re: CDROM Oops patch

Erik Andersen (andersen@inconnect.com)
Sun, 14 Jun 1998 15:22:34 -0600


On Sun, Jun 14, 1998 at 02:21:42PM +0200, David A. van Leeuwen wrote:
> Erik,
>
> Thanks for taking care of the CDROM interface again. One comment:
>
> - cdi->options = CDO_AUTO_CLOSE | CDO_USE_FFLAGS | CDO_LOCK;
> - /* default compatibility mode */
> + cdi->options = CDO_AUTO_CLOSE | CDO_USE_FFLAGS | CDO_CHECK_TYPE | CDO_LOCK;
> + if (dont_check_media_type==0)
> + cdi->options |= (int) CDO_CHECK_TYPE;
>
> This breaks 2.0 compatibility and will couse people to randomly send
> patches to comment out some of the code in cdrom.c, because their
> favorite cdrom player program doesn't work anymore. This has happened
> before! Moreover, the code is wrong. "==" -> "!=" and "|=" ->
> "&= ~". Or something. Just remove the "| CDO_CHECK_TYPE" in the
> first line. Please.
>
> ---david

I think that by default checking the media type is a good thing. Since
I knew that this change could annoy some people, I attempted to add
in a flag to fall back to the old behavior for those not wanting to
make the change yet. You are correct though that I screwed this one
up. I was intending to do an XOR ( &= ~ ), but I guess my brain was
wandering elsewhere... I do plan on changing the default though (baring
huge resistance from the rest of the community). The media type checking
works, it avoids many problems, and I think it is time that cdrom apps
make use of it. It is just so much cleaner to see:

andersen@dillweed% mount /cdrom0
mount: Wrong medium type

instead of:

andersen@dillweed% mount /cdrom0
mount: wrong fs type, bad option, bad superblock on /dev/hdb,
or too many mounted file systems

There have been several times during the history of Linux where default
behavior has changed. I am making the assumption that since people have
adaptaed to the major networking changes introduced during 2.1.x, and
the change from using kerneld to kmod, surely folks will be able to
adapt to a slight change in default cdrom behavior. Yes, some apps will
break. Yes, some people will complain. I will be glad to assist anyone
who complains in modifying their CDROM source code to adapt. I think the
improved behavior is worth the cost. Those that think otherwise can use
the compatability flag.

-Erik

--
Erik B. Andersen   Web:    http://www.inconnect.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu