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

Nix <[email protected]> Sat, 26 Feb 2005 16:45:40 +0000
Newsgroups gmane.linux.suse.packet-writing
Message-ID <[email protected]>
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...

> 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.

(I only discovered that little gem yesterday. Need I say that my
permanent backups are on CD/R, rendered effectively inaccessible by this
bug, and that I didn't discover this until it was too late? :( )

-- 
> ...Hires Root Beer...
What we need these days is a stable, fast, anti-aliased root beer
with dynamic shading. Not that you can let just anybody have root.
 --- John M. Ford