[SMB3] Fix oops when creating symlinks on smb3
authorSteve French <smfrench@gmail.com>
Mon, 15 Sep 2014 04:27:09 +0000 (23:27 -0500)
committerSteve French <smfrench@gmail.com>
Mon, 15 Sep 2014 08:04:50 +0000 (03:04 -0500)
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: <stable@vger.kernel.org> # 3.14+
CC: Sachin Prabhu <sprabhu@redhat.com>
fs/cifs/link.c

index 68559fd557fbbc845e71c71498f314887494c7fc..a5c2812ead6831faf5e97645ab770384fcca096d 100644 (file)
@@ -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;