Bug 1962 - smbfs "Text file busy" inconsistent errors (existing vs non-existing files)
smbfs "Text file busy" inconsistent errors (existing vs non-existing files)
Status: RESOLVED WONTFIX
Product: Samba 3.0
Classification: Unclassified
Component: smbmount (unmaintained)
3.0.7
x86 Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-22 21:07 UTC by Greg Ercolano
Modified: 2004-11-11 14:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Ercolano 2004-10-22 21:07:39 UTC
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.
Comment 1 Gerald (Jerry) Carter 2004-11-11 14:01:21 UTC
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.