From: torvalds@klaava.Helsinki.FI (Linus Torvalds) Subject: Re: Directory rename FX Date: Fri, 12 Feb 1993 12:35:28 GMT
In article <1lek9f$5g5@smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
>Renaming a directory seems to cause an inconsistency in the kernel:
>
>$ cd /tmp ; mkdir x ; cd x
>$ (cd ../ mv x y )
>$ cd .
>.: No such file or directory
>$ ls -lid . ../y
> 7784 drwxr-xr-x 2 root system 32 Feb 12 00:28 .
> 7784 drwxr-xr-x 2 root system 32 Feb 12 00:28 ../y
>$ cd ../y
>$ cd .
>$
>This is 0.99.5, Minix FS.
I'd suggest you try this with (a) different shells, and (b) external
commands. It looks like a shell problem, not a problem with the kernel.
At a first guess, I'd guess that the shell is caching the internal pwd
variable, which would mess up 'cd'. When I try the same thing under
SunOS, I do indeed get the "wrong" behaviour with 'cd', but doing an
external command like 'ls -l .' works correctly.
hydra$ mkdir t
hydra$ cd t
hydra$ (cd .. ; mv t m)
hydra$ cd .
.: No such file or directory
hydra$ ls -l .
total 0
This would seem to indicate a shell bug rather than a kernel problem.
Linus