I have a mountpoint
/opt/dirName
Then (for legacy reasons) there's a symbolic link
/usr/oper -> /opt/dirName/share/oper
I have some old code that is calling readdir to get the contents of the directory /usr/oper/config/cv. readdir returns "." which is ignored, and then the next call (which should be 00_00.col) returns NULL (indicating there are no more files). As a test, I ripped that directory parsing code out and put it in a simple standalone application that did nothing but print the name of the files. Interestingly, that works. In the main application, it fails. Looking at the syslog, I see [kernel: CIFS VFS: Filldir for parent dir failed].
When I put the trivial code that only searches the directory and prints the names just before the main application's code, *it* fails as well. However, I then changed the /usr/oper/... path to the equivalent directory in /opt/dirName/share/oper/config/cv and then the trivial printing loop worked in the main application where it had failed before.
Unfortunately, there's a lot of risk in changing all the paths from /usr/oper to /opt/dirName/share/oper and it would need to be done in half a dozen or more applications. Also, that path is likely in several configuration files.
I also tried
rsync /opt/dirName /opt/dirName2
and changed the symlink to point to the path which exists on the local disk (dirName2) instead of the cifs mount point (dirName) and then *all* the code that parses the /usr/oper/... directories worked.
I had a couple of theories, but my tests debunk them.
Theory 1) System limitation (too many descriptors of some sort)
Debunked By) Changing the path from /usr/oper/... to /opt/dirName/share/oper/... seems to fix the issue
Theory 2) RHEL security settings preclude this type of access or bug in CIFS.
Debunked By) I can build a standalone application which *is* able to do the same thing from the same working directory
All of this code previously worked on an older version of OpenSuSE; I just recently migrated to CENT7 and it has broken.
Anyone have any idea what the problem is
readdir failing in symlink into a CIFS mount
-
- Posts: 3
- Joined: 2017/08/22 12:08:14
Re: readdir failing in symlink into a CIFS mount
UPDATE:
I found that this problem is reproducible when compiling that standalone application with -m32, but works without that.
I found that this problem is reproducible when compiling that standalone application with -m32, but works without that.
-
- Posts: 3
- Joined: 2017/08/22 12:08:14
Re: readdir failing in symlink into a CIFS mount
errno is set to 12 (ENOMEM) when readdir fails.