Bug 9283 - getcwd: cannot access parent with cifs
Summary: getcwd: cannot access parent with cifs
Status: RESOLVED DUPLICATE of bug 9484
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
Depends on:
Reported: 2012-10-11 05:16 UTC by yzg
Modified: 2020-08-13 16:41 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description yzg 2012-10-11 05:16:24 UTC
The cifs share is hosted on Win2000 computer and mounted on a Gentoo Linux computer with options "users,exec". The version of Samba is 3.6.8.

Steps to trigger the error:  

(1) Create a directory into a samba share
$ cd /mnt/samba_share
$ mkdir tmp1

(2) Then create a sub-directory
$ cd tmp1
$ mkdir tmp2
$ cd tmp2

(3) Running command like make will not generate the error. 
$ make
make: *** No targets specified and no makefile found.  Stop.

(4) Now create a file in the parent directory and delete it.
$ touch ../any.txt
$ rm ../any.txt 

(5) Running make again will give "getcwd: No such file or directory" error.
$ make
make: getcwd: No such file or directory
make: *** No targets specified and no makefile found.  Stop.

(6) Changing directory to the parent directory and back again will stop the error.
$ cd ../tmp2
$ make
make: *** No targets specified and no makefile found.  Stop.

(7) It is not only Other commands like gentoo equery command generates the same error
$ equery b /usr/bin/find
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
 * Searching for /usr/bin/find ...
Comment 1 yzg 2012-10-14 23:31:42 UTC

I saw the same error with ext3 while building Asterisk package. So it is not limited to cifs.
Comment 2 Marcus Moeller 2012-12-10 09:27:21 UTC
We've only experienced that with CIFS.
Comment 3 Björn Baumbach 2012-12-13 15:01:17 UTC
I can not reproduce this on my Gentoo Linux 3.5.7 on a Samba 4.0.0 share mounted with cifs-utils-5.5-r1.

yzg: the samba version does not matter. The cifs stuff depends on the Kernel and cifs-utils. Do you still have this problem?
Comment 4 Volker Lendecke 2012-12-13 16:29:36 UTC
Is it possible that you removed your own subdirectory instead of just one file in the parent directory?

vlendec@delphin:~$ mkdir /tmp/bla
vlendec@delphin:~$ mkdir /tmp/bla/blub
vlendec@delphin:~$ cd /tmp/bla/blub
vlendec@delphin:/tmp/bla/blub$ rm -r /tmp/bla
vlendec@delphin:/tmp/bla/blub$ ls
vlendec@delphin:/tmp/bla/blub$ cd ..
cd: Kann das nicht aktuelle Verzeichnis wiederfinden: getwd: Kann nicht auf das übergeordnete Verzeichnis zugreifen.: Datei oder Verzeichnis nicht gefunden
Comment 5 yzg 2013-02-20 04:41:52 UTC
Hi Björn

Yes, I still have this problem. I'm at version net-fs/cifs-utils-5.6-r1 and kernel 3.6.11-gentoo.

Sometimes, it does not reproduce. But if you delete all the directories and repeat the procedure, it happens.

The problem is interfering with any build process if the project files are stored on samba. 

Hi Volker

I'm very careful about deleting the current directory.
Comment 6 Björn Jacke 2020-08-13 16:29:21 UTC
works for me. also comment#1 said this also happens with ext3, so there seems to be a different problem.
Comment 7 Björn Jacke 2020-08-13 16:41:49 UTC
actually looks very much like bug #9484

*** This bug has been marked as a duplicate of bug 9484 ***