[OpenAFS-devel] getcwd() on Linux 2.6.18+OpenAFS 1.4.2 bugs/errors.

Michael Loftis mloftis@wgops.com
Thu, 08 Nov 2007 17:27:01 -0700


--On November 8, 2007 3:46:16 PM -0800 Russ Allbery <rra@stanford.edu> 
wrote:

> Jim Rees <rees@umich.edu> writes:
>
>> It sounds like what you want is for the kernel to keep track not only of
>> the files and directories you have open, but the paths by which you got
>> to them.  Not impossible, but I think it would require changes to the
>> kernel outside afs.  And it would change the semantics of the file
>> system.
>
>> I'll admit that what you've seen can be surprising.  That's why most
>> file systems prohibit loops.  It would be nice if afs could do this but
>> it would be hard to implement.  And if we did, you would lose your
>> /afs/mw shortcut.
>
> The issue is with multiple paths to the same directory, which doesn't
> require a loop.

Well I can certainly use it to traverse into that other users homedir, 
tokens permitting when getcwd is returning the longer/incorrect path for 
var...

EG:

(chrooted into ...u/m/mloftis)

updog:/# ls -la
ls: .yesterday: Connection timed out
total 234
drwxrwxrwx   15 mloftis  mloftis      2048 Nov  8 17:00 .
drwxrwxrwx   15 mloftis  mloftis      2048 Nov  8 17:00 ..
-rw-rw-rw-    1 mloftis  501            82 Jun 20 21:03 ._skelloutscript
-rw-rw-rw-    1 1        501            82 Jul 20 16:40 ._staff_afs.txt
drwx------    2 mloftis  mloftis      2048 Jul 24 14:46 .aptitude
........

updog:/# cd var
updog:/var# /bin/pwd
/afs/modwest.com/u/j/jslife/var
updog:/var# ls -la tsets/
total 92
drwxrwxrwx    8 3680     3685         2048 Nov  8 12:53 .
drwxrwxrwx    2 root     root        43008 Jul 30 16:54 ..
drwx------    2 3680     36805        2048 Oct  9 15:32 .aptitude
-rw-------    1 3680     36805        2080 Oct  5 10:01 .bash_history
-rw-r--r--    1 3680     3685          220 May 25 12:54 .bash_logout
-rw-r--r--    1 3680     3685          414 May 25 12:54 .bash_profile
-rw-r--r--    1 3680     3685         2224 Oct  5 09:58 .bashrc
drwx------    2 3680     36805        2048 Oct  5 11:48 .gnupg
......
updog:/var# stat tsets
  File: "tsets" -> "../"
  Size: 3         	Blocks: 2          IO Block: 4096   Symbolic Link
Device: 13h/19d	Inode: 15339296    Links: 1
......

>
> Does the same problem happen with bind mounts?  And if not, can we use
> whatever solution was used for bind mounts to fix this problem?
>
> --
> Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
>



--
"Genius might be described as a supreme capacity for getting its possessors
into trouble of all kinds."
-- Samuel Butler