Re: mcdx -- do_request(): non-read command to cd!!

Pekka J Enberg
2007-04-03T17:31:54Z

On Tue, 3 Apr 2007, Pekka J Enberg wrote:
> However, we never hit do_mcdx_request(). Jens, do we need to do
> set_capacity() somewhere? I don't see other cdrom drivers doing it but
> they could be broken too...

Oh, well, here goes. Rene, would you be so kind and spin the wheel once
more? =)

Pekka

diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index f574962..8ed61c9 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -672,6 +672,7 @@ static int mcdx_open(struct cdrom_device
if (-1 == mcdx_requesttocdata(stuffp, &stuffp->di, 1)) {

stuffp->lastsector = -1;
+ set_capacity(stuffp->disk, 0);

} else {

@@ -692,6 +693,7 @@ static int mcdx_open(struct cdrom_device
stuffp->di.msf_leadout.second,
stuffp->di.msf_leadout.frame,
msf2log(&stuffp->di.msf_leadout));
+ set_capacity(stuffp->disk, stuffp->lastsector + 1);
}

if (stuffp->toc) {