From ebaf546a5584d0a75aa61e4872771008715b8639 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 10 Apr 2019 08:44:46 +1000 Subject: SMB3: Clean up query symlink when reparse point Two of the common symlink formats use reparse points (unlike mfsymlinks and also unlike the SMB1 posix extensions). This is the first part of the fixes to allow these reparse points (NFS style and Windows symlinks) to be resolved properly as symlinks by the client. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French --- fs/cifs/link.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'fs/cifs/link.c') diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 62216dc8f9f5..b736acd3917b 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -648,9 +648,16 @@ cifs_get_link(struct dentry *direntry, struct inode *inode, rc = query_mf_symlink(xid, tcon, cifs_sb, full_path, &target_path); - if (rc != 0 && server->ops->query_symlink) - rc = server->ops->query_symlink(xid, tcon, full_path, - &target_path, cifs_sb); + if (rc != 0 && server->ops->query_symlink) { + struct cifsInodeInfo *cifsi = CIFS_I(inode); + bool reparse_point = false; + + if (cifsi->cifsAttrs & ATTR_REPARSE) + reparse_point = true; + + rc = server->ops->query_symlink(xid, tcon, cifs_sb, full_path, + &target_path, reparse_point); + } kfree(full_path); free_xid(xid); -- cgit v1.2.3