lkml.org 
[lkml]   [2000]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bug: mount on an open directory succeeds


On Mon, 6 Mar 2000, V Ganesh wrote:

> > They have. ls(1) is buggy, that's it. If you want the listing of "." -
> > fine, open ".", but then you must care to call stat() on ./name. Yes,
> > there is no way to open the mountpoint. So?
>
> so it breaks the assumption that . == pwd.

Yes, it does.

> $ ls
> foo bar
> $ cat foo
> foo: no such file or directory
> $ cat ./foo
> FOO
> $
>
> cat foo ought to have worked. anything else is a gross violation of the least
> surprise principle, if not any actual standard.

Excuse me? Why? We have an object - pwd. Lookup goes from that object.
_That_ should not be changed by any mount. Notice that if you had it
opened before mount() readdir() on it would return its contents.

Look: step of lookup ends with the step upwards. It's 3-d structure, not
2-d one. You are getting exactly what you ask for - "." is "do the step
with zero horizontal part". E.g. "go upwards". Which is no-op for
everything except the mountpoints. Your problem being?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.383 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site