diff options
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r-- | fs/cifs/link.c | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 1c2c3ce5020b..63f644000ce5 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -234,7 +234,6 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) | |||
234 | struct cifs_sb_info *cifs_sb; | 234 | struct cifs_sb_info *cifs_sb; |
235 | struct cifsTconInfo *pTcon; | 235 | struct cifsTconInfo *pTcon; |
236 | char *full_path = NULL; | 236 | char *full_path = NULL; |
237 | char *tmp_path = NULL; | ||
238 | char *tmpbuffer; | 237 | char *tmpbuffer; |
239 | int len; | 238 | int len; |
240 | __u16 fid; | 239 | __u16 fid; |
@@ -295,45 +294,9 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) | |||
295 | cFYI(1, ("Error closing junction point " | 294 | cFYI(1, ("Error closing junction point " |
296 | "(open for ioctl)")); | 295 | "(open for ioctl)")); |
297 | } | 296 | } |
298 | /* BB unwind this long, nested function, or remove BB */ | 297 | /* If it is a DFS junction earlier we would have gotten |
299 | if (rc == -EIO) { | 298 | PATH_NOT_COVERED returned from server so we do |
300 | /* Query if DFS Junction */ | 299 | not need to request the DFS info here */ |
301 | unsigned int num_referrals = 0; | ||
302 | struct dfs_info3_param *refs = NULL; | ||
303 | tmp_path = | ||
304 | kmalloc(MAX_TREE_SIZE + MAX_PATHCONF + 1, | ||
305 | GFP_KERNEL); | ||
306 | if (tmp_path) { | ||
307 | strncpy(tmp_path, pTcon->treeName, | ||
308 | MAX_TREE_SIZE); | ||
309 | strncat(tmp_path, full_path, | ||
310 | MAX_PATHCONF); | ||
311 | rc = get_dfs_path(xid, pTcon->ses, | ||
312 | tmp_path, | ||
313 | cifs_sb->local_nls, | ||
314 | &num_referrals, &refs, | ||
315 | cifs_sb->mnt_cifs_flags & | ||
316 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
317 | cFYI(1, ("Get DFS for %s rc = %d ", | ||
318 | tmp_path, rc)); | ||
319 | if ((num_referrals == 0) && (rc == 0)) | ||
320 | rc = -EACCES; | ||
321 | else { | ||
322 | cFYI(1, ("num referral: %d", | ||
323 | num_referrals)); | ||
324 | if (refs && refs->path_name) { | ||
325 | strncpy(tmpbuffer, | ||
326 | refs->path_name, | ||
327 | len-1); | ||
328 | } | ||
329 | } | ||
330 | kfree(refs); | ||
331 | kfree(tmp_path); | ||
332 | } | ||
333 | /* BB add code like else decode referrals | ||
334 | then memcpy to tmpbuffer and free referrals | ||
335 | string array BB */ | ||
336 | } | ||
337 | } | 300 | } |
338 | } | 301 | } |
339 | /* BB Anything else to do to handle recursive links? */ | 302 | /* BB Anything else to do to handle recursive links? */ |