From owner-freebsd-questions@FreeBSD.ORG Thu Dec 13 10:39:54 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 2D3FA16A421 for ; Thu, 13 Dec 2007 10:39:54 +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 D0A6C13C46A for ; Thu, 13 Dec 2007 10:39:53 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id D8180744003; Thu, 13 Dec 2007 12:39:52 +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 9Df-CsM0bube; Thu, 13 Dec 2007 12:39:52 +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 9D4C143C03D; Thu, 13 Dec 2007 12:39:52 +0200 (EET) Message-ID: <47610BF7.8070002@icyb.net.ua> Date: Thu, 13 Dec 2007 12:39:51 +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> <200712130930.08558.nvass@teledomenet.gr> <4760FE68.60001@icyb.net.ua> <200712131213.37478.nvass@teledomenet.gr> <47610957.8020800@icyb.net.ua> In-Reply-To: <47610957.8020800@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org, =?UTF-8?B?U8O4cmVuIFNjaG1pZHQ=?= 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: Thu, 13 Dec 2007 10:39:54 -0000 on 13/12/2007 12:28 Andriy Gapon said the following: > on 13/12/2007 12:13 Nikos Vassiliadis said the following: >> On Thursday 13 December 2007 11:42:00 Andriy Gapon wrote: >>> on 13/12/2007 09:30 Nikos Vassiliadis said the following: >>>> I have no atapicam in my kernel. Nor hald running. >>>> I reproduced it like this: >>>> mount /cdrom >>>> cdcontrol eject >>> I don't think you reproduced it. Why would you execute the above command >>> unless it is your intention to eject the disk ? >> You got it wrong. cdcontrol *does not* eject the disk, it works >> correctly, as it should. cdcontrol never ejects mounted media. > > Well, I got it right, it's just that in my opinion you knew what you > were doing. > >> It triggers the situation where I can then press the eject key >> on the cdrom and really eject the cdrom. > > It would be interesting to see what exact ioctls/commands cdcontrol > issues. ktrace+kdump can help with this. Assuming your drive is ATAPI > (not SCSI) then if only CDIOCEJECT is issued then the drive should not > become unlocked. Tried this myself: 11991 cdcontrol CALL open(0x7fffffffe130,0,0x9) 11991 cdcontrol NAMI "/dev/acd0" 11991 cdcontrol RET open 3 11991 cdcontrol CALL ioctl(0x3,CDIOCALLOW,0) 11991 cdcontrol RET ioctl 0 11991 cdcontrol CALL ioctl(0x3,CDIOCEJECT,0) 11991 cdcontrol RET ioctl -1 errno 16 Device busy 11991 cdcontrol CALL exit(0xffffffff) It is a question for me how atapi-cd should behave on CDIOCALLOW command issued on an opened disk (by something other than the entity doing ioctl, i.e. geom acr > 1). Maybe it should work the same way as for CDIOCEJECT, maybe geom ace should be taken into account somehow. Part of me says: do not allow unlocking tray if something is mounted, the other part says: let user do what he wants. Maybe the easiest solution here is to change cdcontrol to do only CDIOCEJECT without CDIOCALLOW ? -- Andriy Gapon