summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2014-09-14 23:27:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-05 13:41:04 -0700
commitc804c77070b537e86e5ecc0dae7df80a1561be67 (patch)
tree4a164226f18e5e092963a76e5a3d51e6b3d7c365 /fs
parent1a77f346b0566094bf482a69ed7d6055d03cc572 (diff)
downloadlwn-c804c77070b537e86e5ecc0dae7df80a1561be67.tar.gz
lwn-c804c77070b537e86e5ecc0dae7df80a1561be67.zip
SMB3: Fix oops when creating symlinks on smb3
commit da80659d4aa758dc6935b10ec64513f0b67bc969 upstream. We were not checking for symlink support properly for SMB2/SMB3 mounts so could oops when mounted with mfsymlinks when try to create symlink when mfsymlinks on smb2/smb3 mounts Signed-off-by: Steve French <smfrench@gmail.com> CC: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/link.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 68559fd557fb..a5c2812ead68 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct cifs_tcon *tcon,
if (rc)
goto out;
- rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb,
- fromName, buf, &bytes_written);
+ if (tcon->ses->server->ops->create_mf_symlink)
+ rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
+ cifs_sb, fromName, buf, &bytes_written);
+ else
+ rc = -EOPNOTSUPP;
+
if (rc)
goto out;