]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
[CIFS] Provide sane values for nlink
authorJim McDonough <jmcd@samba.org>
Sat, 21 Sep 2013 15:36:10 +0000 (10:36 -0500)
committerSteve French <smfrench@gmail.com>
Sat, 21 Sep 2013 15:36:10 +0000 (10:36 -0500)
commit74d290da476f672ad756634d12aa707375d3564d
treeaa972423ddb39e39d49cca13349eb9e07c3d70c3
parent9ae6cf606a33b0a762798df0fb742848bcc685b5
[CIFS] Provide sane values for nlink

Since we don't get info about the number of links from the readdir
linfo levels, stat() will return 0 for st_nlink, and in particular,
samba re-exported shares will show directories as files (as samba is
keying off st_nlink before evaluating how to set the dos modebits)
when doing a dir or ls.

Copy nlink to the inode, unless it wasn't provided.  Provide
sane values if we don't have an existing one and none was provided.

Signed-off-by: Jim McDonough <jmcd@samba.org>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/cifsglob.h
fs/cifs/inode.c
fs/cifs/readdir.c