This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: jffs2 /dev and devfs clash


Andrew Lunn <andrew.lunn@ascom.ch> writes:

> 
> Q1: What is the intended behaviour here? The jffs2 fs was mounted as /
> so should hide the devfs mounted on /dev. 

No quite the reverse. The idea is that rooted pathnames select the
entry with the longest match in the mount table. In this case "/dev"
is longer than "/" so it is selected. This is not Unix, so we don't
have inodes with which to implement mountpoints. The longest match
trick at least allows us to present the illusion that we have
mountpoints somewhere other then at the root, and allows us to
construct a filesystem that conforms to what most people expect.

Giving thr JFFS filesystem a /dev directory is a very Unix-centric
thing to do, it has no use in eCos at all.


> 
> Even if it is stat'ing the wrong filesystem, i would still expect it
> to work. But instead stat returns an error, no such entity. Something
> is going wrong with the -5 byte offset magic in the devfs. This
> results in the name passed to cyg_io_lookup being ";/dev" which
> obviously fails.
> 
> Q2: Should stat of /dev work?
> 

/dev isn't really a proper directory, just a place to put the names of
devices. The expectation in an embedded system is that applications
should know the names of the devices it accesses -- we don't have
users sitting at shells going "ls /dev". To make /dev behave like a
real directory would be a lot of code for very little benefit --
although it may be worthwhile ensuring it rejects directory level ops
more cleanly.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]