[linux-cifs-client] cifs: mount error 20 = Not a directory, while it works with smbclient

Jeff Layton jlayton at redhat.com
Wed Nov 28 21:27:13 GMT 2007


On Wed, 28 Nov 2007 22:07:18 +0100
Andreas Hegyi <andreas at hegyi.info> wrote:

> Jeff, thanks for the suggestions & sorry for my slow reply. I was too 
> busy with work.
> >> The commands and results are the following:
> >>
> >> *- with smbclient:*
> >> [a at ipl ~]$ smbclient '//citgwn7/t&p' -U
> >> 'citg\myusername%mypassword' Domain=[CITG] OS=[Windows Server 2003
> >> 3790 Service Pack 2] Server=[Windows Server 2003 5.2]
> >> smb: \> dir
> >> NT_STATUS_ACCESS_DENIED listing \*
> >>
> >> 65535 blocks of size 33554432. 19331 blocks available
> >> smb: \> cd iedereen
> >> smb: \iedereen\> dir
> >> . D 0 Thu Nov 8 14:16:17 2007
> >> .. D 0 Thu Nov 8 14:16:17 2007
> >> ### Halloweenfeest D 0 Mon Nov 5 11:22:14 2007
> >> ##_Algemene_Leiding D 0 Fri Sep 14 15:13:21 2007
> >> ##_Literature D 0 Thu Feb 15 15:20:54 2007
> >> ##_ProjectRapportages_T&P
> >>
> >> ... and a long list of files and dirs, so this works.
> >>
> >> *- with mount -t cifs*:
> >> [root at ipl ~]# mount -t cifs '//citgwn7/t&p' /mnt/H -o 
> >> 'user=myusername,pass=mypassword'
> >> mount error 20 = Not a directory
> >> Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
> >>
> >> Directly mounting //citgwn7/t&p/iedereen gives the same error.
> >>
> >> ===
> >> The debug output is the following:
> >>     
> ...
> >> fs/cifs/cifsfs.c: Devname: //citgwn7/t&p flags: 64
> >>  fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 31) rc = 0
> >>  fs/cifs/inode.c: CIFS VFS: in cifs_read_inode as Xid: 32 with
> >> uid: 0 fs/cifs/inode.c: Getting info on
> >>     
> >
> > That's interesting. That should print out the search_path var, but
> > it appears to be a blank string (though maybe that's expected when
> > trying to stat the root of the share).
> >
> >   
> Maybe this is similar to the fact that smbclient is also access
> denied when I do a dir. It seems that I can only cd to the directory
> that I have a permission for.
> > ...
> >> 022 NT_STATUS_ACCESS_DENIED
> >>  fs/cifs/netmisc.c:  !!Mapping smb error code 5 to POSIX err -13 !!
> >>  fs/cifs/cifssmb.c: Send error in QPathInfo = -13
> >>     
> >
> > ...and the server doesn't like it and says you don't have access to
> > the inode.
> >
> >   
> >> SELinux: initialized (dev cifs, type cifs), uses genfs_contexts
> >>  fs/cifs/cifsfs.c: In cifs_put_super
> >>  fs/cifs/connect.c: CIFS VFS: in cifs_umount as Xid: 33 with uid: 0
> >>  fs/cifs/cifssmb.c: In tree disconnect
> >>  fs/cifs/transport.c: For smb_command 113
> >>  fs/cifs/transport.c: Sending smb of length 35
> >>  fs/cifs/connect.c: rfc1002 length 0x27)
> >>  fs/cifs/connect.c: About to do SMBLogoff
> >>  fs/cifs/cifssmb.c: In SMBLogoff for session disconnect
> >>  fs/cifs/transport.c: For smb_command 116
> >>  fs/cifs/transport.c: Sending smb of length 39
> >>  fs/cifs/connect.c: rfc1002 length 0x2b)
> >>  fs/cifs/connect.c: Waking up socket by sending it signal
> >>  fs/cifs/connect.c: CIFS VFS: leaving cifs_umount (xid = 33) rc = 0
> >>
> >> I unfortunately do not know how to interpret these messages.
> >> Any suggestions what goes wrong, and how I could mount the share?
> >>
> >>     
> >
> > I'd suspect that you don't have proper permissions on the share, but
> > then you'd think that smbclient would fail too.
> >   
> What I actually don't understand why I can't deep mount the
> `iedereen' directory, for which I do have the access rights.

When you "deep mount" with CIFS, you're actually mounting the top level
of the share and then CIFS prefixes all of the pathnames with the
remaining part of the path. I'm not sure that the CIFS standard
actually allows you to do a tree-connect to the subdir of a share,
though maybe it does...

> > What kernel is this? You might get some milage by looking at network
> > captures and seeing if you can determine why the QPathInfo call is
> > failing.
> >
> >   
> The kernel version is 2.6.22.4-65. For the last suggestion I would
> need a little more detailed instructions about how to look at the
> network captures.
> 

If smbclient is also failing to stat that directory then permissions
are most likely the cause. It sounds though like CIFS doesn't do well
trying to mount a share where it doesn't have permissions to access the
top level (even when it has access to stuff at lower levels). I'm not
sure that this is expected to work, actually, though maybe someone else
lurking here can comment...

-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list