![](https://seccdn.libravatar.org/avatar/b57c403a7de6539ad1bb5accd07570d9.jpg?s=120&d=mm&r=g)
On Wed, 5 Feb 2003, Noah Roberts wrote:
2.4.19
modprobe sr_mod (ide-scsi and scsi already loaded) modprobe sg modprobe pktcdvd pktsetup /dev/pktcdvd /dev/scd0 (should have been /dev/pktcdvd0) mount /dev/pktcdvd /mnt/floppy - locked for long time, went to work and came back to prompt - mount - pktcdvd nor floppy listed - modprobe -r pktcdvd rmmod: Device or resource busy pktsetup /dev/pktcdvd0 /dev/scd0 - forget the error message - reboot
What output does
ls -l /dev/pktcdvd*
I am not at home, so can't check first hand, but I am pretty certain that the only pkt dev entry is /dev/pktcdvd0 and it is set up with whatever major/minor device it was supposed to. It works for the most part, its just that I screwed up that morning when setting it up. /dev/pktcdvd0 is the one I usually use. I can supply more information tonight if need be, but right now I am at work so have no access.
produce?
-- Peter Osterlund - petero2@telia.com http://w1.894.telia.com/~u89404340
-- To unsubscribe, e-mail: packet-writing-unsubscribe@suse.com For additional commands, e-mail: packet-writing-help@suse.com
![](https://seccdn.libravatar.org/avatar/51a7700397ed84d8e44df3701f556370.jpg?s=120&d=mm&r=g)
On Wed, 5 Feb 2003, Noah Roberts wrote:
On Wed, 5 Feb 2003, Noah Roberts wrote:
2.4.19
modprobe sr_mod (ide-scsi and scsi already loaded) modprobe sg modprobe pktcdvd pktsetup /dev/pktcdvd /dev/scd0 (should have been /dev/pktcdvd0) mount /dev/pktcdvd /mnt/floppy - locked for long time, went to work and came back to prompt - mount - pktcdvd nor floppy listed - modprobe -r pktcdvd rmmod: Device or resource busy pktsetup /dev/pktcdvd0 /dev/scd0 - forget the error message - reboot
What output does
ls -l /dev/pktcdvd*
I am not at home, so can't check first hand, but I am pretty certain that the only pkt dev entry is /dev/pktcdvd0 and it is set up with whatever major/minor device it was supposed to.
OK, I see what the problem is. The pktsetup program calls open() with flags = O_RDONLY | O_CREAT. The O_CREAT flag is a special hint to the pktcdvd driver that user space is about to bind the device to a real CDRW device. However, if the file name doesn't exist, the pktcdvd driver will not get involved, so the O_CREAT flag causes a new file to be created. Since the open() call doesn't supply the "mode" parameter, a file with random permission bits will be created. It doesn't surprice me that this hangs the mount command. One (racy) way to fix this is to add a check in setup_dev() in pktsetup.c that the pkt_device filename really points to a block special file. Maybe the race is acceptable though, because only root should have write access to the /dev directory anyway. A different approach would be to handle this like the loop device does. Setting up the loop device doesn't need any extra flags to the open system call, but if you try to do I/O on a non-bound loop device, you get an I/O error. -- Peter Osterlund - petero2@telia.com http://w1.894.telia.com/~u89404340
participants (2)
-
Noah Roberts
-
Peter Osterlund