Re: Problems with eject and pktcdvd

From: Peter Osterlund
Date: Sat Feb 11 2006 - 06:19:15 EST


Damian Pietras <daper@xxxxxxxxx> writes:

> On Sun, Feb 05, 2006 at 11:44:46PM +0100, Peter Osterlund wrote:
> > Damian Pietras <daper@xxxxxxxxx> writes:
> >
> > > Now I can mount CD-R, CD-RW, DVD+RW using pktcdvd.
> > >
> > > Something strange happend when I copied files to DVD+RW und used eject.
> > > After some time eject exitet, but the disc was stil in the burner, I was
> > > allowed to open it by pressing the eject button, but then:
> > >
> > > hda: media error (bad sector): status=0x51 { DriveReady SeekComplete Error }
> > > hda: media error (bad sector): error=0x34 { AbortedCommand LastFailedSense=0x03
> >
> > Thanks for testing. Please try this patch: It makes sure not to unlock
> > the door if the disc is in use.
>
> It still allows to eject the disc while `umount /media/cdrom0` is
> waiting to finish.

That patch was accidentally created on top of another patch which I
haven't posted yet, so it didn't apply cleanly. Can you please try
again with the patch below and 2.6.16-rc2-git10 or later?

If that still doesn't work as expected, how did you eject the disc?
With the button or with the eject command? If it was the eject
command, please run eject with strace and send the output to me.


pktcdvd: Don't unlock the door if the disc is in use

Signed-off-by: Peter Osterlund <petero2@xxxxxxxxx>
---

drivers/block/pktcdvd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index d747f28..d794f2b 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2436,7 +2436,8 @@ static int pkt_ioctl(struct inode *inode
* The door gets locked when the device is opened, so we
* have to unlock it or else the eject command fails.
*/
- pkt_lock_door(pd, 0);
+ if (pd->refcnt == 1)
+ pkt_lock_door(pd, 0);
return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);

default:

--
Peter Osterlund - petero2@xxxxxxxxx
http://web.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/