[SOLVED] cifs mounts problem (Win7 via Fedora 14) - system isn't recognizing perfectly valid directories
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
cifs mounts problem (Win7 via Fedora 14) - system isn't recognizing perfectly valid directories
UPDATE 11/24: This post had its stay on the Programming forum but doesn't quite fit there since it's an overall mount problem. In a nutshell, the coding of some script is having problems reading some cifs mounts and I don't know why. That's where I'm stuck right now. I don't code, but if the problem is more mount-specific, the diagnosis needs to happen in Linux - Server since I am not able to fix perfectly working code.
I'm running a piece of code that adds directories to a searchable log file.
The executable runs
Code:
if (S_ISDIR(st.st_mode))
to log the directory. If it's not a directory, it doesn't add to the log.
I have a few mounts on cifs (not all) whose legitimate directories are failing this check.
I've actually spent about 4 days on this already to no avail. I have NO idea what is possibly different with the setup. The permissions are fine. I've rebooted. fstab shows identical code (just different drive letters and mount destinations).
The strange thing is that sometimes these directories *are* seen as directories. Sometimes they're not. NOTHING I am physically doing changes this. I could run the code in one minute and it will fail, and then run the code a few minutes later and it will pass.
I've added the following snippet to the code to figure out what's going on:
In other words, some directories are changing their characteristics. Others are not showing good output at all and the directories are not being logged.
I know this is seriously confusing and I'll likely find nothing from this, but I'm totally at a loss here and I figured this is the only place I can go to help. I have no knowledge whatsoever in C and got what I know thus far by asking a few people.
Here's some stuff from dmesg. I don't know the timestamps:
Code:
[ 6873.655031] CIFS VFS: No response for cmd 50 mid 9065
[ 6883.656034] CIFS VFS: Unexpected lookup error -112
[ 6893.657042] CIFS VFS: Unexpected lookup error -112
[ 6903.659028] CIFS VFS: Unexpected lookup error -112
[ 7023.672030] CIFS VFS: Unexpected lookup error -112
[ 7033.673029] CIFS VFS: Unexpected lookup error -112
[ 7048.118031] CIFS VFS: No response for cmd 114 mid 9066
[ 7049.121036] CIFS VFS: No response for cmd 114 mid 9067
[60795.069525] CIFS VFS: Autodisabling the use of server inode numbers on \\mount\mountname. This server doesn't seem to support them properly. Hardlinks will not be recognized on this mount. Consider mounting with the "noserverino" option to silence this message.
Is this related?
Here is more info from my fstab. First I mount the cifs, and then I mount it to where I want to do the logging.
I don't want to turn this into a Windows flame, but since you're using CIFS and you mention 'drive letters', I guess that the share is on a Windows host. Can you repeat the test from a different client host, or against different servers &/or shares? I'm just trying to establish whether the problem is in your code, or possibly in the server(s) or the CIFS client code itself.
In your code, if you call stat() repeatedly in a tight loop, is the result consistent? Also, can you show us a code fragment that you use to acquire the struct stat?
I don't want to turn this into a Windows flame, but since you're using CIFS and you mention 'drive letters', I guess that the share is on a Windows host. Can you repeat the test from a different client host, or against different servers &/or shares? I'm just trying to establish whether the problem is in your code, or possibly in the server(s) or the CIFS client code itself.
In your code, if you call stat() repeatedly in a tight loop, is the result consistent? Also, can you show us a code fragment that you use to acquire the struct stat?
--- rod.
Yes, it's a Win7 box. I'm not sure how to repeat this test elsewhere, and Windows is where I intend to be running this so it needs to work... and it did when I had XP to my awareness. I recently upgraded to Win7.
So my knowledge of C is *extremely* basic (I can sort of understand 4% of the code), and therefore, I don't really now how to call stat repeatedly in a tight loop. I added that lengthy printf snippet on recommendation from someone else; I have no idea what it is showing.
Also, can you show us a code fragment that you use to acquire the struct stat?
In particular, do you check the return value?
I'm guessing the "VFS lookup error" is probably key. I'm also guessing that maybe the problem is indeed intermittant (as previously suggested), and maybe the same "stat()" call might "magically work" if you retried it after a slight delay.
I'm sure you've had experiences with Windows desktop and/or Windows explorer windows appearing to "hang". Under the covers, that's Windows retrying it's little heart out because of some network access glitch or another
I'm guessing the "VFS lookup error" is probably key. I'm also guessing that maybe the problem is indeed intermittant (as previously suggested), and maybe the same "stat()" call might "magically work" if you retried it after a slight delay.
I'm sure you've had experiences with Windows desktop and/or Windows explorer windows appearing to "hang". Under the covers, that's Windows retrying it's little heart out because of some network access glitch or another
Well, the problem isn't "intermittent" really. To be clear, the problem seems to happen in the first 5-6 hours and then goes away for one mount, but I have *not* at all fixed the other mount.
Yes, I have checked the st.st_mode a few times. It either returned 40777 (valid) or 0 (invalid).
Sorry, I'm a bit of a newbie. The code already recursively jumps into every file in that directory. All this will do is repeat the same code 100 times. I usually manually run the script and see the output, but it never changes like that right away.
Here's output of a bad directory now based on your code:
Yeah, those printf statements from earlier confirmed that there are errors recognizing the directory structure, I just don't know why either.
Is there a way for me to get these issues reasonably resolved? Why is this more visible in Win7 and not XP? Is there anything I can do? Mount differently?
Well, the problem isn't "intermittent" really. To be clear, the problem seems to happen in the first 5-6 hours and then goes away for one mount, but I have *not* at all fixed the other mount.
Yes, I have checked the st.st_mode a few times. It either returned 40777 (valid) or 0 (invalid).
If your stat function return -1 (error) then you can't trust whatever returned in the buffer. - Ooops - didn't see that it was already said
Last edited by Valery Reznic; 11-19-2010 at 02:32 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.