tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Autoconfiguring root device and fstab(5) (wedges?)

>>> Can't we move the [from_mount] logic from mount(8) to getfsent(3)
>>> internal?
>> It should be easy enough to teach fsck(8) [...].  I am not keen on
>> moving the logic to getfsent(3), because that's just a file parser,
>> independent of system state.

That's what it is now.  I'm not convinced it necessarily should remain

It seems to me that the alternatives are:

1) Drop "from_mount" entirely.

2) What we have now: library routines know nothing about from_mount;
    programs that want to handle it have to do so on their own.

3) getfsent(3) handles from_mount.

4) getfsent_bis(3) (or whatever name) is added, which does getfsent
    plus mapping from_mount, possibly more in the future.

5) handle_from_mount(3) (or whatever name) is added, which handles the

I don't like (2) because it leads to code duplication: multiple
programs end up handling from_mount, each of them doing it slightly
differently, with slightly different semantics (perhaps by design,
perhaps by bugs).

(3) is the cleanest in some senses, in that it means programs don't
need any code changes to take advantage of from_mount.

(4) and (5) (which are pretty much the same in most senses) satisfy the
desire to avoid code duplication and the desire to leave gtefsent(3) as
a pure file parser, but programs need to explicitly call them.

(1) is an option in a sense.  I'm not sure I like it, but I'm not sure
I don't, either - it's not clear to me what desire from_mount exists to
satisfy, so I have no real idea what the price of dropping it would be.
Presumably someone saw some need, or it wouldn't be there....

> We can't move the logic from mount(8) to anywhere because fsck(8)
> needs to work when a filesystem is not mounted,

I don't see this as a big deal; a from_mount entry can't work when not
mounted anyway.  And, even if the argumen tis valid, it doesn't mean
you can't move it frokm mount(8) to anywhere else; it just means you
can't move it from mount(8) to anywhere fsck uses.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index