diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/smb1ops.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 988fddb72025..abd2cc9515c9 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -908,6 +908,33 @@ cifs_mand_lock(const unsigned int xid, struct cifsFileInfo *cfile, __u64 offset, | |||
908 | } | 908 | } |
909 | 909 | ||
910 | static int | 910 | static int |
911 | cifs_unix_dfs_readlink(const unsigned int xid, struct cifs_tcon *tcon, | ||
912 | const unsigned char *searchName, char **symlinkinfo, | ||
913 | const struct nls_table *nls_codepage) | ||
914 | { | ||
915 | #ifdef CONFIG_CIFS_DFS_UPCALL | ||
916 | int rc; | ||
917 | unsigned int num_referrals = 0; | ||
918 | struct dfs_info3_param *referrals = NULL; | ||
919 | |||
920 | rc = get_dfs_path(xid, tcon->ses, searchName, nls_codepage, | ||
921 | &num_referrals, &referrals, 0); | ||
922 | |||
923 | if (!rc && num_referrals > 0) { | ||
924 | *symlinkinfo = kstrndup(referrals->node_name, | ||
925 | strlen(referrals->node_name), | ||
926 | GFP_KERNEL); | ||
927 | if (!*symlinkinfo) | ||
928 | rc = -ENOMEM; | ||
929 | free_dfs_info_array(referrals, num_referrals); | ||
930 | } | ||
931 | return rc; | ||
932 | #else /* No DFS support */ | ||
933 | return -EREMOTE; | ||
934 | #endif | ||
935 | } | ||
936 | |||
937 | static int | ||
911 | cifs_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, | 938 | cifs_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, |
912 | const char *full_path, char **target_path, | 939 | const char *full_path, char **target_path, |
913 | struct cifs_sb_info *cifs_sb) | 940 | struct cifs_sb_info *cifs_sb) |
@@ -922,6 +949,11 @@ cifs_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, | |||
922 | if (cap_unix(tcon->ses)) { | 949 | if (cap_unix(tcon->ses)) { |
923 | rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, target_path, | 950 | rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, target_path, |
924 | cifs_sb->local_nls); | 951 | cifs_sb->local_nls); |
952 | if (rc == -EREMOTE) | ||
953 | rc = cifs_unix_dfs_readlink(xid, tcon, full_path, | ||
954 | target_path, | ||
955 | cifs_sb->local_nls); | ||
956 | |||
925 | goto out; | 957 | goto out; |
926 | } | 958 | } |
927 | 959 | ||