diff options
| -rw-r--r-- | fs/cifs/link.c | 5 | ||||
| -rw-r--r-- | fs/cifs/smb1ops.c | 20 |
2 files changed, 15 insertions, 10 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 5988b6060e8a..38b9bf4f5a6b 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
| @@ -518,10 +518,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) | |||
| 518 | rc = query_mf_symlink(xid, tcon, cifs_sb, full_path, | 518 | rc = query_mf_symlink(xid, tcon, cifs_sb, full_path, |
| 519 | &target_path); | 519 | &target_path); |
| 520 | 520 | ||
| 521 | if ((rc != 0) && cap_unix(tcon->ses)) | 521 | if (rc != 0 && server->ops->query_symlink) |
| 522 | rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, | ||
| 523 | cifs_sb->local_nls); | ||
| 524 | else if (rc != 0 && server->ops->query_symlink) | ||
| 525 | rc = server->ops->query_symlink(xid, tcon, full_path, | 522 | rc = server->ops->query_symlink(xid, tcon, full_path, |
| 526 | &target_path, cifs_sb); | 523 | &target_path, cifs_sb); |
| 527 | 524 | ||
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 1470ec4fc39d..988fddb72025 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
| @@ -918,23 +918,31 @@ cifs_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 918 | 918 | ||
| 919 | cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path); | 919 | cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path); |
| 920 | 920 | ||
| 921 | /* Check for unix extensions */ | ||
| 922 | if (cap_unix(tcon->ses)) { | ||
| 923 | rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, target_path, | ||
| 924 | cifs_sb->local_nls); | ||
| 925 | goto out; | ||
| 926 | } | ||
| 927 | |||
| 921 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, | 928 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, |
| 922 | FILE_READ_ATTRIBUTES, OPEN_REPARSE_POINT, &netfid, | 929 | FILE_READ_ATTRIBUTES, OPEN_REPARSE_POINT, &netfid, |
| 923 | &oplock, NULL, cifs_sb->local_nls, | 930 | &oplock, NULL, cifs_sb->local_nls, |
| 924 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 931 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
| 925 | if (rc) | 932 | if (rc) |
| 926 | return rc; | 933 | goto out; |
| 927 | 934 | ||
| 928 | rc = CIFSSMBQuerySymLink(xid, tcon, netfid, target_path, | 935 | rc = CIFSSMBQuerySymLink(xid, tcon, netfid, target_path, |
| 929 | cifs_sb->local_nls); | 936 | cifs_sb->local_nls); |
| 930 | if (rc) { | 937 | if (rc) |
| 931 | CIFSSMBClose(xid, tcon, netfid); | 938 | goto out_close; |
| 932 | return rc; | ||
| 933 | } | ||
| 934 | 939 | ||
| 935 | convert_delimiter(*target_path, '/'); | 940 | convert_delimiter(*target_path, '/'); |
| 941 | out_close: | ||
| 936 | CIFSSMBClose(xid, tcon, netfid); | 942 | CIFSSMBClose(xid, tcon, netfid); |
| 937 | cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path); | 943 | out: |
| 944 | if (!rc) | ||
| 945 | cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path); | ||
| 938 | return rc; | 946 | return rc; |
| 939 | } | 947 | } |
| 940 | 948 | ||
