On Mon, 23 Jul 2001, Jens Axboe wrote:
ONly thing what I experienced was the following: I had NO disc in the drive when I made pktsetup /dev/pktcdvd /dev/sr0 and then i was NOT able to -d it, to open the drive physically (without paperclip ;-). All calls to pktsetup return invalid i/o something.
Sounds like a silly bug -- without diving it, it's probably that you setup the drive (which doesn't require a full open), and when you later want to tear it down you can't because that's not a O_CREAT open and this it fails. The setup should do a full open too most likely, I'll take a look.
Is this patch an acceptable fix? (The pkt_new_dev function is modified to make sure there is a readable disk in the drive.) --- linux/drivers/block/pktcdvd.c.orig Mon Aug 20 00:40:18 2001 +++ linux/drivers/block/pktcdvd.c Mon Aug 20 00:18:30 2001 @@ -2160,6 +2160,15 @@ return -ENXIO; } + { + int ret; + long lba; + if ((ret = cdrom_get_last_written(dev, &lba))) { + printk("pktcdvd: cdrom_get_last_written failed\n"); + return ret; + } + } + MOD_INC_USE_COUNT; memset(pd, 0, sizeof(struct pktcdvd_device)); -- Peter Österlund peter.osterlund@mailbox.swipnet.se Sköndalsvägen 35 http://home1.swipnet.se/~w-15919 S-128 66 Sköndal +46 8 942647 Sweden