Re: 2.4 -> 2.6 change: mount with disk not in drive semantics changed to something silly

Peter Osterlund <[email protected]> Sat, 26 Feb 2005 19:23:42 +0100 (CET)
Newsgroups gmane.linux.suse.packet-writing
Message-ID <[email protected]>
On Sat, 26 Feb 2005, Nix wrote:

> On Sat, 26 Feb 2005, Peter Osterlund stipulated:
> > On Wed, 23 Feb 2005, Nix wrote:
> >
> >> In 2.6, that's changed: the first time you try to mount, you get
> >>
> >> mount: /dev/pktcdvd/cdrw: can't read superblock
> >>
> >> and the *second* time it works.
> > ...
> >> I imagine this is a bug.
> >
> > Yes, that's not supposed to happen. It works as expected on my computers
> > though. I tested with an external USB drive on a computer running FC3 and
> > kernel 2.6.11-rc4-bk8 and on another computer using an internal IDE drive
> > (no ide-scsi emulation) running FC2 and kernel 2.6.10.
>
> The latter sounds exactly like my situation.
>
> > I did this:
> >
> > 1. Boot computer.
> > 2. Open CD drive.
> > 3. Run "pktsetup cdrw /dev/scd0"
> > 4. Insert UDF packet formatted disc, but did not close CD door.
> > 5. Run "mount /dev/pktcdvd/cdrw /mnt/tmp".
> >
> > The door then closes and after a while the mount command succeeds.
>
> Further experimentation at this end shows that it does indeed work as
> you say --- the *first* time one mounts. (i.e., if you have three
> states, EJECTED_BROKEN, EJECTED_READY and MOUNTED, it's as if the system
> starts in EJECTED_READY, but sn eject after umount puts it into
> EJECTED_BROKEN and only a (failed) mount attempt will put it back
> into the same state it was in post-boot.
>
> It's almost as if the kernel doesn't realise the disc is ejected until
> the first mount attempt fails...

I still can't make it fail on my computer. When the mount command fails on
your computer, does the tray get closed by the failed mount command? How
did you open the tray between the first and second try? Pressing the eject
button or running the eject program?

> > Are you doing something different? Do you have the same problem if you
> > mount a CD read-only without using the packet writing driver?
>
> No, that works --- but is buggered up in a much more catastrophic
> fashion; after umount, the drive door is locked, and nothing can unlock
> it again; IIRC, anyone who tries gets an EINVAL.

What exactly does "nothing" mean? Did you try these things?

1. Running pktsetup -d before trying to eject.
2. Running eject as root.
3. Reboot the computer.
4. Power cycle the computer.

-- 
Peter Osterlund - [email protected]
http://web.telia.com/~u89404340