Re: Bug: getcwd: cannot access parent directories

From: Roel Van de Paar
Date: Thu Sep 27 2018 - 17:01:46 EST


Hi Casey,

On 28 September 2018 at 05:46, Casey Schaufler <casey@xxxxxxxxxxxxxxxx> wrote:

> Please try doing this under strace, in particular
>
> strace mv 3 /dev/shm
>
> What you will see is that the mv command does a copy/delete
> when changing filesystems. The original "2" directory, which
> is your current working directory, will have no parent as the
> original "1" will have been removed.
>
>>>
>>> Back to session 1
>>> cd .. # fail
>>> cd .. # fail
>>> cd .. # fail
>>> cd .. # fail
>>> cd .. # fail
>>> cd .. # fail
>>> cd .. # works, but to completely incorrect directory given the
>>> many 'cd ..'```
>>>
>>> The problem is made more clear here by using 3/4/5/6/7 but you can
>>> also just use a single subdir to see it
>> Roel Van de Paar, Technical Director - Quality Assurance, Percona
>
> The system is working properly.

Thank you for the analysis.

I can see your point, but it looks like this could be improved by
matching the behavior when not changing filesystems.

Also, there is a difference between working when it is a different
filesystem or not - so there is inconsistency in operation.