FindFirst2 and DFS links

Suresh Jayaraman sjayaraman at suse.de
Thu Mar 3 07:02:27 MST 2011


Hi all,

I'm looking into a CIFS client bug report where access to a DFS link
fails with -EREMOTE error intermittently. Later accesses to the DFS link
succeeds as dentry revalidation gets information about the DFS link.

When the failure occurs, it appears that the Server (both Samba and
Windows 2k8 server) returned -EREMOTE (NT_STATUS_PATH_NOT_COVERED) in
response to the FindFirst2 call on the DFS link. Looking at the CIFS
Spec, PATH_NOT_COVERED is not listed as one of the possible errors for
FindFirst2. So it's not clear why the Server is sending the same.

In order to handle this error, the CIFS client should find a way to
figure out from the Server's FindFirst2 response that it is a DFS link.
The only promising bit (in File attributes) is the "Reparse Point" which
is set in the response from a Windows Server. However, the Reparse point
could be something other than (symlinks or volume mountpoint etc) a DFS
junction. Is there a way to clearly distinguish a DFS junction?

In short:

* Is there a way to identify a DFS junction from the FindFirst2
  response?
* Is NT_STATUS_PATH_NOT_COVERED error expected for a DFS junction in the
  FindFirst2 response?


cFYI snip (for the curious)
---------

 fs/cifs/readdir.c: CIFS VFS: in cifs_readdir as Xid: 105 with uid: 0
 fs/cifs/readdir.c: Full path: \\mydomain\dfsroot\dfslink start at: 2
 fs/cifs/cifssmb.c: In FindFirst for \\mydomain\dfsroot\dfslink
 fs/cifs/transport.c: For smb_command 50
 fs/cifs/transport.c: Sending smb of length 142
 fs/cifs/connect.c: rfc1002 length 0x27
 fs/cifs/connect.c: invalid transact2 word count
Status code returned 0xc0000257 NT_STATUS_PATH_NOT_COVERED
 fs/cifs/netmisc.c:  !!Mapping smb error code 3 to POSIX err -66 !!
 fs/cifs/cifssmb.c: Error in FindFirst = -66
 fs/cifs/readdir.c: initiate cifs search rc -66
 fs/cifs/readdir.c: CIFS VFS: leaving cifs_readdir (xid = 105) rc = -66
 fs/cifs/file.c: Closedir inode = 0xd3f3acf0
 fs/cifs/file.c: CIFS VFS: in cifs_closedir as Xid: 106 with uid: 0
 fs/cifs/file.c: Freeing private data in close dir
 fs/cifs/file.c: CIFS VFS: leaving cifs_closedir (xid = 106) rc = 0


Thanks,

-- 
Suresh Jayaraman


More information about the samba-technical mailing list