From owner-freebsd-questions@FreeBSD.ORG Wed Dec 12 18:18:14 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6D8916A417 for ; Wed, 12 Dec 2007 18:18:14 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 6CDC013C46B for ; Wed, 12 Dec 2007 18:18:14 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 53EDB744021; Wed, 12 Dec 2007 20:18:12 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rE1zZHa-OVnF; Wed, 12 Dec 2007 20:18:12 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 39353744001; Wed, 12 Dec 2007 20:18:12 +0200 (EET) Message-ID: <476025E1.7020200@icyb.net.ua> Date: Wed, 12 Dec 2007 20:18:09 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: Nikos Vassiliadis References: <475FC26C.3030508@icyb.net.ua> <200712121555.24953.nvass@teledomenet.gr> <47601344.8020106@icyb.net.ua> In-Reply-To: <47601344.8020106@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: mounted cd and tray locking X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2007 18:18:15 -0000 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