cdcontrol purpose

Andriy Gapon avg at icyb.net.ua
Mon Jan 14 09:00:56 PST 2008


on 14/01/2008 18:06 Alfred Perlstein said the following:
> * gnn at freebsd.org <gnn at freebsd.org> [080114 07:11] wrote:
>> At Mon, 14 Jan 2008 12:52:16 +0200,
>> Andriy Gapon wrote:
>>>
>>> The following question may seem to be offtopic for this list, but I
>>> think that it's not because it is related not only to cdcontrol utility
>>> itself but also to the CD-ROM drivers.
>>>
>>> The question: should cdcontrol utility be able to eject a mounted disk
>>> (i.e. a filesystem on the disk is mounted) ?
>>>
>> I come down on the side of "separation of concerns" and think that
>> mount should deal with filesystems and that cdcontrol should not.

This is how it is. The philosophical question is: if mount is able to
prevent physical media of the fs from disappearing, should it employ
that capability ? Currently, it does.

> I agree.  
> 
> I can't tell if Andriy is suggesting that cdcontrol unmount the filesystem
> forcefully or at least attempt to unmount it.
> 
> I would say that it might make sense for cdcontrol to grow a flag
> to "unmount non-forcefully if mounted", but certainly not to
> unmount by default.
> 

Well, I never suggested (or even had a thought) that cdcontrol should
get into (un)mounting business, or even doing any checks. It is a simple
tool and should stay simple.

It boils down to the following: when you do mount a filesystem on CD/DVD
(or otherwise open(2) cd/acd device) CD-ROM driver issues a command to
lock a tray ("prevent").
I think that this is very reasonable as it prevents a user from
accidentally ejecting (using a physical button, that is) and even
replacing a disk while something has it in use.

So I hope my question would be clearer now: should cdcontrol be allowed
to override "prevent" issued by mount/open(2) and eject a disk in use ?
Or should it simply fail in the same way that the physical button is
disabled?

-- 
Andriy Gapon


More information about the freebsd-arch mailing list