Inconsistent occurance of "text file busy" errors, depending on if file is opened for writing that doesn't exist vs. a file that does exist: 1) If a linux process opens a file that /doesn't exist/ for writing via smbfs, while the file is open other machines trying to read the file yield the usual 'Text file is busy' (linux) or 'file is in use by another process' (windows). 2) BUT, if a linux process opens a file that /does/ exist, other machines can read the file successfully while it is open without error. This screen history shows how to replicate the inconsistent behavior. ------------------------------------------------------------------------- snip [root@linux1] $ rm /smbserver/tmp/foo.log <-- ENSURE LOG DOESNT EXIST [root@linux1] $ ping localhost >& /smbserver/tmp/foo.log & <-- SLOW COMMAND [1] 5778 HOLDS LOG OPEN [root@linux1] $ rsh linux2 cat /smbserver/tmp/foo.log <-- REMOTE LINUX CANT READ FILE cat: /smbserver/tmp/foo.log: Text file busy [root@linux1] $ rsh win2k 'type \\smbserver\tmp\foo.log' <-- REMOTE WIN2K CAN'T READ FILE The process cannot access the file because it is being used by another process. [root@linux1] $ kill %% <-- KILL PROCESS TO CLOSE LOG [1] + Terminated ping localhost >& /smbserver/tmp/foo.log [root@linux1] $ ls -la /smbserver/tmp/foo.log <-- LOG NOW EXISTS -rwxrwxr-x 1 foo foo 14534 Oct 5 23:26 /smbserver/tmp/foo.log [root@linux1] $ ping localhost >& /smbserver/tmp/foo.log & <-- RUN SAME COMMAND [1] 6397 ONLY DIFFERENCE: LOG FILE EXISTS [root@linux1] $ rsh linux2 cat /smbserver/tmp/foo.log <-- REMOTE LINUX PING localhost (127.0.0.1) 56(84) bytes of data. READS OK 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.030 ms 64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.035 ms [..] [root@linux1] $ rsh win2k 'type \\smbserver\tmp\foo.log' <-- REMOTE WINDOWS PING localhost (127.0.0.1) 56(84) bytes of data. READS OK 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.030 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.030 ms 64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.035 ms [..] ------------------------------------------------------------------------- snip Possibly this is an inconsistent behavior between SMBcreate and SMBopen packets? (SMBcreate is used when file doesn't exist vs SMBopen when file does exist) I tried using tcpdump (with SMB decoding compiled in) to detect this, but was unable to determine anything useful other than SMBcreate was not called when the file exists.
greg, we don't maintain smbfs. You'll have to eiether contact the smbfs maintainer on the linux kernel mailing list or maybe try the cifs vfs module for the 2.6 kernel since it is under active development. nice analysis though.