Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2007 20:18:09 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Nikos Vassiliadis <nvass@teledomenet.gr>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: mounted cd and tray locking
Message-ID:  <476025E1.7020200@icyb.net.ua>
In-Reply-To: <47601344.8020106@icyb.net.ua>
References:  <475FC26C.3030508@icyb.net.ua> <200712121555.24953.nvass@teledomenet.gr> <47601344.8020106@icyb.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
on 12/12/2007 18:58 Andriy Gapon said the following:
> on 12/12/2007 15:55 Nikos Vassiliadis said the following:
>> On Wednesday 12 December 2007 13:13:48 Andriy Gapon wrote:
>>> I recently noticed that FreeBSD doesn't prevent tray opening (via a
>>> button on CD/DVD drive) even if I mount a CD with ISO 9660 filesystem on
>>> it. This at least happens with ATAPI CD drive (acd driver/device).
>>>
>>> Maybe my memory is failing me but I seem to remember times when mounting
>>> a CD locked a tray. Shouldn't this be a more reasonable behavior ?
>> Yes, could file a PR?
>>
>> I see the mentioned behavior for my recent 6-STABLE.
> 
> Hmm. Looked at the code and it should be as expected. Played with
> various stuff and here's what I think: it seems that having atapicam and
> hald and maybe something in KDE that polls for CD change is to blame.
> My theory: after I mount some media on acd0, hald wants to "taste" it
> through cd0, on opening cd0 device 'prevent' command is sent, on closing
> cd0 'allow' is sent, so in the end drive's tray is in unlocked state.
> 
> I don't see any easy resolution for this, but it definitely would be
> good to come up with one.
> 

Investigated more and it seems that hald is a main culprit here. Without
it everything works reasonably well as long as I don't mix acd and cd
accesses.
That is, if I mount through acd, then trough cd, then unmount the cd
mount, then tray gets unlocked. In a perfect world I would like to fix
even this, but in real world this is OK.
But if mount only through one device then tray is locked.

So, hald is doing something "wrong" here. I am not sure if it is by
design (to make the behavior mswindows-like) or if it is a bug or a
side-effect of something.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?476025E1.7020200>