diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2013-11-27 13:27:12 +0000 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-01-20 00:14:05 -0600 |
commit | 0ecdb4f572f6ab2219a01e3af349863f6e8b45af (patch) | |
tree | 7c0979808ff41e9d66f11342cb448e797865f395 /fs/cifs | |
parent | 0f8dce1cb7454f8795b73c5695a28e7a21a57ba0 (diff) | |
download | linux-rpi-0ecdb4f572f6ab2219a01e3af349863f6e8b45af.tar.gz linux-rpi-0ecdb4f572f6ab2219a01e3af349863f6e8b45af.tar.bz2 linux-rpi-0ecdb4f572f6ab2219a01e3af349863f6e8b45af.zip |
cifs: move unix extension call to cifs_query_symlink()
Unix extensions rigth now are only applicable to smb1 operations.
Move the check and subsequent unix extension call to the smb1
specific call to query_symlink() ie. cifs_query_symlink().
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-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) rc = query_mf_symlink(xid, tcon, cifs_sb, full_path, &target_path); - if ((rc != 0) && cap_unix(tcon->ses)) - rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, - cifs_sb->local_nls); - else if (rc != 0 && server->ops->query_symlink) + if (rc != 0 && server->ops->query_symlink) rc = server->ops->query_symlink(xid, tcon, full_path, &target_path, cifs_sb); 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, cifs_dbg(FYI, "%s: path: %s\n", __func__, full_path); + /* Check for unix extensions */ + if (cap_unix(tcon->ses)) { + rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, target_path, + cifs_sb->local_nls); + goto out; + } + rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, FILE_READ_ATTRIBUTES, OPEN_REPARSE_POINT, &netfid, &oplock, NULL, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (rc) - return rc; + goto out; rc = CIFSSMBQuerySymLink(xid, tcon, netfid, target_path, cifs_sb->local_nls); - if (rc) { - CIFSSMBClose(xid, tcon, netfid); - return rc; - } + if (rc) + goto out_close; convert_delimiter(*target_path, '/'); +out_close: CIFSSMBClose(xid, tcon, netfid); - cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path); +out: + if (!rc) + cifs_dbg(FYI, "%s: target path: %s\n", __func__, *target_path); return rc; } |