fs/cifs: make share unaccessible at root level mountable
commitb7e61a108f9fccd8d1b90ffe62704b929ba841eb
authorAurelien Aptel <aaptel@suse.com>
Wed, 25 May 2016 17:59:09 +0000 (25 19:59 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Sat, 20 Aug 2016 03:07:58 +0000 (19 23:07 -0400)
tree60029f363d940b1b94e555b1d53de45c6ad73639
parentb5e8e7f655d3d01430c357bdebe72a6ddc19e9a7
fs/cifs: make share unaccessible at root level mountable

[ Upstream commit a6b5058fafdf508904bbf16c29b24042cef3c496 ]

if, when mounting //HOST/share/sub/dir/foo we can query /sub/dir/foo but
not any of the path components above:

- store the /sub/dir/foo prefix in the cifs super_block info
- in the superblock, set root dentry to the subpath dentry (instead of
  the share root)
- set a flag in the superblock to remember it
- use prefixpath when building path from a dentry

fixes bso#8950

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
fs/cifs/cifs_fs_sb.h
fs/cifs/cifsfs.c
fs/cifs/connect.c
fs/cifs/dir.c
fs/cifs/inode.c