[linux-cifs-client] cannot write to file after move to 2.6.27 from 2.6.25.4

Jeff Layton jlayton at redhat.com
Wed Oct 15 16:51:20 GMT 2008


On Wed, 15 Oct 2008 11:20:15 -0500
Timothee Besset <ttimo at idsoftware.com> wrote:

> Jeff Layton wrote:
> > On Tue, 14 Oct 2008 19:26:13 -0500
> > Timothee Besset <ttimo at idsoftware.com> wrote:
> >
> >   
> >> Lo all,
> >>
> >> I've been stuck on 2.6.25.4 for a while now. With each newer kernel I've
> >> tried I found myself with some of my network shares not working. The
> >> symptoms are as follow:
> >>
> >> I can mount just fine, I have linux extensions disabled, I also pass
> >> 'nounix' on the mount command line.
> >> I cannot write to existing files. I can create new files however.
> >>
> >> Each time I try a new kernel I end up going back to my old 2.6.25.4
> >> because it's the only one that still works. Attaching below a log of
> >> mounting the filesystem and running a write operation that fails. Server
> >> is a samba 3.0.24
> >>
> >> TTimo
> >>
> >>     
> >
> > The cifsFYI output shows this toward the end:
> >
> > Oct 14 19:22:14 ttimozilla kernel:  fs/cifs/connect.c: invalid transact2 word count
> > Oct 14 19:22:14 ttimozilla kernel:  fs/cifs/netmisc.c: Mapping smb error code 2 to POSIX err -2
> > Oct 14 19:22:14 ttimozilla kernel:  fs/cifs/cifssmb.c: SetPathInfo (file size) returned -2
> > Oct 14 19:22:14 ttimozilla kernel:  fs/cifs/inode.c: SetEOF by path (setattrs) rc = -2
> >
> > SMB error 2 looks like:
> >
> > #define ERRbadfile              2       /* File not found. The last component
> >                                            of a file's pathname could not be
> >                                            found. */
> >
> > ...any chance you could send me a binary network capture of this failure?
> >
> > Thanks,
> >   
> 
> Attached a capture. A bit more info on what I'm seeing:
> 
> OK (creates file) $ echo foo > bar
> OK $ rm foo
> OK $ echo foo > bar
> FAIL - 'file not found' (replace fails) $ echo foo > bar
> OK (append) $ echo foo >> bar
> 
> I can run more tests easily, just let me know.
> 
> TTimo
> 

I'm guessing you just captured the info on the replace that fails.
Looks like this is a server bug:

...here we query the file's info -- it works and returns info about the file:

  1   0.000000  10.4.20.129 -> 10.4.20.25   SMB Trans2 Request, QUERY_PATH_INFO, Query File All Info, Path: \\10.4.20.25\quakezero\qzdev-ttimo\bar
  2   0.000190   10.4.20.25 -> 10.4.20.129  SMB Trans2 Response, QUERY_PATH_INFO
  3   0.000228  10.4.20.129 -> 10.4.20.25   TCP 46784 > microsoft-ds [ACK] Seq=155 Ack=169 Win=501 Len=0 TSV=614719 TSER=644443730

...so then we try to set the info (basically to do a truncate), and the
server says the file isn't there:

  4   0.000294  10.4.20.129 -> 10.4.20.25   SMB Trans2 Request, SET_PATH_INFO, Path: \\10.4.20.25\quakezero\qzdev-ttimo\bar
  5   0.000488   10.4.20.25 -> 10.4.20.129  SMB Trans2 Response, SET_PATH_INFO, Error: STATUS_OBJECT_NAME_NOT_FOUND
  6   0.039903  10.4.20.129 -> 10.4.20.25   TCP 46784 > microsoft-ds [ACK] Seq=319 Ack=208 Win=501 Len=0 TSV=614759 TSER=644443730

...it might be interesting to compare the capture here to a capture
doing the same thing with the 2.6.25.4 kernel that's working for you.

I *think* some older samba versions had semi-broken DFS support. CIFS
DFS support went into 2.6.26 (I think). It may be that 2.6.25 didn't
send fully-qualified pathnames like this. So instead of:

\\10.4.20.25\quakezero\qzdev-ttimo\bar

...the older kernel may be sending:

\qzdev-ttimo\bar

...if so, you may be able to work around this by disabling DFS support
altogether at the server (host msdfs = no). A samba upgrade is probably
also a good thing to consider here.

-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list